Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2018-11-23 20:11:37 +0000
committerPatrick Tasse2018-11-23 20:11:37 +0000
commitaee81dacdee0679fa2cf08f2e99f5e7cd11ef04c (patch)
tree6015c08574da8d26bc90ddcf5a93b99f8a1e3e87
parent1e677741bb91fc4be48737b6f9b8276cc3b8a672 (diff)
downloadorg.eclipse.swtbot-aee81dacdee0679fa2cf08f2e99f5e7cd11ef04c.tar.gz
org.eclipse.swtbot-aee81dacdee0679fa2cf08f2e99f5e7cd11ef04c.tar.xz
org.eclipse.swtbot-aee81dacdee0679fa2cf08f2e99f5e7cd11ef04c.zip
Bug 541519: SWTBotFactory.widgets() searches widgets from wrong parent
Change-Id: I7a03193d29571ad75eee11e30c14b03dba6b6cff Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java
index b3fb8bbc..9399b68a 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java
@@ -372,7 +372,7 @@ abstract class SWTBotFactory {
/**
* @param matcher the matcher used to match widgets.
* @param parentWidget the parent widget to search for a given widget.
- * @return a list of widgets that match the matcher.
+ * @return a list of widgets in the parent widget that match the matcher.
*/
public <T extends Widget> List<? extends T> widgets(Matcher<T> matcher, Widget parentWidget) {
WaitForObjectCondition<T> waitForWidget = waitForWidget(matcher, parentWidget);
@@ -382,10 +382,12 @@ abstract class SWTBotFactory {
/**
* @param matcher the matcher used to match widgets.
- * @return a list of widgets in the active shell that match the matcher.
+ * @return a list of widgets that match the matcher.
*/
public <T extends Widget> List<? extends T> widgets(Matcher<T> matcher) {
- return widgets(matcher, activeShell().widget);
+ WaitForObjectCondition<T> waitForWidget = waitForWidget(matcher);
+ waitUntilWidgetAppears(waitForWidget);
+ return waitForWidget.getAllMatches();
}
/**

Back to the top