Created tests for the "New" menu
authorn.hoffmann <n.hoffmann@localhost>
Mon, 11 Apr 2011 15:15:32 +0000 (15:15 +0000)
committern.hoffmann <n.hoffmann@localhost>
Mon, 11 Apr 2011 15:15:32 +0000 (15:15 +0000)
.gitattributes
.gitignore
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/AbstractEditorTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewMenuTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewTaxonWizardTest.java [new file with mode: 0644]

index 8a59704..7752fba 100644 (file)
@@ -1207,6 +1207,8 @@ eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/AbstractEd
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/ClassificationTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/ContextMenuHelper.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/LoginTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewMenuTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewTaxonWizardTest.java -text
 /pom.xml -text
 src/changes/changes.xml -text
 src/site/apt/download.apt -text
index 0786f50..f7845dd 100644 (file)
@@ -97,6 +97,7 @@ eu.etaxonomy.taxeditor.store/.project
 eu.etaxonomy.taxeditor.store/.settings
 eu.etaxonomy.taxeditor.store/hibernate.log
 eu.etaxonomy.taxeditor.store/target
+eu.etaxonomy.taxeditor.test/screenshots/*.jpeg
 /runtime-taxeditor.product
 /target
 /workspace
index ff28acb..f6da772 100644 (file)
@@ -61,5 +61,15 @@ public abstract class AbstractEditorTest {
                return bot.viewByTitle(title);\r
        }\r
        \r
+       public void cancel() {\r
+               clickButton("Cancel");\r
+       }\r
+       \r
+       public void ok() {\r
+               clickButton("OK");\r
+       }\r
        \r
+       public void clickButton(String label) {\r
+               bot.button(label).click();\r
+       }\r
 }\r
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewMenuTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewMenuTest.java
new file mode 100644 (file)
index 0000000..cb49f1f
--- /dev/null
@@ -0,0 +1,65 @@
+package eu.etaxonomy.taxeditor.test;\r
+\r
+import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Test;\r
+\r
+/**\r
+ * Open all new menus\r
+ * \r
+ * @author n.hoffmann\r
+ *\r
+ */\r
+public class NewMenuTest extends AbstractEditorTest {\r
+\r
+       @Test\r
+       public void canOpenNewWizardForTaxon(){\r
+               openNewWizardFor("Taxon");\r
+               cancel();\r
+       }\r
+       \r
+\r
+       @Test\r
+       public void canOpenNewWizardForReference(){\r
+               openNewWizardFor("Reference");\r
+               cancel();\r
+       }\r
+       \r
+       \r
+       @Test\r
+       public void canOpenNewWizardForName(){\r
+               openNewWizardFor("Name");\r
+               cancel();\r
+       }\r
+       \r
+       \r
+       @Test\r
+       public void canOpenNewWizardForTeam(){\r
+               openNewWizardFor("Team");\r
+               cancel();\r
+       }\r
+       \r
+       \r
+       @Test\r
+       public void canOpenNewWizardForPerson(){\r
+               openNewWizardFor("Person");\r
+               cancel();\r
+       }\r
+       \r
+       @Test\r
+       public void canOpenNewWizardForSpecimen(){\r
+               openNewWizardFor("Specimen");\r
+               cancel();\r
+       }\r
+       \r
+       \r
+       @Test\r
+       public void canOpenNewWizardForClassification(){\r
+               openNewWizardFor("Classification");\r
+               cancel();\r
+       }\r
+\r
+       private void openNewWizardFor(String entity) {\r
+               bot.menu("General").menu("New").menu(entity).click();\r
+               bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
+       }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewTaxonWizardTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/NewTaxonWizardTest.java
new file mode 100644 (file)
index 0000000..7fc285c
--- /dev/null
@@ -0,0 +1,35 @@
+/**\r
+ * \r
+ */\r
+package eu.etaxonomy.taxeditor.test;\r
+\r
+import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.After;\r
+import org.junit.Ignore;\r
+import org.junit.Test;\r
+\r
+/**\r
+ * @author n.hoffmann\r
+ *\r
+ */\r
+public class NewTaxonWizardTest extends AbstractEditorTest {\r
+\r
+       @Override\r
+       public void setup() {\r
+               super.setup();\r
+               bot.menu("General").menu("New").menu("Taxon").click();\r
+               bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
+       }\r
+       \r
+       @Ignore\r
+       @Test\r
+       public void canSelectClassification() {\r
+               bot.button("Browse existing").click();\r
+               bot.waitUntil(Conditions.shellIsActive("Choose a Classification"));\r
+       }\r
+       \r
+       @After\r
+       public void tearDown() {\r
+               clickButton("Finish");\r
+       }\r
+}\r