menu-traversal-refactor #109
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Activity:Doing
Activity:Proposal
Runner
AT
Runner
CLI
Runner
HTTP
cleanup
devops
easypeasy
exchange
l8ter
legacy
optimization
privilege
refactor
smell
support
tooling
ux
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: urdt/ussd#109
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "menu-traversal-refactor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Introduction of the menu traversal tests for the core menu nodes
@ -0,0 +31,4 @@
return sessionsData, err
}
func CreateTestCases(group DataGroup) []struct {
I prefer typedef instead of inline structs, the latter is hard to read.
should this be an extension of StepTest?
Created a TestCase struct for generating the test cases: Commit :
810dd74e43
.@ -0,0 +1,55 @@
package driver
please remove space in filename
Updated by commit:
3afe35b44f
,the setup driver functionality is now in the group driver.@ -0,0 +6,4 @@
"os"
)
type Step struct {
aren't these structs more or less the same as in the groupdriver.go
can't we just reuse the definitions?
Updated by commit:
3afe35b44f
,the setup driver functionality is now in the group driver.@ -0,0 +36,4 @@
return sessions
}
func FilterGroupsByName(groups []Group, name string) []Group {
Can we please use regex here, match start of string
@ -0,0 +1,111 @@
package engine
can we hide all of this under internal/testutil or something?
Also, I don't think we need a subdirectory engine/ for this, unless there is a specific point to it?
This has now been moved to internal/testutil
This has now been moved to internal/testutil. Commit:
96aec1fd67
@ -0,0 +2,4 @@
package engine
const OnlineTestEnabled = false
I would just define the accountservice as a global directly here, instead of the detour of defining a variable
@ -1 +1 @@
Confirm your new PIN:
Confirm your new PIN:
no visible change. stray non-printable char?
@ -18,3 +19,4 @@ INCMP enter_yob 4
INCMP enter_location 5
INCMP enter_offerings 6
INCMP view_profile 7
remove all blank lines please
The blank line is required to be able to compile the .vis files,Without this,we would get an 'EOF' error.
@ -0,0 +76,4 @@
t.Fatalf("Test case '%s' failed during Flush: %v", group.Name, err)
}
b := w.Bytes()
if !bytes.Equal(b, []byte(step.ExpectedContent)) {
Can you please implement the check as a function of the step struct (in reality, any struct that has
ExpectedContent
), and use regex for the match check instead?The latter will enable us to have more flexible match criteria, as having literal checks everywhere will make it impossible to test dynamic data.
@ -0,0 +83,4 @@
}
}
// Adding a sleep after the test to wait for registration to complete the process
time.Sleep(5 * time.Second)
Only if run online right?
Can we make this a callback that could theoretically listen to an event channel instead? That means, abstract the wait for result (and in the case of offline test no wait).
@lash ,So the idea for this would be to setup an event channel in the TestEngine that would block the other test calls for 5 seconds ,if the online tag is defined.For reference and input:
96aec1fd67
@ -0,0 +27,4 @@
ctx = context.WithValue(ctx, "SessionId", sessionId)
pfp := path.Join(scriptDir, "pp.csv")
var eventChannel = make(chan bool)
My intuition tells me that having an abstraction of the account service
TestAccountService
that includes a methodWaitForAccount
would be easier to understand down the road.Also, please see the comment about not using vars but instead setting that testaccountservice object explicitly as a global variable.
If this is unclear, I can try to explain better with an example if needed.
@lash ,For clarity,you mind giving a simple example for using the testaccountservice globally?
lash referenced this pull request2024-10-18 15:27:15 +02:00
obsoleted by #115
Pull request closed