|
@@ -5,7 +5,7 @@ function login(client) {
|
|
|
}, [], null
|
|
|
);
|
|
|
|
|
|
- client.pause(300);
|
|
|
+ client.pause(500);
|
|
|
|
|
|
client.getTitle(function (title) {
|
|
|
this.assert.ok(title.includes("AToMPM - [Unnamed]"), "AToMPM is opened");
|
|
@@ -21,11 +21,25 @@ function load_model(client, fnames) {
|
|
|
}, [name], null
|
|
|
);
|
|
|
|
|
|
- client.pause(500);
|
|
|
+ client.pause(1000);
|
|
|
|
|
|
- client.getTitle(function (title) {
|
|
|
- this.assert.ok(title.includes(name), "Check for model: " + name);
|
|
|
+ client.element('css selector', '#dialog_btn', function (result) {
|
|
|
+ if (result.status != -1) {
|
|
|
+ //Dialog has popped up, so check the text and click the button
|
|
|
+ client.assert.containsText("#div_dialog_0", "File not found");
|
|
|
+ client.click("#dialog_btn");
|
|
|
+
|
|
|
+ //client.verify.ok(false, "File: " + name + " failed to load!"); //don't stop testing
|
|
|
+ console.error("File: " + name + " failed to load!");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //Model loaded, so check the title
|
|
|
+ client.getTitle(function (title) {
|
|
|
+ this.assert.ok(title.includes(name), "Check for model: " + name);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -43,19 +57,32 @@ function load_toolbar(client, fnames) {
|
|
|
let toolbar_name = name.replace(/\//g, "\\2f ").replace(/\./g, "\\2e ");
|
|
|
toolbar_name = "#div_toolbar_" + toolbar_name;
|
|
|
|
|
|
- client.waitForElementPresent(toolbar_name, 2000, "Check for toolbar: " + name);
|
|
|
- }
|
|
|
+ client.element('css selector', '#dialog_btn', function (result) {
|
|
|
+ if (result.status != -1) {
|
|
|
+ //Dialog has popped up, so check the text and click the button
|
|
|
+ client.assert.containsText("#div_dialog_0", "File not found");
|
|
|
+ client.click("#dialog_btn");
|
|
|
+
|
|
|
+ //client.verify.ok(false, "File: " + name + " failed to load!"); //don't stop testing
|
|
|
+ console.error("File: " + name + " failed to load!");
|
|
|
+ } else {
|
|
|
+ //Toolbar loaded, so check for it
|
|
|
+ client.waitForElementPresent(toolbar_name, 2000, "Check for toolbar: " + name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
|
let user = "./users/testuser/";
|
|
|
let glob = require('glob');
|
|
|
|
|
|
-let getFiles = function (client, dir, pattern, load_function, failing_files) {
|
|
|
- glob(dir + pattern, callback(client, load_function, failing_files));
|
|
|
+let getFiles = function (client, dir, pattern, load_function, files_to_skip) {
|
|
|
+ glob(dir + pattern, callback(client, load_function, files_to_skip));
|
|
|
};
|
|
|
|
|
|
-function callback(client, load_function, failing_files) {
|
|
|
+function callback(client, load_function, files_to_skip) {
|
|
|
return function (err, res) {
|
|
|
if (err) {
|
|
|
assert(false, "Error in reading directory: " + user + "Toolbars");
|
|
@@ -67,7 +94,7 @@ function callback(client, load_function, failing_files) {
|
|
|
fn = "\/" + fn.replace(user, "");
|
|
|
|
|
|
//skip files we know will fail
|
|
|
- if (failing_files == undefined || !failing_files.includes(fn)) {
|
|
|
+ if (files_to_skip == undefined || !files_to_skip.includes(fn)) {
|
|
|
filenames.push(fn);
|
|
|
}
|
|
|
}
|