UI Tester updates - Instance editor implementation#1208
UI Tester updates - Instance editor implementation#1208aaronayres35 merged 10 commits intomasterfrom
Conversation
…that I had to make a change to wx isntance editor itself to access ui - this idea was taken from Kits draft branch
| editor = instance.locate(locator.NestedUI()) | ||
| value_txt = editor.find_by_name("value") |
There was a problem hiding this comment.
Suppose we remove press_ok_button (see comment below), could we write value_text = tester.find_by_name(ui, "inst").find_by_name("value") instead?
| target : instance of SimpleEditor | ||
| """ | ||
| if target._dialog_ui is None: | ||
| target._button.click() |
There was a problem hiding this comment.
Perhaps we should move this out to a MouseClick interaction, and only after that the nested UI can be queried.
This will make the test_simple_editor_parent_closed test less awkward... and it can make use of delay?
Apparently the button can be clicked multiple times to launch multiple dialog (all editing the same object).
Extracting the mouse click action to a separate interaction will allow these scenarios to be tested more easily.
This would mean the tests for the simple style and custom style cannot be combined... but I think that's okay, because they do represent different behaviour.
There was a problem hiding this comment.
Now these two lines can be removed as they are redundant in tests where a mouse click is performed prior to querying for the dialog UI. I am sorry I probably should have done that in #1206 😓 .
If the test code tries to navigate into the dialog UI without performing a mouse click first, the dialog UI is None and we get an error anyway complaining no location solvers are registered on None. It might be nicer to raise early with a different error message but I think it might be a bit overkill.
…1212) * Move MouseClick to a separate interaction for simple instance editor * Reuse the wrapper already available Co-authored-by: aaronayres35 <36972686+aaronayres35@users.noreply.github.com>
| target : instance of SimpleEditor | ||
| """ | ||
| if target._dialog_ui is None: | ||
| target._button.click() |
There was a problem hiding this comment.
Now these two lines can be removed as they are redundant in tests where a mouse click is performed prior to querying for the dialog UI. I am sorry I probably should have done that in #1206 😓 .
If the test code tries to navigate into the dialog UI without performing a mouse click first, the dialog UI is None and we get an error anyway complaining no location solvers are registered on None. It might be nicer to raise early with a different error message but I think it might be a bit overkill.
fixes #1206
Adds a simple implementation for Instance editor, and modifies tests to now use UI Tester. Also adds an additional test to see that the displayed editor updates if a trait changes externally to the editor.
Note: the code for the wx instance editor had to be changed very slightly in order to gain access to the ui of interest. This idea was take from kit's draft branch #1150