source: gs3-extensions/testing/trunk/src/src/org/greenstone/gsdl3/testing/GSGUITestingUtil.java@ 32687

Last change on this file since 32687 was 32687, checked in by ak19, 5 years ago

New class GSGUITestingUtil of helper functions that I think will be useful for setting up automated tutorial testing. Filled for now only with placeholders (function signatures) since I was working on getting names assigned to the JComponents of GLI. Haven't yet got round to trying to merge both selenium and assertj swing tests into one JUnit class file either.

File size: 4.4 KB
Line 
1package org.greenstone.gsdl3.testing;
2
3import java.util.Map;
4import java.awt.Component;
5
6// only JUnit and JAssert-Swing, no Selenium in this class
7import org.junit.Assert;
8
9/*
10 *
11*/
12
13public class GSGUITestingUtil
14{
15
16
17 public static final String DOWNLOAD_PANE = "GUI.Download";
18 public static final String GATHER_PANE = "GUI.Gather";
19 public static final String ENRICH_PANE = "GUI.Enrich";
20 public static final String DESIGN_PANE = "GUI.Design";
21 public static final String CREATE_PANE = "GUI.Create";
22 public static final String FORMAT_PANE = "GUI.Format";
23
24 /************** NEEDED FOR TESTING *************/
25 /*
26 Google: "Java swing automatically setName"
27 -> https://stackoverflow.com/questions/3628218/strategy-for-naming-swing-components
28 - https://stackoverflow.com/questions/4163500/how-to-automatic-set-name-attr-of-gui-components/4164479#4164479
29 - https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.wb.swing.doc.user%2Fhtml%2Fwizards%2Fswing%2Fautomatic_databinding.html
30 - https://stackoverflow.com/questions/28639294/in-java-how-to-get-name-of-component-which-is-clicked
31 */
32 public static void setNamesRecursively(Component rootComponent) {
33
34 }
35
36 /************************ GENERAL *******************************/
37 public static void switchToPane(String pane) {}
38 public static void getMenu(String menu, String subMenu) {}
39
40 // e.g. pane = Enrich,view=collection; pane = Gather, view = workspace (or collection)
41 public static void getFolderPath(String pane, String view, String folderPath) {}
42 public static void getFilePath(String pane, String view, String filePath) {}
43
44 /**********************FILE MENU*******************************/
45 public static void setPrefs(String tab, Map params) {}
46 // mode e.g. librarian, expert
47 public static void changeUserMode(String mode) {}
48
49 public static void deleteCollection(){}
50 public static void saveCollection(){}
51 public static void closeCollection(){}
52 public static void createCollection(String basedOn) {}
53 public static void loadCollection(String colName) {}
54
55 // only for GS2?
56 public static void exportCollection() {}
57
58 /*************** DESIGN ******************************/
59 public static void changeIndexer(String toIndexer) {}
60 public static void changeDB(String toDB) {}
61
62 public static void configurePartitionIndex(String tab, Map params) {}
63
64 public static void configurePlugin(String pluginName, Map params) {
65 }
66
67 public static void configureClassifier(String classifierName, Map params) {}
68
69 public static void configurePlugout(String plugoutName, Map params) {}
70
71 // https://www.journaldev.com/1257/java-varargs
72 // https://www.geeksforgeeks.org/variable-arguments-varargs-in-java/
73 public static void keepOnlyPlugins(String ... plug_n) {}
74
75 public static void removePlugs(String ... plug_n) {}
76
77 /********************** CREATE PANEL ********************/
78 public static void buildOpenCollection() {}
79 public static void buildOpenCollection(boolean minimalRebuild) {}
80 public static void configureImportOptions(Map params) {}
81 public static void configureBuildOptions(Map params) {}
82
83 public static void buildOutputContains(String ... n) {}
84
85 /******************** GATHER PANE ********************/
86 public static void createWorkspaceShortcut(){}
87
88 // in current open collection
89 public static void createCollectionSubfolder() {}
90
91 public static void dragNDrop(String workspacePath, String collPath) {}
92
93 /********************* ENRICH PANE ******************/
94 // docPath can be just docName or collectionSubfolder/Subfolder2/docName
95 public static void addMeta(String docPath, Map metanamesToValues) {}
96 public static void addFolderLevelMeta(String folderPath, Map metanamesToValues) {}
97
98 /********************* DOWNLOAD PANE ******************/
99 // TODO: more functions needed here: e.g. serverInfo?
100 public static void download(String downloader, Map params) {}
101 public static void clearCache() {}
102 public static String serverInfo() {
103 return "";
104 }
105
106 /********************* DOWNLOAD PANE ******************/
107 public static void formatGeneral(){}
108 public static void formatSearch() {}
109 public static void formatFeature(String featureName, String filename) {}
110 public static boolean isFormatFeatureXMLValid() {
111 return true;
112 }
113
114}
Note: See TracBrowser for help on using the repository browser.