Ignore:
Timestamp:
2024-06-20T22:46:07+12:00 (8 days ago)
Author:
anupama
Message:

GLI automated testing of multimedia collection with a few new utility functions and refactoring of existing ones for better generalisation. The testing method already includes the Phind and Collage classifiers as in the GS2 tutorial description. The GS3 tutorial itself needs to be updated to refer to these, and some other tweeaks to this and a past tutorial need to be made and committed still.

File:
1 edited

Legend:

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

    r39122 r39134  
    276276
    277277    //bibliographicColl_MARC();
    278     CDS_ISIS();
     278    //CDS_ISIS();
     279
     280    multimedia();
    279281   
    280282    exitGLI(); // needed, to save user choices regarding warning popups
     
    648650    quickFormatPreviewCycle(); 
    649651   
    650     if(Platform.isWindows()) {     
     652    if(Platform.isWindows()) {
    651653        configOptions.add(new SimpleEntry("metadata", "dc.Creator,ex.Creator"));
    652654        editClassifierByName("AZCompactList", configOptions);
     
    704706   
    705707    switchToPane(DESIGN_PANE); 
    706     chooseBrowsingClassifiers();
     708    chooseBrowsingClassifiers(); // optional
    707709    Collection configOptions = new ArrayList(2);
    708710    configOptions.add(new SimpleEntry("firstvalueonly", null));
     
    11901192    tutorialEdits.getEdit(editcount++).execute();
    11911193    tutorialEdits.getEdit(editcount++).executeAndPreview();
     1194   
     1195    }
     1196
     1197    public static void multimedia() {
     1198    //loadCollection("small beatles");
     1199    String collectionPath = "";
     1200    String workspaceFolder;
     1201    String sampleFilesPath = (String)props.get("samplefiles.path");
     1202    Collection configOptions;
     1203   
     1204    createCollection("small beatles", "A small beatles collection", null);
     1205    collectionPath = "";
     1206    workspaceFolder = openWorkspacePath(
     1207           WKS_TOP_FOLDER_SAMPLEFILES, "beatles/advbeat_small", EXPAND);
     1208    dragNDropContiguousSelection(WORKSPACE_VIEW,
     1209                     workspaceFolder+"/discography",
     1210                     workspaceFolder+"/beatles_midi.zip",
     1211                     collectionPath);
     1212
     1213    // Add plugin for MP3 and MARC
     1214    closePopup(COMPULSORY, Dictionary.get("CDM.PluginManager.SuggestedPluginListTitle"),
     1215           Dictionary.get("CDM.PlugInManager.QuickAdd"));
     1216    // It's unable to identify the popup by window title, so try by name
     1217    closePopupByName(COMPULSORY, "PluginSuggestionPrompt",
     1218               Dictionary.get("CDM.PlugInManager.QuickAdd"));
     1219
     1220
     1221    switchToPane(ENRICH_PANE); 
     1222    // Check it's an unbuilt collection: no ex. meta nor any meta assigned
     1223    checkDocHasNoMetaYet("images/Beatles_memorabilia.jpg", true);
     1224    System.err.println("@@@ Confirmed no meta assigned - unbuilt collection");
     1225   
     1226    createBuildPreviewCycle();
     1227   
     1228    switchToPane(ENRICH_PANE);
     1229    String collPath = "discography/www.thebeatlesarchive.com/discography";
     1230    //openCollectionPath(collPath, EXPAND);
     1231    //shiftMultiSelect(COLLECTION_VIEW,
     1232    //       collPath+"/magicalmisterytour.htm",
     1233    //       collPath+"/magicalmisterytourUS.htm",
     1234    //       CLICK);
     1235    shiftMultiSelectFilesInFolder(COLLECTION_VIEW,
     1236                      collPath,
     1237                      "magicalmisterytour.htm",
     1238                      "magicalmisterytourUS.htm",
     1239                      CLICK);
     1240    setMetaOnCurrentDocsSelection("dc.Title", "Magical Mystery Tour");
     1241
     1242    //createBuildPreviewCycle();
     1243
     1244    switchToPane(ENRICH_PANE);
     1245    setMeta("discography", "dc.Format", "Discography");
     1246    setMeta("html_lyrics", "dc.Format", "Lyrics");
     1247    setMeta("images", "dc.Format", "Images");
     1248    setMeta("marc", "dc.Format", "MARC");
     1249    setMeta("mp3", "dc.Format", "Audio");
     1250    setMeta("tablature_txt", "dc.Format", "Tablature");
     1251    setMeta("wordpdf", "dc.Format", "Supplementary");
     1252   
     1253
     1254    switchToPane(DESIGN_PANE);
     1255    removeClassifiersByName("ex.Source");
     1256    configOptions = new ArrayList(5);
     1257    configOptions.add(new SimpleEntry("metadata", "dc.Format"));
     1258    configOptions.add(new SimpleEntry("bookshelf_type", "always"));
     1259    configOptions.add(new SimpleEntry("partition_type_within_level", "none"));
     1260    configOptions.add(new SimpleEntry("sort_leaf_nodes_using", "ex.Title"));
     1261    configOptions.add(new SimpleEntry("buttonname", "browse"));
     1262    addClassifier("List", configOptions);
     1263    configOptions.clear();
     1264
     1265    createBuildPreviewCycle(); 
     1266   
     1267    switchToPane(FORMAT_PANE);
     1268   
     1269    String tutorial = "multimedia";
     1270    TutorialEdits tutorialEdits = tutorials.get(tutorial);
     1271    int editcount = 0;
     1272   
     1273    formatFeature("browse");
     1274    tutorialEdits.getEdit(editcount++).executeAndPreview();
     1275    tutorialEdits.getEdit(editcount++).executeAndPreview();
     1276   
     1277    switchToPane(DESIGN_PANE);
     1278    configOptions = new ArrayList(2);
     1279    removeClassifiersByName("List -metadata dc.Title,ex.Title");   
     1280    configOptions.add(new SimpleEntry("metadata", "dc.Title,ex.Title"));
     1281    addClassifier("AZCompactList", configOptions);
     1282    moveSelectedPluginOrClassifierToTop();
     1283    configOptions.clear(); 
     1284   
     1285    createBuildPreviewCycle();
     1286   
     1287    switchToPane(FORMAT_PANE);
     1288    formatFeature("browse");
     1289    tutorialEdits.getEdit(editcount++).executeAndPreview();
     1290
     1291    // phind
     1292    switchToPane(DESIGN_PANE); 
     1293    addClassifier("Phind", null);
     1294    createBuildPreviewCycle();
     1295
     1296    switchToPane(FORMAT_PANE);
     1297    formatGeneralAboutPageIcon(sampleFilesPath + "/beatles/advbeat_large/images/tile.jpg");
     1298    formatGeneralHomePageIcon(sampleFilesPath
     1299                   + "/beatles/advbeat_large/images/beatlesmm.png");
     1300    quickFormatPreviewCycle();
     1301   
     1302    switchToPane(DESIGN_PANE);
     1303    chooseDocumentPlugins();   
     1304    configOptions = new ArrayList(3);
     1305    configOptions.add(new SimpleEntry("process_extension", "mid"));
     1306    configOptions.add(new SimpleEntry("file_format", "MIDI"));
     1307    configOptions.add(new SimpleEntry("mime_type", "audio/midi"));
     1308    addPlugin("UnknownPlugin", configOptions);
     1309    configOptions.clear(); 
     1310   
     1311    // Doing the correct thing *before* building: setting dc.Format on midi zip file
     1312    switchToPane(ENRICH_PANE);
     1313    setMeta("beatles_midi.zip", "dc.Format", "Audio");
     1314    //createBuildPreviewCycle();
     1315   
     1316   
     1317    switchToPane(DESIGN_PANE);
     1318    configOptions = new ArrayList(2);
     1319    configOptions.add(new SimpleEntry("removesuffix", "(?i)(\\s+\\d+)|(\\s+[[:punct:]].*)"));
     1320    editClassifierByPattern(".*AZCompactList .*-metadata .*dc.Title,ex.Title.*",
     1321                configOptions);
     1322    configOptions.clear();
     1323   
     1324    createBuildPreviewCycle(); 
     1325   
     1326    closeCollection(); 
     1327   
     1328    // copy across icons
     1329    GSBasicTestingUtil.copyToDirectory(
     1330       new File(sampleFilesPath+"/beatles/advbeat_large/images"),
     1331        //new File(GSBasicTestingUtil.getCollectFolder()+"/smallbea"));
     1332        GSBasicTestingUtil.getCollectionFolder("smallbea"));   
     1333   
     1334    loadCollection("small beatles");
     1335   
     1336    switchToPane(FORMAT_PANE); 
     1337    formatFeature("browse");
     1338    tutorialEdits.getEdit(editcount++).executeAndPreview();
     1339
     1340    closeCollection();
     1341
     1342
     1343    // Create the large beatles collection and add collageClassifier
     1344    createCollection("large beatles", "Large beatles collection", "small beatles");
     1345    collectionPath = "";
     1346    workspaceFolder = openWorkspacePath(
     1347           WKS_TOP_FOLDER_SAMPLEFILES, "beatles/advbeat_large/import", EXPAND);
     1348    dragNDropContiguousSelection(WORKSPACE_VIEW,
     1349                     workspaceFolder+"/discography",
     1350                     workspaceFolder+"/beatles_midi.zip",
     1351                     collectionPath);
     1352   
     1353    switchToPane(FORMAT_PANE);
     1354    formatGeneralAboutPageIcon(sampleFilesPath + "/beatles/advbeat_large/images/tile.jpg");
     1355    formatGeneralHomePageIcon(sampleFilesPath
     1356                   + "/beatles/advbeat_large/images/beatlesmm.png");
     1357   
     1358    //createBuildPreviewCycle();
     1359
     1360    switchToPane(DESIGN_PANE);
     1361    addClassifier("Collage", null);
     1362   
     1363    createBuildPreviewCycle();
    11921364   
    11931365    }
Note: See TracChangeset for help on using the changeset viewer.