Commit 18d3d06a authored by Robert Smith's avatar Robert Smith

Added SWTBot UI test maven build

Added org.eclipse.ice.aggregator.swtbot which contains a pom for a Maven
build which will run all our SWTBot integration tests. 
Signed-off-by: Robert Smith's avatarRobert Smith <smithrw@ornl.gov>
parent 3df3f40d
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.ice.aggregator.swtbot</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.ice.aggregator</groupId>
<artifactId>org.eclipse.ice.aggregator</artifactId>
<packaging>pom</packaging>
<name>Eclipse ICE SWTBot UI Integration Tests Aggregator</name>
<description>Aggregator Bundle for running the SWTBot UI tests for Eclipse ICE</description>
<parent>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.build</artifactId>
<version>2.2.0-SNAPSHOT</version>
<relativePath>../org.eclipse.ice.parent/pom.xml</relativePath>
</parent>
<modules>
<module>../org.eclipse.ice.tests.ui.swtbot</module>
<module>../org.eclipse.ice.caebat.batml</module>
<module>../org.eclipse.ice.client</module>
<module>../org.eclipse.ice.client.compatibility</module>
<module>../org.eclipse.ice.client.rcp</module>
<module>../org.eclipse.ice.client.widgets</module>
<module>../org.eclipse.ice.client.widgets.moose</module>
<module>../org.eclipse.ice.core</module>
<module>../org.eclipse.ice.datastructures</module>
<module>../org.eclipse.ice.developer</module>
<module>../org.eclipse.ice.developer.moose</module>
<module>../org.eclipse.ice.geometry</module>
<module>../org.eclipse.ice.io</module>
<module>../org.eclipse.ice.item</module>
<module>../org.eclipse.ice.materials</module>
<module>../org.eclipse.ice.materials.ui</module>
<module>../org.eclipse.ice.materials.feature</module>
<module>../org.eclipse.ice.mesh</module>
<module>../org.eclipse.ice.nek5000</module>
<module>../org.eclipse.ice.parent</module>
<module>../org.eclipse.ice.persistence.xml</module>
<module>../org.eclipse.ice.projectgeneration</module>
<module>../org.eclipse.ice.proteus</module>
<module>../org.eclipse.ice.reactor.plant</module>
<module>../org.eclipse.ice.reflectivity</module>
<module>../org.eclipse.ice.reflectivity.ui</module>
<module>../org.eclipse.ice.target.oxygen</module>
<module>../org.eclipse.ice.vibe</module>
</modules>
</project>
\ No newline at end of file
......@@ -36,3 +36,6 @@ Require-Bundle: org.eclipse.cdt;bundle-version="8.7.0",
org.eclipse.egit;bundle-version="4.0.0",
org.eclipse.ice.developer,
org.eclipse.ui
Export-Package: org.eclipse.ice.developer.moose.actions,
org.eclipse.ice.developer.moose.nature,
org.eclipse.ice.developer.moose.wizards
......@@ -12,3 +12,4 @@ Import-Package: org.eclipse.core.resources,
org.eclipse.ice.item
Service-Component: OSGI-INF/meshEditorComponent.xml
Bundle-Vendor: Oak Ridge National Laboratory
Export-Package: org.eclipse.ice.mesh.editor
......@@ -149,7 +149,7 @@ public abstract class AbstractWorkbenchTester extends
@Override
public void afterAllTests() {
// Dispose static or otherwise shared resources here.
// Nothing to do yet.
bot.resetWorkbench();
// Proceed with the default post-tests cleanup.
super.afterAllTests();
......
......@@ -2,19 +2,106 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ICE SWTBot UI Test Bundle
Bundle-SymbolicName: org.eclipse.ice.tests.ui.swtbot
Bundle-Version: 2.1.7.20150825
Bundle-Version: 2.2.0.qualifier
Bundle-Vendor: Oak Ridge National Laboratory
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: ca.odell.glazedlists,
ca.odell.glazedlists.gui,
org.eclipse.ice.client.common,
org.eclipse.ice.client.internal,
org.eclipse.e4.ui.workbench.addons.swt,
org.eclipse.eavp.viz,
org.eclipse.eavp.viz.service,
org.eclipse.eavp.viz.service.geometry.properties,
org.eclipse.eavp.viz.service.geometry.widgets,
org.eclipse.eavp.viz.service.javafx.geometry,
org.eclipse.eavp.viz.service.javafx.geometry.datatypes,
org.eclipse.eavp.viz.service.javafx.geometry.plant,
org.eclipse.eavp.viz.service.javafx.mesh,
org.eclipse.eavp.viz.service.javafx.mesh.datatypes,
org.eclipse.eavp.viz.service.paraview,
org.eclipse.eavp.viz.service.paraview.proxy,
org.eclipse.eavp.viz.service.paraview.web,
org.eclipse.eavp.viz.service.visit,
org.eclipse.equinox.http.jetty;version="1.4.0",
org.eclipse.equinox.simpleconfigurator.manipulator;version="2.0.0",
org.eclipse.ice.caebat.batml,
org.eclipse.ice.client.widgets,
org.eclipse.ice.client.widgets.analysis,
org.eclipse.ice.client.widgets.grid,
org.eclipse.ice.client.widgets.moose,
org.eclipse.ice.client.widgets.providers,
org.eclipse.ice.client.widgets.providers.Default,
org.eclipse.ice.datastructures.ICEObject,
org.eclipse.ice.datastructures.componentVisitor,
org.eclipse.ice.datastructures.entry,
org.eclipse.ice.datastructures.form,
org.eclipse.ice.datastructures.form.emf,
org.eclipse.ice.datastructures.form.iterator,
org.eclipse.ice.datastructures.form.painfullySimpleForm,
org.eclipse.ice.datastructures.internal,
org.eclipse.ice.datastructures.jaxbclassprovider,
org.eclipse.ice.datastructures.resource,
org.eclipse.ice.developer.actions,
org.eclipse.ice.developer.moose.actions,
org.eclipse.ice.developer.moose.nature,
org.eclipse.ice.developer.moose.wizards,
org.eclipse.ice.geometry,
org.eclipse.ice.io.csv,
org.eclipse.ice.io.ini,
org.eclipse.ice.io.ips,
org.eclipse.ice.io.serializable,
org.eclipse.ice.item,
org.eclipse.ice.item.action,
org.eclipse.ice.item.jobLauncher,
org.eclipse.ice.item.jobprofile,
org.eclipse.ice.item.messaging,
org.eclipse.ice.item.model,
org.eclipse.ice.item.nuclear,
org.eclipse.ice.item.persistence,
org.eclipse.ice.materials,
org.eclipse.ice.materials.ui,
org.eclipse.ice.materials.ui.perspectives,
org.eclipse.ice.mesh.editor,
org.eclipse.ice.nek5000,
org.eclipse.ice.proteus,
org.eclipse.ice.reactor.plant,
org.eclipse.ice.reflectivity,
org.eclipse.ice.reflectivity.ui,
org.eclipse.ice.tests.client.widgets.utils,
org.eclipse.ice.vibe.kvPair,
org.eclipse.ice.vibe.launcher,
org.eclipse.ice.vibe.model,
org.eclipse.january.geometry,
org.eclipse.january.geometry.model.importer,
org.eclipse.january.geometry.xtext.obj.importer,
org.eclipse.january.geometry.xtext.obj.ui.internal,
org.eclipse.january.geometry.xtext.vtk.importer,
org.eclipse.january.geometry.xtext.vtk.ui.internal,
org.eclipse.nebula.widgets.nattable;version="1.3.0",
org.eclipse.osgi.framework.console;version="1.1.0",
org.eclipse.osgi.framework.eventmgr;version="1.2.0",
org.eclipse.osgi.framework.log;version="1.1.0",
org.eclipse.osgi.report.resolution;version="1.0.0",
org.eclipse.osgi.service.datalocation;version="1.3.0",
org.eclipse.osgi.service.debug;version="1.2.0",
org.eclipse.osgi.service.environment;version="1.3.0",
org.eclipse.osgi.service.localization;version="1.1.0",
org.eclipse.osgi.service.runnable;version="1.1.0",
org.eclipse.osgi.service.urlconversion;version="1.0.0",
org.eclipse.osgi.storagemanager;version="1.0.0",
org.eclipse.osgi.util;version="1.1.0",
org.eclipse.platform.internal,
org.eclipse.ui,
org.eclipse.ui.forms,
org.eclipse.ui.forms.editor,
org.eclipse.ui.forms.events,
org.eclipse.ui.forms.widgets,
org.eclipse.ui.internal.views.properties.tabbed.view,
org.eclipse.ui.intro.config,
org.eclipse.ui.intro.contentproviders,
org.eclipse.ui.intro.quicklinks;version="1.0.0",
org.eclipse.ui.intro.universal,
org.eclipse.ui.views.properties.tabbed,
org.eclipse.update.configurator,
org.slf4j;version="1.7.2"
Require-Bundle: org.junit,
org.eclipse.swtbot.eclipse.core;bundle-version="2.2.1",
......
......@@ -10,7 +10,7 @@
<relativePath>../org.eclipse.ice.parent/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.ui.swtbot.test</artifactId>
<artifactId>org.eclipse.ice.tests.ui.swtbot</artifactId>
<packaging>eclipse-test-plugin</packaging>
<build>
......
......@@ -410,6 +410,8 @@ public class MaterialsDatabaseTester extends AbstractSWTTester {
assertTrue("Abs xs".equals(cellName));
cellValue = (double) realTable.getDataValueByPosition(2, 1);
assertEquals(0.231, cellValue);
bot.resetWorkbench();
}
/*
......
......@@ -92,7 +92,7 @@ public class ReflectivityModelTester extends AbstractWorkbenchTester {
// Check that the cancel button is working
assertTrue(bot.button("Cancel").isEnabled());
// Get the nattable
NatTable realTable = bot.widget(widgetOfType(NatTable.class));
SWTBotNatTable table = new SWTBotNatTable(realTable);
......@@ -120,26 +120,28 @@ public class ReflectivityModelTester extends AbstractWorkbenchTester {
assertEquals(6, table.rowCount());
// Select the new row and try to move it down a row. This shouldn't do
// anything.
// anything. Type the cell's current value into it to reset the focus
table.selectCell(bot, 0, 5);
bot.button("v").click();
bot.button(5).click();
cellName = (String) realTable.getDataValueByPosition(1, 6);
assertTrue("107Ag".equals(cellName));
// Move it up two rows
table.selectCell(bot, 0, 5);
bot.button("^").click();
bot.button("^").click();
bot.text().typeText("107Ag");
bot.button(4).click();
bot.button(4).click();
cellName = (String) realTable.getDataValueByPosition(1, 4);
assertTrue("107Ag".equals(cellName));
// Move it up five times. This should let it reach the top of the table
// then stop.
bot.button("^").click();
bot.button("^").click();
bot.button("^").click();
bot.button("^").click();
bot.button("^").click();
bot.button(4).click();
bot.button(4).click();
bot.button(4).click();
bot.button(4).click();
bot.button(4).click();
cellName = (String) realTable.getDataValueByPosition(1, 1);
assertTrue("107Ag".equals(cellName));
......@@ -150,7 +152,7 @@ public class ReflectivityModelTester extends AbstractWorkbenchTester {
assertTrue("Air".equals(cellName));
cellName = (String) realTable.getDataValueByPosition(1, 5);
assertTrue("Si".equals(cellName));
// Check that the wave vector file brows button is enabled
bot.viewByPartName("Properties").setFocus();
assertTrue(bot.button("Browse...").isEnabled());
......@@ -162,6 +164,7 @@ public class ReflectivityModelTester extends AbstractWorkbenchTester {
enterText("deltaQ1ByQ:", "invalid input");
enterText("Wave Length:", "invalid input");
}
/**
......
......@@ -65,16 +65,22 @@ public class VIBEKeyValuePairTester extends AbstractWorkbenchTester {
// Check that the cancel button is enabled
assertTrue(bot.button("Cancel").isEnabled());
//The table should be empty at the start
assertEquals(0, bot.table().rowCount());
//Set the table to the NTG template
bot.radio(1).click();
// Check the table's values for the default settings
assertTrue("ELECTRICAL".equals(bot.table(1).cell(0, 0)));
assertTrue("ELECTRICAL".equals(bot.table().cell(0, 0)));
// Change the first row's value to two
bot.table(1).click(0, 1);
bot.table().click(0, 1);
bot.text("1 ", 0).setText("2");
bot.table(1).click(0, 0);
bot.table().click(0, 0);
// Check that the cell was set
assertTrue("2".equals(bot.table(1).cell(0, 1)));
assertTrue("2".equals(bot.table().cell(0, 1)));
// Makes sure the form registers that it is dirty
assertTrue("There are unsaved changes on the form."
......@@ -85,55 +91,49 @@ public class VIBEKeyValuePairTester extends AbstractWorkbenchTester {
assertTrue(bot.clabel(0).getText().equals("Ready to process."));
// Make sure there are 21 rows
assertEquals(21, bot.table(1).rowCount());
assertEquals(21, bot.table().rowCount());
// Add a row and check that it is there.
bot.button("+").click();
assertEquals(22, bot.table(1).rowCount());
assertEquals(22, bot.table().rowCount());
// Remove the second from last row and test that there are one fewer
// rows and that the last row is empty.
bot.table(1).click(20, 0);
bot.table().click(20, 0);
bot.button("-").click();
assertEquals(21, bot.table(1).rowCount());
System.out.println(bot.table(1).cell(20, 0));
assertTrue("".equals(bot.table(1).cell(20, 0)));
assertEquals(21, bot.table().rowCount());
System.out.println(bot.table().cell(20, 0));
assertTrue("".equals(bot.table().cell(20, 0)));
// Check that the form reports the job as complete after performing it.
bot.button("Go!").click();
assertTrue(bot.clabel(0).getText().equals("Done!"));
// Set the template to DualFoil
bot.radio(1).click();
bot.radio(2).click();
// Check that a couple of the DualFoil's rows are set up correctly
assertTrue("NUMSEG".equals(bot.table(1).cell(14, 0)));
assertTrue("CUTOFFL".equals(bot.table(1).cell(17, 0)));
assertTrue("2.0,2.0,2.0,2.0,2.0".equals(bot.table(1).cell(17, 1)));
assertTrue("NUMSEG".equals(bot.table().cell(14, 0)));
assertTrue("CUTOFFL".equals(bot.table().cell(17, 0)));
assertTrue("2.0,2.0,2.0,2.0,2.0".equals(bot.table().cell(17, 1)));
// Set the NUMSEG key to 8.
bot.table(1).click(14, 1);
bot.table().click(14, 1);
bot.text("5", 0).setText("8");
bot.table(1).click(14, 0);
bot.table().click(14, 0);
// CUTOFFL should have had its vector increased in size to account for
// the new NUMSEG value
assertTrue("2.0,2.0,2.0,2.0,2.0,0.0,0.0,0.0"
.equals(bot.table(1).cell(17, 1)));
.equals(bot.table().cell(17, 1)));
// Set NUMSEG to 4
bot.table(1).click(14, 1);
bot.table().click(14, 1);
bot.text("8", 0).setText("4");
bot.table(1).click(14, 0);
bot.table().click(14, 0);
// CUTOFFL should have been reduced to only 4 numbers
assertTrue("2.0,2.0,2.0,2.0".equals(bot.table(1).cell(17, 1)));
// Set the template back to NTG
bot.radio(0).click();
// Check one of the rows to ensure that the NTG template has been loaded
assertTrue("CUTOFF".equals(bot.table(1).cell(15, 0)));
assertTrue("2.0,2.0,2.0,2.0".equals(bot.table().cell(17, 1)));
}
}
......@@ -86,24 +86,24 @@ public class VIBELauncherTester extends AbstractWorkbenchTester {
assertTrue(bot.button("Browse...", 1).isEnabled());
//Check the host table's initial contents
assertTrue("localhost".equals(bot.table(1).cell(0, 0)));
assertEquals(1, bot.table(1).rowCount());
assertTrue("localhost".equals(bot.table().cell(0, 0)));
assertEquals(1, bot.table().rowCount());
//Add a row and check that it was added correctly
bot.button("+").click();
assertEquals(2, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(1, 0)));
assertEquals(2, bot.table().rowCount());
assertTrue("".equals(bot.table().cell(1, 0)));
//Try editing the table and ensure the change was accepted
bot.table(1).click(1, 0);
bot.table().click(1, 0);
bot.text("").typeText("8.8.8.8");
bot.table(1).click(0, 0);
assertTrue("8.8.8.8".equals(bot.table(1).cell(1, 0)));
bot.table().click(0, 0);
assertTrue("8.8.8.8".equals(bot.table().cell(1, 0)));
//Remove a row from the table and check that it is gone
bot.button("-").click();
assertEquals(1, bot.table(1).rowCount());
assertTrue("8.8.8.8".equals(bot.table(1).cell(0, 0)));
assertEquals(1, bot.table().rowCount());
assertTrue("8.8.8.8".equals(bot.table().cell(0, 0)));
//Remove rows until the table is empty and remove another. Nothing should happen.
bot.button("-").click();
......@@ -111,5 +111,7 @@ public class VIBELauncherTester extends AbstractWorkbenchTester {
// See if the tab can be changed
bot.cTabItem("Output Files and Data").activate();
}
}
......@@ -2,6 +2,7 @@ package org.eclipse.ice.tests.ui.swtbot;
import org.eclipse.ice.tests.client.widgets.utils.AbstractWorkbenchTester;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.Test;
......@@ -53,29 +54,29 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
// Save after each one to reset the header.
bot.button("Go!").click();
assertTrue("Done!".equals(bot.clabel(0).getText()));
bot.table(1).click(0, 0);
bot.table(1).click(1, 0);
bot.table(0).click(0, 0);
bot.table(0).click(1, 0);
bot.comboBox().setSelection(1);
bot.button("Go!").click();
assertTrue("Done!".equals(bot.clabel(0).getText()));
bot.table(1).click(0, 0);
bot.table(1).click(1, 0);
bot.table(0).click(0, 0);
bot.table(0).click(1, 0);
bot.comboBox().setSelection(2);
bot.button("Go!").click();
assertTrue("Done!".equals(bot.clabel(0).getText()));
bot.table(1).click(0, 0);
bot.table(1).click(1, 0);
bot.table(0).click(0, 0);
bot.table(0).click(1, 0);
// Try editing the global configuration table and ensure the change
// was accepted
bot.table(1).click(1, 0);
bot.text(7).typeText("Edited name");
bot.table(0).click(1, 0);
bot.text(5).typeText("Edited name");
// bot.text().setText("Edited name");
bot.table(1).click(0, 0);
assertTrue("Edited name".equals(bot.table(1).cell(1, 0)));
bot.table(0).click(0, 0);
assertTrue("Edited name".equals(bot.table(0).cell(1, 0)));
// Check that this made the form dirty
assertTrue("There are unsaved changes on the form."
......@@ -86,18 +87,18 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
assertTrue(bot.clabel(0).getText().equals("Ready to process."));
// Check the global configuration table's initial contents
assertEquals(20, bot.table(1).rowCount());
assertEquals(20, bot.table(0).rowCount());
// Add a row and check that it was added correctly
bot.button("+").click();
assertEquals(21, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(20, 0)));
assertEquals(21, bot.table(0).rowCount());
assertTrue("".equals(bot.table(0).cell(20, 0)));
// Remove a row from the table and check that it is gone
bot.table(1).click(0, 0);
bot.table(0).click(0, 0);
bot.button("-").click();
assertEquals(20, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(19, 0)));
assertEquals(20, bot.table(0).rowCount());
assertTrue("".equals(bot.table(0).cell(19, 0)));
// Remove rows until the table is empty and remove another. Nothing
// should happen.
......@@ -106,25 +107,24 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
}
// Try editing the table and ensure the change was accepted
bot.table(2).click(1, 0);
bot.table(1).click(1, 0);
bot.text("DRIVER").typeText("Edited port");
bot.table(2).click(0, 0);
assertTrue("Edited port".equals(bot.table(2).cell(1, 0)));
bot.table(1).click(0, 0);
assertTrue("Edited port".equals(bot.table(1).cell(1, 0)));
// Check the ports table's initial contents
assertEquals(5, bot.table(2).rowCount());
assertEquals(5, bot.table(1).rowCount());
// Add a row and check that it was added correctly
bot.button("+", 1).click();
assertEquals(6, bot.table(2).rowCount());
assertTrue("".equals(bot.table(2).cell(5, 0)));
assertEquals(6, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(5, 0)));
// Remove a row from the table and check that it is gone
bot.table(2).click(0, 0);
bot.table(1).click(0, 0);
bot.button("-", 1).click();
assertEquals(5, bot.table(2).rowCount());
assertTrue("".equals(bot.table(2).cell(4, 0)));
assertEquals(5, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(4, 0)));
// Remove rows until the table is empty and remove another. Nothing
// should happen.
......@@ -142,48 +142,48 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
// Test each of the default options, making sure they have at least the
// correct number of text fields enabled.
bot.table(1).select(0);
bot.table(0).select(0);
bot.text(9).typeText("Test");
bot.table(0).select(1);
bot.text(11).typeText("Test");
bot.table(0).select(2);
bot.text(11).typeText("Test");
bot.table(0).select(3);
bot.text(11).typeText("Test");
bot.table(0).select(4);
bot.text(11).typeText("Test");
bot.table(1).select(1);
bot.text(13).typeText("Test");
bot.table(1).select(2);
bot.text(13).typeText("Test");
bot.table(1).select(3);
bot.text(13).typeText("Test");
bot.table(1).select(4);
bot.text(13).typeText("Test");
// Check each of the port types available in the menu and check the
// number of text fields they display.
bot.button(2).click();
bot.table().select("INIT_STATE");
bot.button("OK").click();
bot.table(1).select(5);
bot.text(13).typeText("Test");
bot.table(0).select(5);
bot.text(11).typeText("Test");