Changeset 32715 for gs3-extensions/testing
- Timestamp:
- 2018-12-18T22:12:16+13:00 (5 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.EDTcheckOff_NoHelp
r32714 r32715 73 73 * Class that will eventually go through all the Greenstone3 tutorials by running GLI and GEMS. 74 74 */ 75 public class RunGLITest extends AssertJSwingJUnitTestCase{75 public class RunGLITest { 76 76 // For aborting running test suite, with Ctrl+Shift+A by default 77 77 // https://joel-costigliola.github.io/assertj/assertj-swing-running.html 78 78 private static EmergencyAbortListener abortListener = EmergencyAbortListener.registerInToolkit(); 79 private static WebDriver _driver = new FirefoxDriver(); // selenium 79 private static WebDriver _driver = new FirefoxDriver(); // for browser tests with selenium 80 private static Robot robot; // for Java GUI tests with assertj-swing 80 81 81 82 private FrameFixture window; 83 84 @BeforeClass 85 public static void setUpOnce() { 86 //FailOnThreadViolationRepaintManager.install(); 82 87 83 // Selenium 88 // Need to have the robot before we can call runGLI() 89 // Robot is the class that controls/drives user input by taking control over the keyboard and mouse 90 robot = BasicRobot.robotWithNewAwtHierarchy(); 91 } 92 93 84 94 @Before 85 95 public void init() 86 96 { 97 // 1. Selenium 98 87 99 //https://stackoverflow.com/questions/38676719/selenium-using-java-the-path-to-the-driver-executable-must-be-set-by-the-webdr 88 100 // GS3's build.xml would have set the webdriver.gecko.driver path System.Property to … … 90 102 // So now we can continue to just do: 91 103 _driver.get(System.getProperty("SERVERURL")); 92 }93 104 94 105 95 // assertj-swing 96 // As init() above, onSetUp() gets called before every test method too, 97 // but is overridden from assertj-swing base class 98 @Override 99 protected void onSetUp() { 106 // 2. assertj-swing 107 108 // Run GLI and show the window 100 109 // Launch GLI and then get a ref to the launched app window: 101 110 runGLI(); 102 103 104 // IMPORTANT, note the call to 'robot()': must use the Robot from AssertJSwingJUnitTestCase 111 112 // IMPORTANT, note the call to 'robot()': must use the Robot from AssertJSwingJUnitTestCase base class 105 113 //window = findFrame("GUIManager").using(robot()); 106 window = GSGUITestingUtil.getGLIApplicationWindow(robot ());114 window = GSGUITestingUtil.getGLIApplicationWindow(robot); 107 115 } 108 116 … … 150 158 closeCollection(); // collection must be closed in order to be deleted 151 159 deleteCollection("pinky"); 160 152 161 // wait a few of seconds again? 153 162 PAUSE(2); … … 165 174 PAUSE(3); 166 175 } 167 176 177 @After 178 public void tearDown() { 179 // call FrameFixture's cleanUp() which 180 // "Cleans up any used resources (keyboard, mouse, open windows and ScreenLock) used by this robot." 181 window.cleanUp(); 182 } 183 168 184 // Selenium 169 185 // called once and only once: to quit the firefox driver geckodriver
Note:
See TracChangeset
for help on using the changeset viewer.