Fixed IO folder tests with unpredictable file ordering

This commit is contained in:
n1474335 2023-03-17 18:06:28 +00:00
parent d6f8e0a520
commit 7605d48f0b

View file

@ -604,10 +604,11 @@ module.exports = {
/* Side panel displays correct info */
utils.uploadFolder(browser, "files");
// Tab 1
// Loop through tabs
for (let i = 1; i < 3; i++) {
browser
.click("#input-tabs li:nth-of-type(1)")
.waitForElementVisible("#input-tabs li:nth-of-type(1).active-input-tab");
.click(`#input-tabs li:nth-of-type(${i})`)
.waitForElementVisible(`#input-tabs li:nth-of-type(${i}).active-input-tab`);
browser
.waitForElementVisible("#input-text .cm-file-details")
@ -617,28 +618,26 @@ module.exports = {
.waitForElementVisible("#input-text .cm-file-details .file-details-size")
.waitForElementVisible("#input-text .cm-file-details .file-details-type")
.waitForElementVisible("#input-text .cm-file-details .file-details-loaded");
browser.getText("#input-text .cm-file-details .file-details-name", function(result) {
switch (result.value) {
case "TowelDay.jpeg":
browser.expect.element("#input-text .cm-file-details .file-details-name").text.that.equals("TowelDay.jpeg");
browser.expect.element("#input-text .cm-file-details .file-details-size").text.that.equals("61,379 bytes");
browser.expect.element("#input-text .cm-file-details .file-details-type").text.that.equals("image/jpeg");
browser.expect.element("#input-text .cm-file-details .file-details-loaded").text.that.equals("100%");
// Tab 2
browser
.click("#input-tabs li:nth-of-type(2)")
.waitForElementVisible("#input-tabs li:nth-of-type(2).active-input-tab");
browser
.waitForElementVisible("#input-text .cm-file-details")
.waitForElementVisible("#input-text .cm-file-details .file-details-toggle-shown")
.waitForElementVisible("#input-text .cm-file-details .file-details-thumbnail")
.waitForElementVisible("#input-text .cm-file-details .file-details-name")
.waitForElementVisible("#input-text .cm-file-details .file-details-size")
.waitForElementVisible("#input-text .cm-file-details .file-details-type")
.waitForElementVisible("#input-text .cm-file-details .file-details-loaded");
break;
case "Hitchhikers_Guide.jpeg":
browser.expect.element("#input-text .cm-file-details .file-details-name").text.that.equals("Hitchhikers_Guide.jpeg");
browser.expect.element("#input-text .cm-file-details .file-details-size").text.that.equals("36,595 bytes");
browser.expect.element("#input-text .cm-file-details .file-details-type").text.that.equals("image/jpeg");
browser.expect.element("#input-text .cm-file-details .file-details-loaded").text.that.equals("100%");
break;
default:
break;
}
});
}
},
"Loading from URL": browser => {