Changeset 32688 for gs3-extensions
- Timestamp:
- 2018-12-16T19:29:19+13:00 (5 years ago)
- Location:
- gs3-extensions/testing/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/testing/trunk/src/build.xml
r32687 r32688 110 110 <echo>GSDLHOME: ${env.GSDLHOME}</echo> 111 111 <java classname="org.junit.runner.JUnitCore" dir="${gli.home}" fork="true" maxmemory="256m" classpathref="tutorials.path"> 112 <!--https://stackoverflow.com/questions/38676719/selenium-using-java-the-path-to-the-driver-executable-must-be-set-by-the-webdr--> 113 <sysproperty key="webdriver.gecko.driver" path="${basedir}/geckodriver"/> 112 114 <arg value="gstests.tutorials.RunGLITest"/> 113 115 <!-- TODO: for now hardcoding the GS3 URL. Toplevel build.xml can properly construct this 116 URL, but hard to do so quickly here --> 117 <jvmarg value="-DSERVERURL=http://127.0.0.1:8383/greenstone3/library "/> 114 118 </java> 115 119 -
gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java
r32685 r32688 25 25 */ 26 26 27 // Junit imports 27 28 import org.junit.AfterClass; 28 29 import org.junit.Assert; 29 30 import org.junit.Before; 30 31 import org.junit.Test; 31 import org.assertj.swing.data.Index; 32 32 33 // GLI imports 33 34 import org.greenstone.gatherer.Gatherer; 34 35 import org.greenstone.gatherer.GathererProg; // main GLI class we'll be testing 35 36 import org.greenstone.gatherer.Dictionary; // access to display strings 36 37 38 // Java GUI testing with AssertJ Swing 37 39 import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase; 38 40 import org.assertj.swing.fixture.*; 39 41 import org.assertj.swing.edt.GuiActionRunner; 40 42 import org.assertj.swing.core.*; 43 import org.assertj.swing.data.Index; 44 45 // Selenium 46 import org.openqa.selenium.By; 47 import org.openqa.selenium.WebDriver; 48 import org.openqa.selenium.WebElement; 49 import org.openqa.selenium.firefox.FirefoxDriver; 50 51 // Helper classes for selenium and AssertJ Swing tests 52 import org.greenstone.gsdl3.testing.GSTestingUtil; 53 import org.greenstone.gsdl3.testing.GSGUITestingUtil; 54 55 // Java imports 41 56 import javax.swing.*; 57 58 42 59 43 60 // static imports … … 46 63 47 64 public class RunGLITest extends AssertJSwingJUnitTestCase { 65 66 private static WebDriver _driver = new FirefoxDriver(); // selenium 67 48 68 private FrameFixture window; 69 70 // Selenium 71 @Before 72 public void init() 73 { 74 //https://stackoverflow.com/questions/38676719/selenium-using-java-the-path-to-the-driver-executable-must-be-set-by-the-webdr 75 // GS3's build.xml would have set the webdriver.gecko.driver path System.Property to 76 // the location of Firefox' geckodriver executable when launching this test class already. 77 // So now we can continue to just do: 78 _driver.get(System.getProperty("SERVERURL")); 79 } 49 80 50 81 @Override … … 127 158 tab.requireTitle(gatherPaneLabel, Index.atIndex(1)); 128 159 } 129 130 160 161 // Selenium 162 // called once and only once: to quit the firefox driver geckodriver 163 @AfterClass 164 public static void destroy() 165 { 166 _driver.quit(); 167 } 131 168 }
Note:
See TracChangeset
for help on using the changeset viewer.