Author: jjankovi
Date: 2012-02-08 09:44:11 -0500 (Wed, 08 Feb 2012)
New Revision: 38506
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java
Log:
Added method to check if button can be clicked + logging for wait conditions in method
finishWithWait
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java 2012-02-08
14:42:08 UTC (rev 38505)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java 2012-02-08
14:44:11 UTC (rev 38506)
@@ -52,7 +52,7 @@
bot().waitUntil(new ShellIsActiveCondition(activeShell));
return this;
}
-
+
public void cancel() {
clickButton(IDELabel.Button.CANCEL);
}
@@ -64,8 +64,11 @@
public void finishWithWait() {
SWTBotShell activeShell = getActiveShell();
finish();
+ log.info("Waiting until active shell is active");
bot().waitWhile(new ShellIsActiveCondition(activeShell),
TaskDuration.LONG.getTimeout());
+ log.info("Waiting until Progress Information Shell is active");
bot().waitWhile(new ProgressInformationShellIsActiveCondition(),
TaskDuration.LONG.getTimeout());
+ log.info("Waiting until Non System Jobs run");
bot().waitWhile(new NonSystemJobRunsCondition(), TaskDuration.LONG.getTimeout());
}
@@ -79,6 +82,18 @@
t.setFocus();
t.setText(text);
}
+
+ public boolean canFinish() {
+ return canClickButton(IDELabel.Button.FINISH);
+ }
+
+ public boolean canNext() {
+ return canClickButton(IDELabel.Button.NEXT);
+ }
+
+ protected boolean canClickButton(String buttonText) {
+ return bot().button(buttonText).isEnabled();
+ }
private SWTBotShell getActiveShell(){
for (SWTBotShell shell : bot().shells()){
Show replies by date