Compare commits
No commits in common. "9eb35ec52d589f7580284f108774179f5cd89ae2" and "cf5b4ec74493ee809e2843538689b45cd796ddbc" have entirely different histories.
9eb35ec52d
...
cf5b4ec744
@ -78,59 +78,3 @@ func TestTerms(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccountRegistrationRejectTerms(t *testing.T) {
|
|
||||||
en, _ := enginetest.TestEngine("session1234112")
|
|
||||||
defer en.Finish()
|
|
||||||
var err error
|
|
||||||
ctx := context.Background()
|
|
||||||
sessions := testData
|
|
||||||
for _, session := range sessions {
|
|
||||||
groups := driver.FilterGroupsByName(session.Groups, "account_creation_reject_terms")
|
|
||||||
for _, group := range groups {
|
|
||||||
for _, step := range group.Steps {
|
|
||||||
cont, _ := en.Exec(ctx, []byte(step.Input))
|
|
||||||
if cont {
|
|
||||||
w := bytes.NewBuffer(nil)
|
|
||||||
_, err = en.Flush(ctx, w)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
b := w.Bytes()
|
|
||||||
if !bytes.Equal(b, []byte(step.ExpectedContent)) {
|
|
||||||
t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", step.ExpectedContent, b)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAccountRegistrationInvalidPin(t *testing.T) {
|
|
||||||
en, _ := enginetest.TestEngine("session1234112")
|
|
||||||
defer en.Finish()
|
|
||||||
var err error
|
|
||||||
ctx := context.Background()
|
|
||||||
sessions := testData
|
|
||||||
for _, session := range sessions {
|
|
||||||
groups := driver.FilterGroupsByName(session.Groups, "account_creation_invalid_pin")
|
|
||||||
for _, group := range groups {
|
|
||||||
for _, step := range group.Steps {
|
|
||||||
cont, _ := en.Exec(ctx, []byte(step.Input))
|
|
||||||
if cont {
|
|
||||||
w := bytes.NewBuffer(nil)
|
|
||||||
_, err = en.Flush(ctx, w)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
b := w.Bytes()
|
|
||||||
if !bytes.Equal(b, []byte(step.ExpectedContent)) {
|
|
||||||
t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", step.ExpectedContent, b)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"input": "1234",
|
"input": "1234",
|
||||||
"expectedContent": "Your account is being created...Thank you for using Sarafu. Goodbye!"
|
"expectedContent": "Enter your four number PIN again:"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -43,57 +43,6 @@
|
|||||||
"expectedContent": "Please enter a new four number PIN for your account:\n0:Exit"
|
"expectedContent": "Please enter a new four number PIN for your account:\n0:Exit"
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "account_creation_reject_terms",
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"input": "",
|
|
||||||
"expectedContent": "Welcome to Sarafu Network\nPlease select a language\n0:english\n1:kiswahili"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "0",
|
|
||||||
"expectedContent": "Do you agree to terms and conditions?\n0:yes\n1:no"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "1",
|
|
||||||
"expectedContent": "Thank you for using Sarafu. Goodbye!"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "account_creation_invalid_pin",
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"input": "",
|
|
||||||
"expectedContent": "Welcome to Sarafu Network\nPlease select a language\n0:english\n1:kiswahili"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "0",
|
|
||||||
"expectedContent": "Do you agree to terms and conditions?\n0:yes\n1:no"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "0",
|
|
||||||
"expectedContent": "Please enter a new four number PIN for your account:\n0:Exit"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "1234",
|
|
||||||
"expectedContent": "Enter your four number PIN again:"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "1111",
|
|
||||||
"expectedContent": "The PIN is not a match. Try again\n1:retry\n9:Quit"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "1",
|
|
||||||
"expectedContent": "Enter your four number PIN again:"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"input": "1234",
|
|
||||||
"expectedContent": "Your account is being created...Thank you for using Sarafu. Goodbye!"
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user