mirror of
https://github.com/gchq/CyberChef
synced 2025-01-01 07:18:47 +00:00
Fixed IO folder tests with unpredictable file ordering
This commit is contained in:
parent
d6f8e0a520
commit
7605d48f0b
1 changed files with 32 additions and 33 deletions
|
@ -604,10 +604,11 @@ module.exports = {
|
||||||
/* Side panel displays correct info */
|
/* Side panel displays correct info */
|
||||||
utils.uploadFolder(browser, "files");
|
utils.uploadFolder(browser, "files");
|
||||||
|
|
||||||
// Tab 1
|
// Loop through tabs
|
||||||
|
for (let i = 1; i < 3; i++) {
|
||||||
browser
|
browser
|
||||||
.click("#input-tabs li:nth-of-type(1)")
|
.click(`#input-tabs li:nth-of-type(${i})`)
|
||||||
.waitForElementVisible("#input-tabs li:nth-of-type(1).active-input-tab");
|
.waitForElementVisible(`#input-tabs li:nth-of-type(${i}).active-input-tab`);
|
||||||
|
|
||||||
browser
|
browser
|
||||||
.waitForElementVisible("#input-text .cm-file-details")
|
.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-size")
|
||||||
.waitForElementVisible("#input-text .cm-file-details .file-details-type")
|
.waitForElementVisible("#input-text .cm-file-details .file-details-type")
|
||||||
.waitForElementVisible("#input-text .cm-file-details .file-details-loaded");
|
.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-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-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-type").text.that.equals("image/jpeg");
|
||||||
browser.expect.element("#input-text .cm-file-details .file-details-loaded").text.that.equals("100%");
|
browser.expect.element("#input-text .cm-file-details .file-details-loaded").text.that.equals("100%");
|
||||||
|
break;
|
||||||
// Tab 2
|
case "Hitchhikers_Guide.jpeg":
|
||||||
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");
|
|
||||||
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-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-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-type").text.that.equals("image/jpeg");
|
||||||
browser.expect.element("#input-text .cm-file-details .file-details-loaded").text.that.equals("100%");
|
browser.expect.element("#input-text .cm-file-details .file-details-loaded").text.that.equals("100%");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"Loading from URL": browser => {
|
"Loading from URL": browser => {
|
||||||
|
|
Loading…
Reference in a new issue