Skip to content

Commit

Permalink
Fixed getWidgetFromPartWhenOtherShellIsActive test
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
  • Loading branch information
olkornii authored and odockal committed Aug 30, 2023
1 parent 2ba3ff1 commit a36c7ab
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

import org.eclipse.reddeer.common.exception.RedDeerException;
import org.eclipse.reddeer.common.matcher.RegexMatcher;
import org.eclipse.reddeer.common.wait.WaitWhile;
import org.eclipse.reddeer.common.wait.WaitUntil;
import org.eclipse.reddeer.core.matcher.WithTextMatcher;
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.eclipse.reddeer.swt.condition.ShellIsAvailable;
import org.eclipse.reddeer.swt.impl.menu.ShellMenuItem;
import org.eclipse.reddeer.swt.impl.shell.DefaultShell;
import org.eclipse.reddeer.swt.impl.table.DefaultTable;
import org.eclipse.reddeer.swt.impl.table.DefaultTableItem;
import org.eclipse.reddeer.swt.impl.text.DefaultText;
Expand Down Expand Up @@ -98,13 +99,14 @@ public void testPartAsReferencedComposite() {

@Test
public void getWidgetFromPartWhenOtherShellIsActive() {
new ShellMenuItem("Help","About");
new WaitWhile(new ShellIsAvailable("About"));
new ShellMenuItem("Help","About").select();
new WaitUntil(new ShellIsAvailable("About"));

try {
new DefaultTableItem("Sample item 1");
} catch (RedDeerException e) {
//not found which is ok because About shell is open
new DefaultShell("About").close();
return;
}
fail();
Expand Down

0 comments on commit a36c7ab

Please sign in to comment.