mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Added more UI tests to ensure all modules load, categories can be viewed, and operations can be dragged
This commit is contained in:
parent
572f035877
commit
7dfecc38f6
1 changed files with 65 additions and 1 deletions
|
@ -75,7 +75,7 @@ module.exports = {
|
||||||
// Confirm that it has been added to the recipe
|
// Confirm that it has been added to the recipe
|
||||||
browser
|
browser
|
||||||
.useCss()
|
.useCss()
|
||||||
.waitForElementVisible(op)
|
.waitForElementVisible(op, 100)
|
||||||
.expect.element(op).text.to.contain("To Hex");
|
.expect.element(op).text.to.contain("To Hex");
|
||||||
|
|
||||||
// Enter input
|
// Enter input
|
||||||
|
@ -107,6 +107,10 @@ module.exports = {
|
||||||
loadOp("BSON deserialise", browser)
|
loadOp("BSON deserialise", browser)
|
||||||
.waitForElementNotVisible("#output-loader", 5000);
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
|
||||||
|
// Charts
|
||||||
|
loadOp("Entropy", browser)
|
||||||
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
|
||||||
// Ciphers
|
// Ciphers
|
||||||
loadOp("AES Encrypt", browser)
|
loadOp("AES Encrypt", browser)
|
||||||
.waitForElementNotVisible("#output-loader", 5000);
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
@ -135,6 +139,10 @@ module.exports = {
|
||||||
loadOp("Encode text", browser)
|
loadOp("Encode text", browser)
|
||||||
.waitForElementNotVisible("#output-loader", 5000);
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
|
||||||
|
// Hashing
|
||||||
|
loadOp("Streebog", browser)
|
||||||
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
loadOp("Extract EXIF", browser)
|
loadOp("Extract EXIF", browser)
|
||||||
.waitForElementNotVisible("#output-loader", 5000);
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
@ -162,6 +170,62 @@ module.exports = {
|
||||||
// UserAgent
|
// UserAgent
|
||||||
loadOp("Parse User Agent", browser)
|
loadOp("Parse User Agent", browser)
|
||||||
.waitForElementNotVisible("#output-loader", 5000);
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
|
||||||
|
// YARA
|
||||||
|
loadOp("YARA Rules", browser)
|
||||||
|
.waitForElementNotVisible("#output-loader", 5000);
|
||||||
|
|
||||||
|
browser.click("#clr-recipe");
|
||||||
|
},
|
||||||
|
|
||||||
|
"Move around the UI": browser => {
|
||||||
|
const otherCat = "//a[contains(@class, 'category-title') and contains(@data-target, '#catOther')]",
|
||||||
|
genUUID = "//li[contains(@class, 'operation') and text()='Generate UUID']";
|
||||||
|
|
||||||
|
browser.useXpath();
|
||||||
|
|
||||||
|
// Scroll to a lower category
|
||||||
|
browser
|
||||||
|
.getLocationInView(otherCat)
|
||||||
|
.expect.element(otherCat).to.be.visible;
|
||||||
|
|
||||||
|
// Open category
|
||||||
|
browser
|
||||||
|
.click(otherCat)
|
||||||
|
.expect.element(genUUID).to.be.visible;
|
||||||
|
|
||||||
|
// Drag and drop op into recipe
|
||||||
|
browser
|
||||||
|
.getLocationInView(genUUID)
|
||||||
|
.moveToElement(genUUID, 10, 10)
|
||||||
|
.mouseButtonDown("left")
|
||||||
|
.pause(100)
|
||||||
|
.useCss()
|
||||||
|
.moveToElement("#rec-list", 10, 10)
|
||||||
|
.waitForElementVisible(".sortable-ghost", 100)
|
||||||
|
.mouseButtonUp("left")
|
||||||
|
/* mouseButtonUp drops wherever the actual cursor is, not necessarily in the right place
|
||||||
|
so we can't test Sortable.js properly using Nightwatch. html-dnd doesn't work either.
|
||||||
|
Instead of relying on the drop, we double click on the op to load it. */
|
||||||
|
.useXpath()
|
||||||
|
.moveToElement(genUUID, 10, 10)
|
||||||
|
.doubleClick()
|
||||||
|
.useCss()
|
||||||
|
.waitForElementVisible(".operation .op-title", 1000)
|
||||||
|
.waitForElementNotVisible("#stale-indicator", 1000)
|
||||||
|
.expect.element("#output-text").to.have.value.which.matches(/[\da-f-]{36}/);
|
||||||
|
|
||||||
|
browser.click("#clr-recipe");
|
||||||
|
},
|
||||||
|
|
||||||
|
"Search": browser => {
|
||||||
|
// Search for an op
|
||||||
|
browser
|
||||||
|
.useCss()
|
||||||
|
.clearValue("#search")
|
||||||
|
.setValue("#search", "md5")
|
||||||
|
.useXpath()
|
||||||
|
.waitForElementVisible("//ul[@id='search-results']//u[text()='MD5']", 1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
after: browser => {
|
after: browser => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue