KeyStrokes don't work anymore with Mac [message #1801499] |
Mon, 21 January 2019 10:03 |
|
Hi,
I have migrated my Eclipse plugins project to eclipse 2018-12, checked with latest swtbot 2.8 or 2.9 versions....
My testcase is:
@RunWith(SWTBotJunit4ClassRunner.class)
public class SmallUiTest {
@Test
public void simpleTest() throws Exception {
//Close the welcome dialog
SWTWorkbenchBot swtWorkbenchBot = new SWTWorkbenchBot();
swtWorkbenchBot.viewByTitle("Welcome").close();
//Try to open "Open resource" dialog with COMMAND-SHIFT-R, but doesn't open anything
swtWorkbenchBot.activeShell().pressShortcut(SWT.COMMAND | SWT.SHIFT, 'R');
SWTBotShell openResourceShell = swtWorkbenchBot.shell("Open Resource");
System.out.println (openResourceShell.getText());
}
}
and I expect the "Open resource" dialog to open, but this seems to fail
I am using macOs 10.14.2, jdk 1.8.0_191-b1.
Would be nice if you could give me a hint why this does not work anymore. This code worked with same version of swtbot but older eclipse (and perhaps older version of macos - don't know exactly anymore).
Thanks in advance
Cheers
Markus
|
|
|
|
Re: KeyStrokes don't work anymore with Mac [message #1801556 is a reply to message #1801527] |
Tue, 22 January 2019 14:22 |
|
Hi Patrick,
thank you for your suggestion.
I tried to be more explicit with:
SWTBotTree tree = swtWorkbenchBot.viewByPartName("Project Explorer").bot().tree();
System.out.println ("Tree is active: " + tree.isActive() + "-" + tree);
tree.setFocus();
tree.pressShortcut(SWT.COMMAND | SWT.SHIFT, 'r');
but - also the tree is active - and I even set the focus the dialog is not being opened....
|
|
|
|
Re: KeyStrokes don't work anymore with Mac [message #1801595 is a reply to message #1801564] |
Wed, 23 January 2019 09:40 |
|
Sorry, doesn't work, but I saw another thing, that could give us an hint from output, perhaps it's the bold warning, which leads to my problem:
Perspective: Resource
View: Project Explorer-Project Explorer
View: Outline-Outline
View: Tasks-Tasks
Shell: null-PartRenderingEngine's limbo-
Shell: null-junit-workspace - Eclipse Platform-
Shell: null-Quick Access-
Shell: null--
Project Explorer view: org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView@29929614
Tree is active: true
2019-01-23 10:37:01.172 java[89142:8195649] pid(89142)/euid(503) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
My testcase:
@RunWith(SWTBotJunit4ClassRunner.class)
public class SmallUiTest {
@Test
public void simpleTest() throws Exception {
//Close the welcome dialog
SWTWorkbenchBot swtWorkbenchBot = new SWTWorkbenchBot();
swtWorkbenchBot.viewByTitle("Welcome").close();
System.out.println ("Perspective: " + swtWorkbenchBot.activePerspective().getLabel());
for (SWTBotView nextView: swtWorkbenchBot.views()) {
System.out.println ("View: " + nextView.getTitle() + "-" + nextView.getReference().getPartName());
}
for (SWTBotShell nextShell: swtWorkbenchBot.shells()) {
System.out.println ("Shell: " + nextShell.getId() + "-" + nextShell.getText() + "-" + nextShell.getToolTipText());
}
System.out.println ("Project Explorer view: " + swtWorkbenchBot.viewByPartName("Project Explorer"));
//Try to open "Open resource" dialog with COMMAND-SHIFT-R, but doesn't open anything
SWTBotTree tree = swtWorkbenchBot.viewByPartName("Project Explorer").bot().tree();
System.out.println ("Tree is active: " + tree.isActive());
tree.pressShortcut(SWT.COMMAND | SWT.SHIFT, 'R');
Thread.sleep(10000);
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.04447 seconds