Open e1fueg0 opened 2 years ago
I cannot quite decide which is the better approach here:
test
package that manage user interaction for dialog using internal codeConfirm
and Dismiss
functions to dialog that could then be called by developer code (and possible test helpers).This may require a little feedback from the community. Either way it needs new APIs so adding to Bowmore release.
Is your feature request related to a problem? Please describe:
Let's consider a simple dialog like this:
How do I test full dialog cycle: 1) to fill the field with a test value, 2) to press the submit button so that the assigned function works, and 3) to check whether file with given test value has been written. And, in opposite, 1) to fill the field, 2) to press the cancel button, 3) to check the file has not been written.
Is it possible to construct a solution with the existing API?
No.
Describe the solution you'd like to see:
I did a simple kinda framework to test dialogs for my app. Hope this will help you.
Instead of calling dialog.NewForm directly I do this:
and afterwards I call newForm with the same arguments, as follows:
A test looks like this:
And here's the code of the implementation: