Changeset 32701

Show
Ignore:
Timestamp:
16.12.2018 22:50:46 (3 months ago)
Author:
ak19
Message:

GLI GUI testing can now successfully access menu and submenu items, e.g. successfully displays the open collection dialog. Next step is to actually implement the opening of a selected collection.

Location:
gs3-extensions/testing/trunk/src
Files:
3 modified

Legend:

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

    r32694 r32701  
    146146    // through static import of that class 
    147147    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     } 
     157       
    148158     
    149159  } 
  • gs3-extensions/testing/trunk/src/src/org/greenstone/gsdl3/testing/GSGUITestingUtil.java

    r32694 r32701  
    1919public class GSGUITestingUtil 
    2020{  
    21     public static final String DOWNLOAD_PANE = "GUI.Download";  
    22     public static final String GATHER_PANE = "GUI.Gather";  
    23     public static final String ENRICH_PANE = "GUI.Enrich";  
    24     public static final String DESIGN_PANE = "GUI.Design";  
    25     public static final String CREATE_PANE = "GUI.Create";  
    26     public static final String FORMAT_PANE = "GUI.Format"; 
     21    public static final String DOWNLOAD_PANE = "Download";  
     22    public static final String GATHER_PANE = "Gather";  
     23    public static final String ENRICH_PANE = "Enrich";  
     24    public static final String DESIGN_PANE = "Design";  
     25    public static final String CREATE_PANE = "Create";  
     26    public static final String FORMAT_PANE = "Format"; 
     27 
    2728     
    2829    /************** NEEDED FOR TESTING *************/ 
     
    3435    //https://joel-costigliola.github.io/assertj/swing/api/org/assertj/swing/fixture/FrameFixture.html 
    3536    public static void switchToPane(FrameFixture window, String pane) { 
    36     String paneLabel = Dictionary.get(pane); // e.g. GUI.Enrich 
     37    String paneLabel = Dictionary.get("GUI." + pane); // e.g. GUI.Enrich 
    3738    //JPanelFixture tab = window.panel(pane); // this just gets us the JPanel of controls within 
    3839    JTabbedPaneFixture tab = window.tabbedPane("GUIManager.tab_pane"); 
    3940    tab.selectTab(paneLabel); // select tab by its title 
    4041    } 
    41     public static void getMenu(String menu, String subMenu) {} 
     42    public static void openMenuItem(FrameFixture window, String menu, String subMenu) { 
     43    /*String menuLabel = Dictionary.get("Menu." + menu); // e.g. Menu.File 
     44    window.menuItem(menuLabel).click(); //JMenuItemFixture.click() 
     45    String subMenuLabel = Dictionary.get(menuLabel + "_" + subMenu); // e.g. Menu.File_Open 
     46    window.menuItem(subMenuLabel).click();*/ 
     47    window.menuItem("MenuBar."+menu).click(); 
     48    window.menuItem("MenuBar."+menu+"_"+subMenu).click(); 
     49    } 
    4250 
    4351    // e.g. pane = Enrich,view=collection; pane = Gather, view = workspace (or collection) 
     
    5462    public static void closeCollection(){}     
    5563    public static void createCollection(String basedOn) {}     
    56     public static void loadCollection(String colName) {} 
     64    public static void loadCollection(FrameFixture window, String colName) { 
     65    openMenuItem(window, "file", "open"); 
     66     
     67    } 
    5768 
    5869    // only for GS2?