Ignore:
Timestamp:
2024-05-31T20:50:18+12:00 (4 weeks ago)
Author:
anupama
Message:

First phase of streamlining testing sequence, detecting where pauses are necessary and trying to check for whether it's waiting on components to finish loading or if optional popups appear. Now handles the optional popup if a collection already exists, which is useful for repeated testing.

File:
1 edited

Legend:

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

    r39054 r39069  
    5151import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
    5252import org.assertj.swing.fixture.*;
    53 import org.assertj.swing.core.*; // Robot
     53import org.assertj.swing.core.*; // Robot, Settings
    5454import org.assertj.swing.data.Index;
    5555import org.assertj.swing.timing.Timeout;
     
    146146    //window = findFrame("GUIManager").using(robot());
    147147    window = GSGUITestingUtil.getGLIApplicationWindow(robot());
     148   
     149    Settings robotSettings = robot().settings();
     150    System.err.println("@@@ visibility timeout: " + robotSettings.timeoutToBeVisible());
     151    robotSettings.dragDelay(250);
     152    robotSettings.dropDelay(250);   
     153    //robotSettings.idleTimeOut(250);
    148154    }
    149155   
     
    211217    @Test
    212218    public void tutorial_tests() {
    213     /*
     219   
    214220    // Preliminaries
    215221    // waiting a few seconds for window, so we can see GLI running
    216222    PAUSE(2);
    217    
    218     System.err.println("@@@ First test: GLI Running");
    219    
    220     // steal any collection lock that may or may not presents itself within param seconds
     223
     224    // steal any collection lock that may or may not present itself within param seconds
    221225    stealAnyCollectionLock(1);
     226    //PAUSE(3);
     227   
    222228    switchToPane(GATHER_PANE);
    223     */
     229    //PAUSE(3); // Need some time before we start making selections in the workspace tree
     230    changeUserMode("librarian");
     231    switchToPane(GATHER_PANE);
     232   
    224233    // dummy tests
    225234    //testGLIRunning();
    226235   
    227     // First tutorial
    228     //simpleHTML();
     236    // First two tutorials
     237    simpleHTML();
    229238
    230239    backdrop();
    231240   
     241    exitGLI(); // needed, to save user choices regarding warning popups
    232242    }
    233243
     
    247257    // to ensure sequential ordering of tests
    248258    public void simpleHTML() {
    249     System.err.println("@@@ Tutorial 1: simple HTML"); 
     259    System.err.println("@@@ Tutorial 1: simple HTML");
     260    /*
    250261    stealAnyCollectionLock(1);
    251262    switchToPane(GATHER_PANE);
     
    253264    //openWorkspacePath(WKS_TOP_FOLDER_LOCAL, props.get("samplefiles.treepath").toString());
    254265
    255     /*
     266   
    256267    loadCollection("lucene-jdbm-demo");
    257268    // wait a couple of seconds for loading to be done
     
    261272    openWorkspacePath(WKS_TOP_FOLDER_LOCAL, props.get("samplefiles.treepath").toString()); 
    262273    */
    263 
    264274   
    265275   
     
    270280   
    271281    //loadCollection("smallhtm"); // TODO
    272     PAUSE(3);
     282    PAUSE(2);
    273283
    274284   
     
    279289   
    280290    openCollectionPath("html_files", DOUBLE_CLICK);
    281     PAUSE(2);
     291    //PAUSE(2);
    282292   
    283293    //changeUserMode("librarian");
     
    285295   
    286296    switchToPane(CREATE_PANE);
    287     PAUSE(2);
     297    //PAUSE(2);
    288298    //buildCollection();
    289299    //previewCollectionWhenReady(MAX_BUILD_TIMEOUT);
     
    293303    closePopup(Dictionary.get("CollectionBuilt.Title"), Dictionary.get("General.OK"), TICK_CHECKBOX);   
    294304    previewCollection();
    295    
    296     //window = getGLIApplicationWindow(robot());
     305    PAUSE(1.5);
     306    makeGLIWindowActive();
     307    PAUSE(1);
    297308   
    298309    switchToPane(ENRICH_PANE); 
     
    302313    String path = openWorkspacePath(WKS_TOP_FOLDER_LOCAL, props.get("samplefiles.treepath").toString(), RIGHT_CLICK);
    303314    //workspaceRightClickOption(dragNodePath, );
    304     PAUSE(2);
     315    PAUSE(1);
    305316    selectContextMenu(Dictionary.get("MappingPrompt.Map")); // Create Shortcut
    306317    closePopup(Dictionary.get("MappingPrompt.Title"), Dictionary.get("General.OK")); // accept shortcut name
    307318
    308319    collapseWorkspacePath(WKS_TOP_FOLDER_LOCAL);
    309     PAUSE(4);
     320    PAUSE(3);
    310321   
    311322    }
     
    313324
    314325    public void backdrop() {
    315     System.err.println("@@@ Tutorial 1: simple HTML"); 
    316     stealAnyCollectionLock(1);
    317     PAUSE(3);
    318    
    319     switchToPane(GATHER_PANE);
    320     PAUSE(3); // Need some time before we start making selections in the workspace tree
    321     changeUserMode("librarian");
     326    System.err.println("@@@ Tutorial 2: backdrop");
    322327   
    323328    String image_e_coll = props.get("samplefiles.path")+File.separator+"images"+File.separator+"image-e";
     
    334339   
    335340    //loadCollection("backdrop");
    336     PAUSE(3);
     341    //PAUSE(3);
    337342   
    338343    // Multiple selection drag and drop works iff Shift-Selecting a contiguous set of files.
     
    364369    switchToPane(CREATE_PANE);
    365370   
    366     PAUSE(3);
     371    //PAUSE(3);
    367372    //buildCollectionTillReady(MAX_BUILD_TIMEOUT);
    368373    //previewCollection();
    369374    buildAndPreviewCollection(MAX_BUILD_TIMEOUT);
    370     PAUSE(5);
     375    PAUSE(2);
    371376    // try to make the GLI main window the active one again, instead of the browser
    372377    // https://stackoverflow.com/questions/4005491/how-to-activate-window-in-java
    373378   
    374379    makeGLIWindowActive();
    375     PAUSE(3);
     380    PAUSE(1);
    376381   
    377382    switchToPane(ENRICH_PANE); 
    378     PAUSE(2);   
     383    //PAUSE(2);
    379384    //openCollectionPath("Bear.jpg", CLICK);
    380385    changeToMetadataSet("Dublin Core Metadata Element Set");
     
    389394    PAUSE(1);
    390395    switchToPane(CREATE_PANE);
    391     PAUSE(1);
     396    //PAUSE(1);
    392397    //buildCollectionTillReady(MAX_BUILD_TIMEOUT);
    393398    //previewCollection();
    394399    buildAndPreviewCollection(MAX_BUILD_TIMEOUT);
    395     PAUSE(2);
     400    PAUSE(1.5);
    396401    makeGLIWindowActive(); 
    397     PAUSE(3);
     402    PAUSE(1);
    398403   
    399404    switchToPane(FORMAT_PANE);
     
    427432    PAUSE(1);
    428433    previewCollectionViaFormat();
    429     PAUSE(2);
     434    PAUSE(1.5);
    430435    makeGLIWindowActive(); 
    431     PAUSE(3);
     436    PAUSE(1);
    432437   
    433438
    434439    switchToPane(DESIGN_PANE);
    435     PAUSE(3);
     440    //PAUSE(3);
    436441    selectPlugin("ImagePlugin", CLICK);
    437442    PAUSE(1);
     
    439444    configOptions.add(new SimpleEntry("thumbnailsize", "50"));
    440445    configureSelectedPluginOrClassifier(configOptions);
    441     PAUSE(3);   
     446    PAUSE(1);   
    442447
    443448    switchToPane(CREATE_PANE); 
    444     PAUSE(2);   
     449    //PAUSE(2);
    445450    buildAndPreviewCollection(MAX_BUILD_TIMEOUT);
    446     PAUSE(3);
     451    PAUSE(1.5);
    447452    makeGLIWindowActive();
    448453   
    449454   
    450455    switchToPane(DESIGN_PANE);
    451     PAUSE(3);
     456    //PAUSE(3);
    452457    selectPlugin("ImagePlugin", DOUBLE_CLICK);
    453458    PAUSE(1);
     
    467472   
    468473    switchToPane(CREATE_PANE); 
    469     PAUSE(2);   
     474    //PAUSE(2);
    470475    buildAndPreviewCollection(MAX_BUILD_TIMEOUT);
    471476    PAUSE(3);
    472     makeGLIWindowActive();
    473    
     477    makeGLIWindowActive(); 
    474478   
    475479    switchToPane(DESIGN_PANE);
    476     PAUSE(3);
     480    //PAUSE(3);
    477481    addSearchIndex("dc.Description");
    478482   
     
    486490   
    487491    switchToPane(CREATE_PANE); 
    488     PAUSE(2);   
     492    //PAUSE(2);
    489493    buildAndPreviewCollection(MAX_BUILD_TIMEOUT);
    490494    PAUSE(3);
     
    492496   
    493497    switchToPane(FORMAT_PANE);
    494     PAUSE(3);
     498    //PAUSE(3);
    495499    Collection searchDisplayItems = new ArrayList(1);
    496500    searchDisplayItems.add(new SimpleEntry("Index: dc.Description", "image descriptions"));
     
    499503    PAUSE(1);
    500504    previewCollectionViaFormat();
    501     PAUSE(3);
     505    PAUSE(1.5);
    502506    makeGLIWindowActive();
    503    
    504     exitGLI(); // needed, to save warning popup changes
    505    
     507    PAUSE(1);
    506508    }
    507509   
Note: See TracChangeset for help on using the changeset viewer.