SWTBotNatTable opens dialog twice [message #1828045] |
Fri, 29 May 2020 20:38  |
|
I'm at my wits end.
I have a NatTable with a contextMenu for column headers. It works perfectly fine when running the application itself and doing manual clicks.
Now I've tried to write a simple UI test for the dialog, just opening and closing it by clicking on "OK".
The test looks like this:
@Test
void testChangeAnnotationDialog() {
openDefaultExample(); // Opens example data and populates the table
SWTNatTableBot tableBot = new SWTNatTableBot();
SWTBotNatTable table = tableBot.nattable();
table.contextMenu(0, 2).contextMenu("Open dialog").click();
SWTBotShell dialog = tableBot.shell("Dialog");
tableBot.button("OK").click();
bot.waitUntil(Conditions.shellCloses(dialog));
}
The test (run in an Eclipse RCP product) passes in Eclipse when run by itself, but the dialog is opened twice during the test!
This has two problems:
- When running the test by itself, I get exceptions thrown in the console (java.lang.IllegalStateException: Application does not have an active window + an NPE from the command handler.)
- The test kills all other UI tests of the same and other classes when run via Run Config, both in Eclipse and via Tycho.
I'd be thankful for any ideas why the dialog would be opened twice during the test run! (Ading some bot.sleep()s, I can even see it with my own eyes...)
|
|
|
|
Powered by
FUDForum. Page generated in 0.02006 seconds