Changeset 32713 for gs3-extensions
- Timestamp:
- 2018-12-18T19:31:51+13:00 (5 years ago)
- Location:
- gs3-extensions/testing/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java
r32705 r32713 129 129 window = findFrame("GUIManager").using(robot()); 130 130 131 GSGUITestingUtil.setWindow(window); // set this first before calling any of Util's other methods 132 131 133 String gatherPaneLabel = Dictionary.get("GUI.Gather"); 132 134 System.err.println("@@@ Expecting label: " + gatherPaneLabel); … … 142 144 // attempt to switch to enrich pane, uses static methods of GSGUITestingUtil 143 145 // through static import of that class 144 switchToPane( window,DOWNLOAD_PANE);146 switchToPane(DOWNLOAD_PANE); 145 147 146 148 // For testing, want GLI to be in librarian mode by default 147 changeUserMode( window,"librarian");149 changeUserMode("librarian"); 148 150 149 switchToPane( window,GATHER_PANE);151 switchToPane(GATHER_PANE); 150 152 151 loadCollection( window,"lucene-jdbm-demo");153 loadCollection("lucene-jdbm-demo"); 152 154 153 155 // wait a couple of seconds again? 154 156 PAUSE(2); 155 closeCollection( window);157 closeCollection(); 156 158 157 createCollection( window,"pinky", "Pinky was here", null);158 closeCollection( window); // collection must be closed in order to be deleted159 deleteCollection( window,"pinky");159 createCollection("pinky", "Pinky was here", null); 160 closeCollection(); // collection must be closed in order to be deleted 161 deleteCollection("pinky"); 160 162 // wait a few of seconds again? 161 163 PAUSE(2); 162 164 163 exportCollection( window,"GreenstoneMETS", "lucene-jdbm-demo");165 exportCollection("GreenstoneMETS", "lucene-jdbm-demo"); 164 166 165 167 // Reset GLI to expert mode for regular GLI use 166 changeUserMode( window,"expert");168 changeUserMode("expert"); 167 169 168 170 PAUSE(5); 169 //exitGLI( window);171 //exitGLI(); 170 172 171 switchToPane( window,GATHER_PANE);173 switchToPane(GATHER_PANE); 172 174 } 173 175 -
gs3-extensions/testing/trunk/src/src/org/greenstone/gsdl3/testing/GSGUITestingUtil.java
r32705 r32713 23 23 public class GSGUITestingUtil 24 24 { 25 public static FrameFixture window = null; 26 25 27 public static final boolean PAUSE_ON = true; 26 28 … … 33 35 public static final String CREATE_PANE = "Create"; 34 36 public static final String FORMAT_PANE = "Format"; 35 37 36 38 37 39 /************** NEEDED FOR TESTING *************/ … … 41 43 42 44 /************************ GENERAL *******************************/ 45 46 public static void setWindow(FrameFixture w) { window = w; } 47 43 48 public static void PAUSE() { 44 49 PAUSE(5); … … 57 62 58 63 //https://joel-costigliola.github.io/assertj/swing/api/org/assertj/swing/fixture/FrameFixture.html 59 public static void switchToPane( FrameFixture window,String pane) {64 public static void switchToPane(String pane) { 60 65 String paneLabel = Dictionary.get("GUI." + pane); // e.g. GUI.Enrich 61 66 //JPanelFixture tab = window.panel(pane); // this just gets us the JPanel of controls within … … 63 68 tab.selectTab(paneLabel); // select tab by its title 64 69 } 65 public static void openMenuItem( FrameFixture window,String menu, String subMenu) {70 public static void openMenuItem(String menu, String subMenu) { 66 71 /*String menuLabel = Dictionary.get("Menu." + menu); // e.g. Menu.File 67 72 window.menuItem(menuLabel).click(); //JMenuItemFixture.click() … … 73 78 74 79 /* 75 public static void stealAnyLock( FrameFixture window) {80 public static void stealAnyLock() { 76 81 DialogFixture dialog = window.dialog("LockFileDialog"); 77 82 if(dialog != null) { … … 86 91 87 92 /**********************FILE MENU*******************************/ 88 public static void setPrefs( FrameFixture window,String tab, Map params) {89 openMenuItem( window,"file", "options");93 public static void setPrefs(String tab, Map params) { 94 openMenuItem("file", "options"); 90 95 91 96 } … … 95 100 * Choose from Preferences.Mode.Assistant, Preferences.Mode.Librarian, Preferences.Mode.Expert 96 101 */ 97 public static void changeUserMode( FrameFixture window,String toMode) {98 openMenuItem( window,"file", "options"); // click MenuBar.file -> MenuBar.file_options102 public static void changeUserMode(String toMode) { 103 openMenuItem("file", "options"); // click MenuBar.file -> MenuBar.file_options 99 104 100 105 // switch to Mode tab … … 117 122 } 118 123 119 public static void exitGLI( FrameFixture window) {120 openMenuItem( window,"file", "exit");124 public static void exitGLI() { 125 openMenuItem("file", "exit"); 121 126 PAUSE(5); 122 127 } 123 128 124 public static void closeCollection( FrameFixture window){129 public static void closeCollection(){ 125 130 // Through componennt names, clicks on MenuBar.file then MenuBar.file_close 126 openMenuItem( window,"file", "close");127 } 128 129 public static void deleteCollection( FrameFixture window,String collName) {130 openMenuItem( window,"file", "delete");131 openMenuItem("file", "close"); 132 } 133 134 public static void deleteCollection(String collName) { 135 openMenuItem("file", "delete"); 131 136 DialogFixture dialog = window.dialog("DeleteCollectionPrompt"); // could call window.dialg() too as there will be only one, unless GLI run in debug mode? 132 137 … … 147 152 } 148 153 149 public static void saveCollection(FrameFixture window) { 150 openMenuItem(window, "file", "save"); // MenuBar.file -> MenuBar.file_save 151 } 152 153 public static void createCollection(FrameFixture window, 154 String collTitle, String collDescription, String baseColl) 154 public static void saveCollection() { 155 openMenuItem("file", "save"); // MenuBar.file -> MenuBar.file_save 156 } 157 158 public static void createCollection(String collTitle, String collDescription, String baseColl) 155 159 { 156 openMenuItem( window,"file", "new");160 openMenuItem("file", "new"); 157 161 DialogFixture dialog = window.dialog("col"); // GLI is unable to setName() of this dialog 158 162 // to NewCollectioNDetailsPrompt. Not sure why. … … 174 178 } 175 179 176 public static void loadCollection( FrameFixture window,String collName) {177 openMenuItem( window,"file", "open");180 public static void loadCollection(String collName) { 181 openMenuItem("file", "open"); 178 182 DialogFixture dialog = window.dialog("OpenCollectionDialog"); 179 183 JListFixture collection_list = dialog.list("OpenCollectionDialog.collection_list"); … … 220 224 * not public collection name like "Demo Collection". 221 225 */ 222 public static void exportCollection( FrameFixture window,String exportToFormat, String exportColl)226 public static void exportCollection(String exportToFormat, String exportColl) 223 227 { 224 openMenuItem( window,"file", "exportas"); // Clicks MenuBar.file -> MenuBar.file_exportas228 openMenuItem("file", "exportas"); // Clicks MenuBar.file -> MenuBar.file_exportas 225 229 226 230 DialogFixture dialog = window.dialog("ExportAsPrompt");
Note:
See TracChangeset
for help on using the changeset viewer.