Index: gs3-extensions/testing/trunk/src/build.xml
===================================================================
--- gs3-extensions/testing/trunk/src/build.xml (revision 32687)
+++ gs3-extensions/testing/trunk/src/build.xml (revision 32688)
@@ -110,6 +110,10 @@
GSDLHOME: ${env.GSDLHOME}
+
+
-
+
+
Index: gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java
===================================================================
--- gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java (revision 32687)
+++ gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java (revision 32688)
@@ -25,19 +25,36 @@
*/
+// Junit imports
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.assertj.swing.data.Index;
-
+
+// GLI imports
import org.greenstone.gatherer.Gatherer;
import org.greenstone.gatherer.GathererProg; // main GLI class we'll be testing
import org.greenstone.gatherer.Dictionary; // access to display strings
+// Java GUI testing with AssertJ Swing
import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
import org.assertj.swing.fixture.*;
import org.assertj.swing.edt.GuiActionRunner;
import org.assertj.swing.core.*;
+import org.assertj.swing.data.Index;
+
+// Selenium
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+
+// Helper classes for selenium and AssertJ Swing tests
+import org.greenstone.gsdl3.testing.GSTestingUtil;
+import org.greenstone.gsdl3.testing.GSGUITestingUtil;
+
+// Java imports
import javax.swing.*;
+
+
// static imports
@@ -46,5 +63,19 @@
public class RunGLITest extends AssertJSwingJUnitTestCase {
+
+ private static WebDriver _driver = new FirefoxDriver(); // selenium
+
private FrameFixture window;
+
+ // Selenium
+ @Before
+ public void init()
+ {
+ //https://stackoverflow.com/questions/38676719/selenium-using-java-the-path-to-the-driver-executable-must-be-set-by-the-webdr
+ // GS3's build.xml would have set the webdriver.gecko.driver path System.Property to
+ // the location of Firefox' geckodriver executable when launching this test class already.
+ // So now we can continue to just do:
+ _driver.get(System.getProperty("SERVERURL"));
+ }
@Override
@@ -127,5 +158,11 @@
tab.requireTitle(gatherPaneLabel, Index.atIndex(1));
}
-
-
+
+ // Selenium
+ // called once and only once: to quit the firefox driver geckodriver
+ @AfterClass
+ public static void destroy()
+ {
+ _driver.quit();
+ }
}