Author: lzoubek(a)redhat.com
Date: 2011-03-02 04:34:45 -0500 (Wed, 02 Mar 2011)
New Revision: 29441
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJava.java
Log:
swtbotext: added wizard
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2011-03-02
09:03:08 UTC (rev 29440)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2011-03-02
09:34:45 UTC (rev 29441)
@@ -84,6 +84,9 @@
public void selectTreeNode(IActionItem item) {
selectTreeNode(this.bot,item);
}
+ public void selectTreeNode(SWTBot bot, String... items) {
+ selectTreeNode(bot,ActionItem.create(items));
+ }
/**
* selects given actionItem in bot's tree();
*
@@ -175,7 +178,6 @@
bot.button("Next >").click();
return bot;
}
-
/**
* Wait for appearance shell of given name
*
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJava.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJava.java 2011-03-02
09:03:08 UTC (rev 29440)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJava.java 2011-03-02
09:34:45 UTC (rev 29441)
@@ -11,7 +11,7 @@
/**
* requirement for adding JRE/JDK
- * @param version to add
+ * @param user to add
*/
public AddJava() {
}
Added:
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
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java 2011-03-02
09:34:45 UTC (rev 29441)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ui.bot.ext.wizards;
+
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+
+public class SWTBotWizard extends SWTBotShell {
+
+ public SWTBotWizard() {
+ this(SWTTestExt.bot.activeShell().widget);
+ }
+
+ public SWTBotWizard(Shell shell) {
+ super(shell);
+ assert getText().contains("New ");
+ }
+
+ public SWTBotWizard selectTemplate(String... item) {
+ SWTTestExt.open.selectTreeNode(this.bot(),item);
+ return this;
+ }
+
+ public SWTBotWizard back() {
+ clickButton("< Back");
+ return this;
+ }
+
+ public SWTBotWizard next() {
+ clickButton("Next >");
+ return this;
+ }
+
+ public void cancel() {
+ clickButton("Cancel");
+ }
+
+ public void finish() {
+ clickButton("Finish");
+ }
+
+ protected void clickButton(String text) {
+ bot().button(text).click();
+ bot().sleep(500);
+ }
+
+ protected void setText(String label, String text) {
+ SWTBotText t = bot().textWithLabel(label);
+ t.setFocus();
+ t.setText(text);
+ }
+}