Ignore:
Timestamp:
2018-12-17T23:33:18+13:00 (5 years ago)
Author:
ak19
Message:
  1. Implemented (and testing as I implement) more of the GSGUITestingUtil helper functions. Most of the File Menu is done. Unfortunately can't yet commit the EDT corrections in GLI as at least one of them requires a more complex solution, possibly with a SwingWorker as there's conflict with the ProgressBar. 2. infrastructure for JUnit reports. Not working yet despite the inclusion of necessary jar, will investigate this later.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java

    r32701 r32705  
    1313- https://web.archive.org/web/20120526191520/http://alexruiz.developerblogs.com/?p=160
    1414- https://web.archive.org/web/20130218063544/http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html
     15- https://stackoverflow.com/questions/2829364/java-difference-between-swingworker-and-swingutilities-invokelater
    1516
    1617Got AssertJ Swing from Maven Central Repository:
     
    117118
    118119     
    119       // waiting 2 seconds for window, so we can see it
    120       try{
    121     Thread.sleep(5000);
    122       } catch(Exception e) {
    123       e.printStackTrace();
    124       }
     120      // waiting a few seconds for window, so we can see it
     121      PAUSE(2);
    125122     
    126123   
     
    131128
    132129      window = findFrame("GUIManager").using(robot());
    133        
    134     String gatherPaneLabel = Dictionary.get("GUI.Gather");
    135     System.err.println("@@@ Expecting label: " + gatherPaneLabel);
     130     
     131      String gatherPaneLabel = Dictionary.get("GUI.Gather");
     132      System.err.println("@@@ Expecting label: " + gatherPaneLabel);
     133     
     134      System.err.println("@@@ Second test: that Gather panel is selected and has right title");
     135     
     136      JTabbedPaneFixture tab = window.tabbedPane("GUIManager.tab_pane");
     137     
     138     
     139      tab.requireSelectedTab(Index.atIndex(1));
     140      tab.requireTitle(gatherPaneLabel, Index.atIndex(1));
     141     
     142      // attempt to switch to enrich pane, uses static methods of GSGUITestingUtil
     143      // through static import of that class
     144      switchToPane(window, DOWNLOAD_PANE);
    136145
    137     System.err.println("@@@ Second test: that Gather panel is selected and has right title");
     146      // For testing, want GLI to be in librarian mode by default
     147      changeUserMode(window, "librarian");
    138148
    139     JTabbedPaneFixture tab = window.tabbedPane("GUIManager.tab_pane");
     149      switchToPane(window, GATHER_PANE);
     150     
     151      loadCollection(window, "lucene-jdbm-demo");
    140152
    141    
    142     tab.requireSelectedTab(Index.atIndex(1));
    143     tab.requireTitle(gatherPaneLabel, Index.atIndex(1));
     153      // wait a couple of seconds again?
     154      PAUSE(2);     
     155      closeCollection(window);
     156     
     157      createCollection(window, "pinky", "Pinky was here", null);
     158      closeCollection(window); // collection must be closed in order to be deleted
     159      deleteCollection(window, "pinky");
     160      // wait a few of seconds again?
     161      PAUSE(2);
     162     
     163      exportCollection(window, "GreenstoneMETS", "lucene-jdbm-demo");
    144164
    145     // attempt to switch to enrich pane, uses static methods of GSGUITestingUtil
    146     // through static import of that class
    147     switchToPane(window, DOWNLOAD_PANE);
    148 
    149     loadCollection(window, "lucene-jdbm-demo");
    150 
    151     // wait a couple of seconds again?
    152      try{
    153          Thread.sleep(5000);
    154      } catch(Exception e) {
    155          e.printStackTrace();
    156      }
     165      // Reset GLI to expert mode for regular GLI use
     166      changeUserMode(window, "expert");
    157167     
    158    
     168      PAUSE(5);
     169      //exitGLI(window);
     170     
     171      switchToPane(window, GATHER_PANE);
    159172  }
    160173
     
    165178    {
    166179    _driver.quit();
     180   
    167181    }
    168182}
Note: See TracChangeset for help on using the changeset viewer.