From add745551b0d1ff8e58bc9f05f6f2c157c34cbb6 Mon Sep 17 00:00:00 2001 From: John L Date: Fri, 11 Feb 2022 16:56:58 +0000 Subject: [PATCH 1/6] WIP --- tests/browser/ops.js | 53 +++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/tests/browser/ops.js b/tests/browser/ops.js index 8d23cabd..8aa5e7ad 100644 --- a/tests/browser/ops.js +++ b/tests/browser/ops.js @@ -6,6 +6,9 @@ * @license Apache-2.0 */ +// import Images from "../operations/samples/Images.mjs"; +const Images = import("../operations/samples/Images.mjs"); + module.exports = { before: browser => { browser @@ -44,42 +47,42 @@ module.exports = { // testOp(browser, "Bifid Cipher Encode", "test input", "test_output"); // testOp(browser, "Bit shift left", "test input", "test_output"); // testOp(browser, "Bit shift right", "test input", "test_output"); - // testOp(browser, "Blowfish Decrypt", "test input", "test_output"); - // testOp(browser, "Blowfish Encrypt", "test input", "test_output"); - // testOp(browser, "Blur Image", "test input", "test_output"); + testOp(browser, "Blowfish Decrypt", "10884e15427dd84ec35204e9c8e921ae", "test_output", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Hex", "Raw"]); + testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); + testOp(browser, "Blur Image", Images.PNG_HEX, "test_output"); // testOp(browser, "Bombe", "test input", "test_output"); - // testOp(browser, "Bzip2 Compress", "test input", "test_output"); - // testOp(browser, "Bzip2 Decompress", "test input", "test_output"); - // testOp(browser, "CRC-16 Checksum", "test input", "test_output"); - // testOp(browser, "CRC-32 Checksum", "test input", "test_output"); - // testOp(browser, "CRC-8 Checksum", "test input", "test_output"); - // testOp(browser, "CSS Beautify", "test input", "test_output"); - // testOp(browser, "CSS Minify", "test input", "test_output"); - // testOp(browser, "CSS selector", "test input", "test_output"); + testOp(browser, "Bzip2 Compress", "test input", "test_output"); + testOp(browser, "Bzip2 Decompress", "test input", "test_output"); + testOp(browser, "CRC-16 Checksum", "test input", "test_output"); + testOp(browser, "CRC-32 Checksum", "test input", "test_output"); + testOp(browser, "CRC-8 Checksum", "test input", "test_output"); + testOp(browser, "CSS Beautify", "test input", "test_output"); + testOp(browser, "CSS Minify", "test input", "test_output"); + testOp(browser, "CSS selector", "test input", "test_output"); // testOp(browser, "CSV to JSON", "test input", "test_output"); - // testOp(browser, "CTPH", "test input", "test_output"); + testOp(browser, "CTPH", "test input", "test_output"); // testOp(browser, "Cartesian Product", "test input", "test_output"); // testOp(browser, "Change IP format", "test input", "test_output"); - // testOp(browser, "Chi Square", "test input", "test_output"); + testOp(browser, "Chi Square", "test input", "test_output"); // testOp(browser, "CipherSaber2 Decrypt", "test input", "test_output"); // testOp(browser, "CipherSaber2 Encrypt", "test input", "test_output"); // testOp(browser, "Citrix CTX1 Decode", "test input", "test_output"); // testOp(browser, "Citrix CTX1 Encode", "test input", "test_output"); // testOp(browser, "Colossus", "test input", "test_output"); // testOp(browser, "Comment", "test input", "test_output"); - // testOp(browser, "Compare CTPH hashes", "test input", "test_output"); - // testOp(browser, "Compare SSDEEP hashes", "test input", "test_output"); - // testOp(browser, "Conditional Jump", "test input", "test_output"); - // testOp(browser, "Contain Image", "test input", "test_output"); - // testOp(browser, "Convert area", "test input", "test_output"); - // testOp(browser, "Convert co-ordinate format", "test input", "test_output"); - // testOp(browser, "Convert data units", "test input", "test_output"); - // testOp(browser, "Convert distance", "test input", "test_output"); + testOp(browser, "Compare CTPH hashes", "test input", "test_output"); + testOp(browser, "Compare SSDEEP hashes", "test input", "test_output"); + // /testOp(browser, "Conditional Jump", "test input", "test_output"); + testOp(browser, "Contain Image", "test input", "test_output"); + testOp(browser, "Convert area", "test input", "test_output"); + // /testOp(browser, "Convert co-ordinate format", "test input", "test_output"); + testOp(browser, "Convert data units", "test input", "test_output"); + testOp(browser, "Convert distance", "test input", "test_output"); // testOp(browser, "Convert Image Format", "test input", "test_output"); - // testOp(browser, "Convert mass", "test input", "test_output"); - // testOp(browser, "Convert speed", "test input", "test_output"); - // testOp(browser, "Convert to NATO alphabet", "test input", "test_output"); - // testOp(browser, "Count occurrences", "test input", "test_output"); + testOp(browser, "Convert mass", "test input", "test_output"); + testOp(browser, "Convert speed", "test input", "test_output"); + // /testOp(browser, "Convert to NATO alphabet", "test input", "test_output"); + testOp(browser, "Count occurrences", "test input", "test_output"); // testOp(browser, "Cover Image", "test input", "test_output"); // testOp(browser, "Crop Image", "test input", "test_output"); // testOp(browser, "DES Decrypt", "test input", "test_output"); From 92767b107879b9611dc3d30b0c5db413a3858753 Mon Sep 17 00:00:00 2001 From: John L Date: Thu, 31 Mar 2022 19:32:41 +0100 Subject: [PATCH 2/6] Try import --- package-lock.json | 40 +- package.json | 2 +- tests/browser/ops.js | 799 +++++++++++++++------------- tests/operations/samples/Images.mjs | 6 + 4 files changed, 467 insertions(+), 380 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b8579b6..e4feff32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -99,7 +99,7 @@ "babel-eslint": "^10.1.0", "babel-loader": "^8.2.2", "babel-plugin-dynamic-import-node": "^2.3.3", - "chromedriver": "^97.0.1", + "chromedriver": "^98.0.1", "cli-progress": "^3.9.0", "colors": "^1.4.0", "copy-webpack-plugin": "^9.0.1", @@ -4398,9 +4398,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001251", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz", - "integrity": "sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==", + "version": "1.0.30001312", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz", + "integrity": "sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==", "dev": true, "funding": { "type": "opencollective", @@ -4474,7 +4474,7 @@ "version": "2.1.8", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "deprecated": "Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies", "dev": true, "dependencies": { "anymatch": "^2.0.0", @@ -4625,9 +4625,9 @@ } }, "node_modules/chromedriver": { - "version": "97.0.2", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-97.0.2.tgz", - "integrity": "sha512-sOAfKCR3WsHvmKedZoWa+3tBVGdPtxq4zKxgKZCoJ2c924olBTW4Bnha6SHl93Yo7+QqsNn6ZpAC0ojhutacAg==", + "version": "98.0.1", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-98.0.1.tgz", + "integrity": "sha512-/04KkHHE/K/lfwdPTQr5fxi1dWvM83p8T/IkYbyGK2PBlH7K49Dd71A9jrS+aWgXlZYkuHhbwiy2PA2QqZ5qQw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -7411,9 +7411,9 @@ } }, "node_modules/extract-zip/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -21682,9 +21682,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001251", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz", - "integrity": "sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==", + "version": "1.0.30001312", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz", + "integrity": "sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==", "dev": true }, "caseless": { @@ -21869,9 +21869,9 @@ "dev": true }, "chromedriver": { - "version": "97.0.2", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-97.0.2.tgz", - "integrity": "sha512-sOAfKCR3WsHvmKedZoWa+3tBVGdPtxq4zKxgKZCoJ2c924olBTW4Bnha6SHl93Yo7+QqsNn6ZpAC0ojhutacAg==", + "version": "98.0.1", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-98.0.1.tgz", + "integrity": "sha512-/04KkHHE/K/lfwdPTQr5fxi1dWvM83p8T/IkYbyGK2PBlH7K49Dd71A9jrS+aWgXlZYkuHhbwiy2PA2QqZ5qQw==", "dev": true, "requires": { "@testim/chrome-version": "^1.1.2", @@ -24109,9 +24109,9 @@ }, "dependencies": { "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" diff --git a/package.json b/package.json index 8e7c1a2a..96d40c19 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "babel-eslint": "^10.1.0", "babel-loader": "^8.2.2", "babel-plugin-dynamic-import-node": "^2.3.3", - "chromedriver": "^97.0.1", + "chromedriver": "^98.0.1", "cli-progress": "^3.9.0", "colors": "^1.4.0", "copy-webpack-plugin": "^9.0.1", diff --git a/tests/browser/ops.js b/tests/browser/ops.js index 8aa5e7ad..49e7c63a 100644 --- a/tests/browser/ops.js +++ b/tests/browser/ops.js @@ -6,9 +6,6 @@ * @license Apache-2.0 */ -// import Images from "../operations/samples/Images.mjs"; -const Images = import("../operations/samples/Images.mjs"); - module.exports = { before: browser => { browser @@ -20,353 +17,367 @@ module.exports = { }, "Sanity check operations": browser => { - testOp(browser, "A1Z26 Cipher Decode", "20 5 19 20 15 21 20 16 21 20", "testoutput"); - testOp(browser, "A1Z26 Cipher Encode", "test input", "20 5 19 20 9 14 16 21 20"); - testOp(browser, "ADD", "test input", "Ê»ÉÊv¿ÄÆËÊ", [{ "option": "Hex", "string": "56" }]); - testOp(browser, "AES Decrypt", "b443f7f7c16ac5396a34273f6f639caa", "test output", [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff" }, { "option": "Hex", "string": "00000000000000000000000000000000" }, "CBC", "Hex", "Raw", { "option": "Hex", "string": "" }]); - testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]); - testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]); - testOp(browser, "Add line numbers", "test input", "1 test input"); - // testOp(browser, "Add Text To Image", "test input", "test_output"); - testOp(browser, "Adler-32 Checksum", "test input", "16160411"); - testOp(browser, "Affine Cipher Decode", "test input", "rcqr glnsr", [1, 2]); - testOp(browser, "Affine Cipher Encode", "test input", "njln rbfpn", [2, 1]); - testOp(browser, "Analyse hash", "0123456789abcdef", /CRC-64/); - testOp(browser, "Atbash Cipher", "test input", "gvhg rmkfg"); - // testOp(browser, "Avro to JSON", "test input", "test_output"); - // testOp(browser, "BLAKE2b", "test input", "test_output"); - // testOp(browser, "BLAKE2s", "test input", "test_output"); - // testOp(browser, "BSON deserialise", "test input", "test_output"); - // testOp(browser, "BSON serialise", "test input", "test_output"); - // testOp(browser, "Bacon Cipher Decode", "test input", "test_output"); - // testOp(browser, "Bacon Cipher Encode", "test input", "test_output"); - // testOp(browser, "Bcrypt", "test input", "test_output"); - // testOp(browser, "Bcrypt compare", "test input", "test_output"); - // testOp(browser, "Bcrypt parse", "test input", "test_output"); - // testOp(browser, "Bifid Cipher Decode", "test input", "test_output"); - // testOp(browser, "Bifid Cipher Encode", "test input", "test_output"); - // testOp(browser, "Bit shift left", "test input", "test_output"); - // testOp(browser, "Bit shift right", "test input", "test_output"); - testOp(browser, "Blowfish Decrypt", "10884e15427dd84ec35204e9c8e921ae", "test_output", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Hex", "Raw"]); - testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); - testOp(browser, "Blur Image", Images.PNG_HEX, "test_output"); - // testOp(browser, "Bombe", "test input", "test_output"); - testOp(browser, "Bzip2 Compress", "test input", "test_output"); - testOp(browser, "Bzip2 Decompress", "test input", "test_output"); - testOp(browser, "CRC-16 Checksum", "test input", "test_output"); - testOp(browser, "CRC-32 Checksum", "test input", "test_output"); - testOp(browser, "CRC-8 Checksum", "test input", "test_output"); - testOp(browser, "CSS Beautify", "test input", "test_output"); - testOp(browser, "CSS Minify", "test input", "test_output"); - testOp(browser, "CSS selector", "test input", "test_output"); - // testOp(browser, "CSV to JSON", "test input", "test_output"); - testOp(browser, "CTPH", "test input", "test_output"); - // testOp(browser, "Cartesian Product", "test input", "test_output"); - // testOp(browser, "Change IP format", "test input", "test_output"); - testOp(browser, "Chi Square", "test input", "test_output"); - // testOp(browser, "CipherSaber2 Decrypt", "test input", "test_output"); - // testOp(browser, "CipherSaber2 Encrypt", "test input", "test_output"); - // testOp(browser, "Citrix CTX1 Decode", "test input", "test_output"); - // testOp(browser, "Citrix CTX1 Encode", "test input", "test_output"); - // testOp(browser, "Colossus", "test input", "test_output"); - // testOp(browser, "Comment", "test input", "test_output"); - testOp(browser, "Compare CTPH hashes", "test input", "test_output"); - testOp(browser, "Compare SSDEEP hashes", "test input", "test_output"); - // /testOp(browser, "Conditional Jump", "test input", "test_output"); - testOp(browser, "Contain Image", "test input", "test_output"); - testOp(browser, "Convert area", "test input", "test_output"); - // /testOp(browser, "Convert co-ordinate format", "test input", "test_output"); - testOp(browser, "Convert data units", "test input", "test_output"); - testOp(browser, "Convert distance", "test input", "test_output"); - // testOp(browser, "Convert Image Format", "test input", "test_output"); - testOp(browser, "Convert mass", "test input", "test_output"); - testOp(browser, "Convert speed", "test input", "test_output"); - // /testOp(browser, "Convert to NATO alphabet", "test input", "test_output"); - testOp(browser, "Count occurrences", "test input", "test_output"); - // testOp(browser, "Cover Image", "test input", "test_output"); - // testOp(browser, "Crop Image", "test input", "test_output"); - // testOp(browser, "DES Decrypt", "test input", "test_output"); - // testOp(browser, "DES Encrypt", "test input", "test_output"); - // testOp(browser, "DNS over HTTPS", "test input", "test_output"); - // testOp(browser, "Dechunk HTTP response", "test input", "test_output"); - // testOp(browser, "Decode NetBIOS Name", "test input", "test_output"); - // testOp(browser, "Decode text", "test input", "test_output"); - // testOp(browser, "Defang IP Addresses", "test input", "test_output"); - // testOp(browser, "Defang URL", "test input", "test_output"); - // testOp(browser, "Derive EVP key", "test input", "test_output"); - // testOp(browser, "Derive PBKDF2 key", "test input", "test_output"); - // testOp(browser, "Detect File Type", "test input", "test_output"); - // testOp(browser, "Diff", "test input", "test_output"); - // testOp(browser, "Disassemble x86", "test input", "test_output"); - // testOp(browser, "Dither Image", "test input", "test_output"); - // testOp(browser, "Divide", "test input", "test_output"); - // testOp(browser, "Drop bytes", "test input", "test_output"); - // testOp(browser, "Encode NetBIOS Name", "test input", "test_output"); - // testOp(browser, "Encode text", "test input", "test_output"); - // testOp(browser, "Enigma", "test input", "test_output"); - // testOp(browser, "Entropy", "test input", "test_output"); - // testOp(browser, "Escape string", "test input", "test_output"); - // testOp(browser, "Escape Unicode Characters", "test input", "test_output"); - // testOp(browser, "Expand alphabet range", "test input", "test_output"); - // testOp(browser, "Extract dates", "test input", "test_output"); - // testOp(browser, "Extract domains", "test input", "test_output"); - // testOp(browser, "Extract EXIF", "test input", "test_output"); - // testOp(browser, "Extract email addresses", "test input", "test_output"); - // testOp(browser, "Extract file paths", "test input", "test_output"); - // testOp(browser, "Extract Files", "test input", "test_output"); - // testOp(browser, "Extract IP addresses", "test input", "test_output"); - // testOp(browser, "Extract LSB", "test input", "test_output"); - // testOp(browser, "Extract MAC addresses", "test input", "test_output"); - // testOp(browser, "Extract RGBA", "test input", "test_output"); - // testOp(browser, "Extract URLs", "test input", "test_output"); - // testOp(browser, "Filter", "test input", "test_output"); - // testOp(browser, "Find / Replace", "test input", "test_output"); - // testOp(browser, "Fletcher-16 Checksum", "test input", "test_output"); - // testOp(browser, "Fletcher-32 Checksum", "test input", "test_output"); - // testOp(browser, "Fletcher-64 Checksum", "test input", "test_output"); - // testOp(browser, "Fletcher-8 Checksum", "test input", "test_output"); - // testOp(browser, "Flip Image", "test input", "test_output"); - // testOp(browser, "Fork", "test input", "test_output"); - // testOp(browser, "Format MAC addresses", "test input", "test_output"); - // testOp(browser, "Frequency distribution", "test input", "test_output"); - // testOp(browser, "From BCD", "test input", "test_output"); - // testOp(browser, "From Base", "test input", "test_output"); - // testOp(browser, "From Base32", "test input", "test_output"); - // testOp(browser, "From Base58", "test input", "test_output"); - // testOp(browser, "From Base62", "test input", "test_output"); - // testOp(browser, "From Base64", "test input", "test_output"); - // testOp(browser, "From Base85", "test input", "test_output"); - // testOp(browser, "From Binary", "test input", "test_output"); - // testOp(browser, "From Braille", "test input", "test_output"); - // testOp(browser, "From Case Insensitive Regex", "test input", "test_output"); - // testOp(browser, "From Charcode", "test input", "test_output"); - // testOp(browser, "From Decimal", "test input", "test_output"); - // testOp(browser, "From HTML Entity", "test input", "test_output"); - // testOp(browser, "From Hex", "test input", "test_output"); - // testOp(browser, "From Hex Content", "test input", "test_output"); - // testOp(browser, "From Hexdump", "test input", "test_output"); - // testOp(browser, "From MessagePack", "test input", "test_output"); - // testOp(browser, "From Morse Code", "test input", "test_output"); - // testOp(browser, "From Octal", "test input", "test_output"); - // testOp(browser, "From Punycode", "test input", "test_output"); - // testOp(browser, "From Quoted Printable", "test input", "test_output"); - // testOp(browser, "From UNIX Timestamp", "test input", "test_output"); - // testOp(browser, "GOST hash", "test input", "test_output"); - // testOp(browser, "Generate all hashes", "test input", "test_output"); - // testOp(browser, "Generate HOTP", "test input", "test_output"); - // testOp(browser, "Generate Image", "test input", "test_output"); - // testOp(browser, "Generate Lorem Ipsum", "test input", "test_output"); - // testOp(browser, "Generate PGP Key Pair", "test input", "test_output"); - // testOp(browser, "Generate QR Code", "test input", "test_output"); - // testOp(browser, "Generate TOTP", "test input", "test_output"); - // testOp(browser, "Generate UUID", "test input", "test_output"); - // testOp(browser, "Generic Code Beautify", "test input", "test_output"); - // testOp(browser, "Group IP addresses", "test input", "test_output"); - // testOp(browser, "Gunzip", "test input", "test_output"); - // testOp(browser, "Gzip", "test input", "test_output"); - // testOp(browser, "HAS-160", "test input", "test_output"); - // testOp(browser, "HMAC", "test input", "test_output"); - // testOp(browser, "HTML To Text", "test input", "test_output"); - // testOp(browser, "HTTP request", "test input", "test_output"); - // testOp(browser, "Hamming Distance", "test input", "test_output"); - // testOp(browser, "Haversine distance", "test input", "test_output"); - // testOp(browser, "Head", "test input", "test_output"); - // testOp(browser, "Heatmap chart", "test input", "test_output"); - // testOp(browser, "Hex Density chart", "test input", "test_output"); - // testOp(browser, "Hex to Object Identifier", "test input", "test_output"); - // testOp(browser, "Hex to PEM", "test input", "test_output"); - // testOp(browser, "Image Brightness / Contrast", "test input", "test_output"); - // testOp(browser, "Image Filter", "test input", "test_output"); - // testOp(browser, "Image Hue/Saturation/Lightness", "test input", "test_output"); - // testOp(browser, "Image Opacity", "test input", "test_output"); - // testOp(browser, "Index of Coincidence", "test input", "test_output"); - // testOp(browser, "Invert Image", "test input", "test_output"); - // testOp(browser, "JPath expression", "test input", "test_output"); - // testOp(browser, "JSON Beautify", "test input", "test_output"); - // testOp(browser, "JSON Minify", "test input", "test_output"); - // testOp(browser, "JSON to CSV", "test input", "test_output"); - // testOp(browser, "JWT Decode", "test input", "test_output"); - // testOp(browser, "JWT Sign", "test input", "test_output"); - // testOp(browser, "JWT Verify", "test input", "test_output"); - // testOp(browser, "JavaScript Beautify", "test input", "test_output"); - // testOp(browser, "JavaScript Minify", "test input", "test_output"); - // testOp(browser, "JavaScript Parser", "test input", "test_output"); - // testOp(browser, "Jump", "test input", "test_output"); - // testOp(browser, "Keccak", "test input", "test_output"); - // testOp(browser, "Label", "test input", "test_output"); - // testOp(browser, "Lorenz", "test input", "test_output"); - // testOp(browser, "Luhn Checksum", "test input", "test_output"); - // testOp(browser, "MD2", "test input", "test_output"); - // testOp(browser, "MD4", "test input", "test_output"); - // testOp(browser, "MD5", "test input", "test_output"); - // testOp(browser, "MD6", "test input", "test_output"); - // testOp(browser, "Magic", "test input", "test_output"); - // testOp(browser, "Mean", "test input", "test_output"); - // testOp(browser, "Median", "test input", "test_output"); - // testOp(browser, "Merge", "test input", "test_output"); - // testOp(browser, "Microsoft Script Decoder", "test input", "test_output"); - // testOp(browser, "Multiple Bombe", "test input", "test_output"); - // testOp(browser, "Multiply", "test input", "test_output"); - // testOp(browser, "NOT", "test input", "test_output"); - // testOp(browser, "Normalise Image", "test input", "test_output"); - // testOp(browser, "Normalise Unicode", "test input", "test_output"); - // testOp(browser, "Numberwang", "test input", "test_output"); - // testOp(browser, "OR", "test input", "test_output"); - // testOp(browser, "Object Identifier to Hex", "test input", "test_output"); - // testOp(browser, "Offset checker", "test input", "test_output"); - // testOp(browser, "Optical Character Recognition", "test input", "test_output"); - // testOp(browser, "PEM to Hex", "test input", "test_output"); - // testOp(browser, "PGP Decrypt", "test input", "test_output"); - // testOp(browser, "PGP Decrypt and Verify", "test input", "test_output"); - // testOp(browser, "PGP Encrypt", "test input", "test_output"); - // testOp(browser, "PGP Encrypt and Sign", "test input", "test_output"); - // testOp(browser, "PGP Verify", "test input", "test_output"); - // testOp(browser, "PHP Deserialize", "test input", "test_output"); - // testOp(browser, "Pad lines", "test input", "test_output"); - // testOp(browser, "Parse ASN.1 hex string", "test input", "test_output"); - // testOp(browser, "Parse colour code", "test input", "test_output"); - // testOp(browser, "Parse DateTime", "test input", "test_output"); - // testOp(browser, "Parse IP range", "test input", "test_output"); - // testOp(browser, "Parse IPv4 header", "test input", "test_output"); - // testOp(browser, "Parse IPv6 address", "test input", "test_output"); - // testOp(browser, "Parse ObjectID timestamp", "test input", "test_output"); - // testOp(browser, "Parse QR Code", "test input", "test_output"); - // testOp(browser, "Parse SSH Host Key", "test input", "test_output"); - // testOp(browser, "Parse TLV", "test input", "test_output"); - // testOp(browser, "Parse UDP", "test input", "test_output"); - // testOp(browser, "Parse UNIX file permissions", "test input", "test_output"); - // testOp(browser, "Parse URI", "test input", "test_output"); - // testOp(browser, "Parse User Agent", "test input", "test_output"); - // testOp(browser, "Parse X.509 certificate", "test input", "test_output"); - // testOp(browser, "Play Media", "test input", "test_output"); - // testOp(browser, "Power Set", "test input", "test_output"); - // testOp(browser, "Protobuf Decode", "test input", "test_output"); - // testOp(browser, "Pseudo-Random Number Generator", "test input", "test_output"); - // testOp(browser, "RC2 Decrypt", "test input", "test_output"); - // testOp(browser, "RC2 Encrypt", "test input", "test_output"); - // testOp(browser, "RC4", "test input", "test_output"); - // testOp(browser, "RC4 Drop", "test input", "test_output"); - // testOp(browser, "RIPEMD", "test input", "test_output"); - // testOp(browser, "ROT13", "test input", "test_output"); - // testOp(browser, "ROT47", "test input", "test_output"); - // testOp(browser, "Rail Fence Cipher Decode", "test input", "test_output"); - // testOp(browser, "Rail Fence Cipher Encode", "test input", "test_output"); - // testOp(browser, "Randomize Colour Palette", "test input", "test_output"); - // testOp(browser, "Raw Deflate", "test input", "test_output"); - // testOp(browser, "Raw Inflate", "test input", "test_output"); - // testOp(browser, "Register", "test input", "test_output"); - // testOp(browser, "Regular expression", "test input", "test_output"); - // testOp(browser, "Remove Diacritics", "test input", "test_output"); - // testOp(browser, "Remove EXIF", "test input", "test_output"); - // testOp(browser, "Remove line numbers", "test input", "test_output"); - // testOp(browser, "Remove null bytes", "test input", "test_output"); - // testOp(browser, "Remove whitespace", "test input", "test_output"); - // testOp(browser, "Render Image", "test input", "test_output"); - // testOp(browser, "Render Markdown", "test input", "test_output"); - // testOp(browser, "Resize Image", "test input", "test_output"); - // testOp(browser, "Return", "test input", "test_output"); - // testOp(browser, "Reverse", "test input", "test_output"); - // testOp(browser, "Rotate Image", "test input", "test_output"); - // testOp(browser, "Rotate left", "test input", "test_output"); - // testOp(browser, "Rotate right", "test input", "test_output"); - // testOp(browser, "SHA0", "test input", "test_output"); - // testOp(browser, "SHA1", "test input", "test_output"); - // testOp(browser, "SHA2", "test input", "test_output"); - // testOp(browser, "SHA3", "test input", "test_output"); - // testOp(browser, "SQL Beautify", "test input", "test_output"); - // testOp(browser, "SQL Minify", "test input", "test_output"); - // testOp(browser, "SSDEEP", "test input", "test_output"); - // testOp(browser, "SUB", "test input", "test_output"); - // testOp(browser, "Scan for Embedded Files", "test input", "test_output"); - // testOp(browser, "Scatter chart", "test input", "test_output"); - // testOp(browser, "Scrypt", "test input", "test_output"); - // testOp(browser, "Series chart", "test input", "test_output"); - // testOp(browser, "Set Difference", "test input", "test_output"); - // testOp(browser, "Set Intersection", "test input", "test_output"); - // testOp(browser, "Set Union", "test input", "test_output"); - // testOp(browser, "Shake", "test input", "test_output"); - // testOp(browser, "Sharpen Image", "test input", "test_output"); - // testOp(browser, "Show Base64 offsets", "test input", "test_output"); - // testOp(browser, "Show on map", "test input", "test_output"); - // testOp(browser, "Sleep", "test input", "test_output"); - // testOp(browser, "Snefru", "test input", "test_output"); - // testOp(browser, "Sort", "test input", "test_output"); - // testOp(browser, "Split", "test input", "test_output"); - // testOp(browser, "Split Colour Channels", "test input", "test_output"); - // testOp(browser, "Standard Deviation", "test input", "test_output"); - // testOp(browser, "Streebog", "test input", "test_output"); - // testOp(browser, "Strings", "test input", "test_output"); - // testOp(browser, "Strip HTML tags", "test input", "test_output"); - // testOp(browser, "Strip HTTP headers", "test input", "test_output"); - // testOp(browser, "Subsection", "test input", "test_output"); - // testOp(browser, "Substitute", "test input", "test_output"); - // testOp(browser, "Subtract", "test input", "test_output"); - // testOp(browser, "Sum", "test input", "test_output"); - // testOp(browser, "Swap endianness", "test input", "test_output"); - // testOp(browser, "Symmetric Difference", "test input", "test_output"); - // testOp(browser, "Syntax highlighter", "test input", "test_output"); - // testOp(browser, "TCP/IP Checksum", "test input", "test_output"); - // testOp(browser, "Tail", "test input", "test_output"); - // testOp(browser, "Take bytes", "test input", "test_output"); - // testOp(browser, "Tar", "test input", "test_output"); - // testOp(browser, "Text Encoding Brute Force", "test input", "test_output"); - // testOp(browser, "To BCD", "test input", "test_output"); - // testOp(browser, "To Base", "test input", "test_output"); - // testOp(browser, "To Base32", "test input", "test_output"); - // testOp(browser, "To Base58", "test input", "test_output"); - // testOp(browser, "To Base62", "test input", "test_output"); - // testOp(browser, "To Base64", "test input", "test_output"); - // testOp(browser, "To Base85", "test input", "test_output"); - // testOp(browser, "To Binary", "test input", "test_output"); - // testOp(browser, "To Braille", "test input", "test_output"); - // testOp(browser, "To Camel case", "test input", "test_output"); - // testOp(browser, "To Case Insensitive Regex", "test input", "test_output"); - // testOp(browser, "To Charcode", "test input", "test_output"); - // testOp(browser, "To Decimal", "test input", "test_output"); - // testOp(browser, "To HTML Entity", "test input", "test_output"); - // testOp(browser, "To Hex", "test input", "test_output"); - // testOp(browser, "To Hex Content", "test input", "test_output"); - // testOp(browser, "To Hexdump", "test input", "test_output"); - // testOp(browser, "To Kebab case", "test input", "test_output"); - // testOp(browser, "To Lower case", "test input", "test_output"); - // testOp(browser, "To MessagePack", "test input", "test_output"); - // testOp(browser, "To Morse Code", "test input", "test_output"); - // testOp(browser, "To Octal", "test input", "test_output"); - // testOp(browser, "To Punycode", "test input", "test_output"); - // testOp(browser, "To Quoted Printable", "test input", "test_output"); - // testOp(browser, "To Snake case", "test input", "test_output"); - // testOp(browser, "To Table", "test input", "test_output"); - // testOp(browser, "To UNIX Timestamp", "test input", "test_output"); - // testOp(browser, "To Upper case", "test input", "test_output"); - // testOp(browser, "Translate DateTime Format", "test input", "test_output"); - // testOp(browser, "Triple DES Decrypt", "test input", "test_output"); - // testOp(browser, "Triple DES Encrypt", "test input", "test_output"); - // testOp(browser, "Typex", "test input", "test_output"); - // testOp(browser, "UNIX Timestamp to Windows Filetime", "test input", "test_output"); - // testOp(browser, "URL Decode", "test input", "test_output"); - // testOp(browser, "URL Encode", "test input", "test_output"); - // testOp(browser, "Unescape string", "test input", "test_output"); - // testOp(browser, "Unescape Unicode Characters", "test input", "test_output"); - // testOp(browser, "Unique", "test input", "test_output"); - // testOp(browser, "Untar", "test input", "test_output"); - // testOp(browser, "Unzip", "test input", "test_output"); - // testOp(browser, "VarInt Decode", "test input", "test_output"); - // testOp(browser, "VarInt Encode", "test input", "test_output"); - // testOp(browser, "View Bit Plane", "test input", "test_output"); - // testOp(browser, "Vigenère Decode", "test input", "test_output"); - // testOp(browser, "Vigenère Encode", "test input", "test_output"); - // testOp(browser, "Whirlpool", "test input", "test_output"); - // testOp(browser, "Windows Filetime to UNIX Timestamp", "test input", "test_output"); - // testOp(browser, "XKCD Random Number", "test input", "test_output"); - // testOp(browser, "XML Beautify", "test input", "test_output"); - // testOp(browser, "XML Minify", "test input", "test_output"); - // testOp(browser, "XOR", "test input", "test_output"); - // testOp(browser, "XOR Brute Force", "test input", "test_output"); - // testOp(browser, "XPath expression", "test input", "test_output"); - // testOp(browser, "YARA Rules", "test input", "test_output"); - // testOp(browser, "Zip", "test input", "test_output"); - // testOp(browser, "Zlib Deflate", "test input", "test_output"); - // testOp(browser, "Zlib Inflate", "test input", "test_output"); + import("../operations/samples/Images.mjs") + .then(Images => { + testOp(browser, ["From Hex", "Add Text To Image", "To Hex"], Images.PNG_HEX, Images.PNG_CHEF_HEX); + testOp(browser, "A1Z26 Cipher Decode", "20 5 19 20 15 21 20 16 21 20", "testoutput"); + testOp(browser, "A1Z26 Cipher Encode", "test input", "20 5 19 20 9 14 16 21 20"); + }); + }, + "Sanity check operations": browser => { + import("../operations/samples/Images.mjs").then(Images => { + testOp(browser, "ADD", "test input", "Ê»ÉÊv¿ÄÆËÊ", [{ "option": "Hex", "string": "56" }]); + testOp(browser, "AES Decrypt", "b443f7f7c16ac5396a34273f6f639caa", "test output", [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff" }, { "option": "Hex", "string": "00000000000000000000000000000000" }, "CBC", "Hex", "Raw", { "option": "Hex", "string": "" }]); + testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]); + testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]); + testOp(browser, "Add line numbers", "test input", "1 test input"); + // testOp(browser, ["From Hex", "Add Text To Image", "To Hex"], Images.PNG_HEX, Images.PNG_CHEF_HEX); + // testOp(browser, "Add Text To Image", "test input", "test_output"); + testOp(browser, "Adler-32 Checksum", "test input", "16160411"); + testOp(browser, "Affine Cipher Decode", "test input", "rcqr glnsr", [1, 2]); + testOp(browser, "Affine Cipher Encode", "test input", "njln rbfpn", [2, 1]); + testOp(browser, "Analyse hash", "0123456789abcdef", /CRC-64/); + testOp(browser, "Atbash Cipher", "test input", "gvhg rmkfg"); + // testOp(browser, "Avro to JSON", "test input", "test_output"); + // testOp(browser, "BLAKE2b", "test input", "test_output"); + // testOp(browser, "BLAKE2s", "test input", "test_output"); + // testOp(browser, "BSON deserialise", "test input", "test_output"); + // testOp(browser, "BSON serialise", "test input", "test_output"); + // testOp(browser, "Bacon Cipher Decode", "test input", "test_output"); + // testOp(browser, "Bacon Cipher Encode", "test input", "test_output"); + // testOp(browser, "Bcrypt", "test input", "test_output"); + // testOp(browser, "Bcrypt compare", "test input", "test_output"); + // testOp(browser, "Bcrypt parse", "test input", "test_output"); + // testOp(browser, "Bifid Cipher Decode", "test input", "test_output"); + // testOp(browser, "Bifid Cipher Encode", "test input", "test_output"); + // testOp(browser, "Bit shift left", "test input", "test_output"); + // testOp(browser, "Bit shift right", "test input", "test_output"); + testOp(browser, "Blowfish Decrypt", "10884e15427dd84ec35204e9c8e921ae", "test_output", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Hex", "Raw"]); + testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); + // console.log(Images); + // testOp(browser, "Blur Image", Images.PNG_HEX, "test_output"); + // Imaged Error : Undefined ! Must be a way to Reference Exports + + // testOp(browser, "Bombe", "test input", "test_output"); + testOp(browser, "Bzip2 Compress", "test input", "BZh91AY&SYÏ........@..!N. .!.Â.À.3..ß.rE8P.Ï..."); + testOp(browser, ["From Hex", "Bzip2 Decompress"], "425a68393141592653597b0884b7000003038000008200ce00200021a647a4218013709517c5dc914e14241ec2212dc0", "test_output", [true]); + // testOp(browser, "CRC-16 Checksum", "test input", "test_output"); + // testOp(browser, "CRC-32 Checksum", "test input", "test_output"); + // testOp(browser, "CRC-8 Checksum", "test input", "test_output"); + // testOp(browser, "CSS Beautify", "test input", "test_output"); + // testOp(browser, "CSS Minify", "test input", "test_output"); + // testOp(browser, "CSS selector", "test input", "test_output"); + // testOp(browser, "CSV to JSON", "test input", "test_output"); + // testOp(browser, "CTPH", "test input", "test_output"); + // testOp(browser, "Cartesian Product", "test input", "test_output"); + // testOp(browser, "Change IP format", "test input", "test_output"); + // testOp(browser, "Chi Square", "test input", "test_output"); + // testOp(browser, "CipherSaber2 Decrypt", "test input", "test_output"); + // testOp(browser, "CipherSaber2 Encrypt", "test input", "test_output"); + // testOp(browser, "Citrix CTX1 Decode", "test input", "test_output"); + // testOp(browser, "Citrix CTX1 Encode", "test input", "test_output"); + // testOp(browser, "Colossus", "test input", "test_output"); + // testOp(browser, "Comment", "test input", "test_output"); + // testOp(browser, "Compare CTPH hashes", "test input", "test_output"); + // testOp(browser, "Compare SSDEEP hashes", "test input", "test_output"); + // /testOp(browser, "Conditional Jump", "test input", "test_output"); + // testOp(browser, "Contain Image", "test input", "test_output"); + // testOp(browser, "Convert area", "test input", "test_output"); + // /testOp(browser, "Convert co-ordinate format", "test input", "test_output"); + // testOp(browser, "Convert data units", "test input", "test_output"); + // testOp(browser, "Convert distance", "test input", "test_output"); + // testOp(browser, "Convert Image Format", "test input", "test_output"); + // testOp(browser, "Convert mass", "test input", "test_output"); + // testOp(browser, "Convert speed", "test input", "test_output"); + // testOp(browser, "Convert to NATO alphabet", "test input", "test_output"); + // testOp(browser, "Count occurrences", "test input", "test_output"); + // testOp(browser, "Cover Image", "test input", "test_output"); + // testOp(browser, "Crop Image", "test input", "test_output"); + // testOp(browser, "DES Decrypt", "test input", "test_output"); + // testOp(browser, "DES Encrypt", "test input", "test_output"); + // testOp(browser, "DNS over HTTPS", "test input", "test_output"); + // testOp(browser, "Dechunk HTTP response", "test input", "test_output"); + // testOp(browser, "Decode NetBIOS Name", "test input", "test_output"); + // testOp(browser, "Decode text", "test input", "test_output"); + // testOp(browser, "Defang IP Addresses", "test input", "test_output"); + // testOp(browser, "Defang URL", "test input", "test_output"); + // testOp(browser, "Derive EVP key", "test input", "test_output"); + // testOp(browser, "Derive PBKDF2 key", "test input", "test_output"); + // testOp(browser, "Detect File Type", "test input", "test_output"); + // testOp(browser, "Diff", "test input", "test_output"); + // testOp(browser, "Disassemble x86", "test input", "test_output"); + // testOp(browser, "Dither Image", "test input", "test_output"); + // testOp(browser, "Divide", "test input", "test_output"); + // testOp(browser, "Drop bytes", "test input", "test_output"); + // testOp(browser, "Encode NetBIOS Name", "test input", "test_output"); + // testOp(browser, "Encode text", "test input", "test_output"); + // testOp(browser, "Enigma", "test input", "test_output"); + // testOp(browser, "Entropy", "test input", "test_output"); + // testOp(browser, "Escape string", "test input", "test_output"); + // testOp(browser, "Escape Unicode Characters", "test input", "test_output"); + // testOp(browser, "Expand alphabet range", "test input", "test_output"); + // testOp(browser, "Extract dates", "test input", "test_output"); + // testOp(browser, "Extract domains", "test input", "test_output"); + // testOp(browser, "Extract EXIF", "test input", "test_output"); + // testOp(browser, "Extract email addresses", "test input", "test_output"); + // testOp(browser, "Extract file paths", "test input", "test_output"); + // testOp(browser, "Extract Files", "test input", "test_output"); + // testOp(browser, "Extract IP addresses", "test input", "test_output"); + // testOp(browser, "Extract LSB", "test input", "test_output"); + // testOp(browser, "Extract MAC addresses", "test input", "test_output"); + // testOp(browser, "Extract RGBA", "test input", "test_output"); + // testOp(browser, "Extract URLs", "test input", "test_output"); + // testOp(browser, "Filter", "test input", "test_output"); + // testOp(browser, "Find / Replace", "test input", "test_output"); + // testOp(browser, "Fletcher-16 Checksum", "test input", "test_output"); + // testOp(browser, "Fletcher-32 Checksum", "test input", "test_output"); + // testOp(browser, "Fletcher-64 Checksum", "test input", "test_output"); + // testOp(browser, "Fletcher-8 Checksum", "test input", "test_output"); + // testOp(browser, "Flip Image", "test input", "test_output"); + // testOp(browser, "Fork", "test input", "test_output"); + // testOp(browser, "Format MAC addresses", "test input", "test_output"); + // testOp(browser, "Frequency distribution", "test input", "test_output"); + // testOp(browser, "From BCD", "test input", "test_output"); + // testOp(browser, "From Base", "test input", "test_output"); + // testOp(browser, "From Base32", "test input", "test_output"); + // testOp(browser, "From Base58", "test input", "test_output"); + // testOp(browser, "From Base62", "test input", "test_output"); + // testOp(browser, "From Base64", "test input", "test_output"); + // testOp(browser, "From Base85", "test input", "test_output"); + // testOp(browser, "From Binary", "test input", "test_output"); + // testOp(browser, "From Braille", "test input", "test_output"); + // testOp(browser, "From Case Insensitive Regex", "test input", "test_output"); + // testOp(browser, "From Charcode", "test input", "test_output"); + // testOp(browser, "From Decimal", "test input", "test_output"); + // testOp(browser, "From HTML Entity", "test input", "test_output"); + // testOp(browser, "From Hex", "test input", "test_output"); + // testOp(browser, "From Hex Content", "test input", "test_output"); + // testOp(browser, "From Hexdump", "test input", "test_output"); + // testOp(browser, "From MessagePack", "test input", "test_output"); + // testOp(browser, "From Morse Code", "test input", "test_output"); + // testOp(browser, "From Octal", "test input", "test_output"); + // testOp(browser, "From Punycode", "test input", "test_output"); + // testOp(browser, "From Quoted Printable", "test input", "test_output"); + // testOp(browser, "From UNIX Timestamp", "test input", "test_output"); + // testOp(browser, "GOST hash", "test input", "test_output"); + // testOp(browser, "Generate all hashes", "test input", "test_output"); + // testOp(browser, "Generate HOTP", "test input", "test_output"); + // testOp(browser, "Generate Image", "test input", "test_output"); + // testOp(browser, "Generate Lorem Ipsum", "test input", "test_output"); + // testOp(browser, "Generate PGP Key Pair", "test input", "test_output"); + // testOp(browser, "Generate QR Code", "test input", "test_output"); + // testOp(browser, "Generate TOTP", "test input", "test_output"); + // testOp(browser, "Generate UUID", "test input", "test_output"); + // testOp(browser, "Generic Code Beautify", "test input", "test_output"); + // testOp(browser, "Group IP addresses", "test input", "test_output"); + // testOp(browser, "Gunzip", "test input", "test_output"); + // testOp(browser, "Gzip", "test input", "test_output"); + // testOp(browser, "HAS-160", "test input", "test_output"); + // testOp(browser, "HMAC", "test input", "test_output"); + // testOp(browser, "HTML To Text", "test input", "test_output"); + // testOp(browser, "HTTP request", "test input", "test_output"); + // testOp(browser, "Hamming Distance", "test input", "test_output"); + // testOp(browser, "Haversine distance", "test input", "test_output"); + // testOp(browser, "Head", "test input", "test_output"); + // testOp(browser, "Heatmap chart", "test input", "test_output"); + // testOp(browser, "Hex Density chart", "test input", "test_output"); + // testOp(browser, "Hex to Object Identifier", "test input", "test_output"); + // testOp(browser, "Hex to PEM", "test input", "test_output"); + // testOp(browser, "Image Brightness / Contrast", "test input", "test_output"); + // testOp(browser, "Image Filter", "test input", "test_output"); + // testOp(browser, "Image Hue/Saturation/Lightness", "test input", "test_output"); + // testOp(browser, "Image Opacity", "test input", "test_output"); + // testOp(browser, "Index of Coincidence", "test input", "test_output"); + // testOp(browser, "Invert Image", "test input", "test_output"); + // testOp(browser, "JPath expression", "test input", "test_output"); + // testOp(browser, "JSON Beautify", "test input", "test_output"); + // testOp(browser, "JSON Minify", "test input", "test_output"); + // testOp(browser, "JSON to CSV", "test input", "test_output"); + // testOp(browser, "JWT Decode", "test input", "test_output"); + // testOp(browser, "JWT Sign", "test input", "test_output"); + // testOp(browser, "JWT Verify", "test input", "test_output"); + // testOp(browser, "JavaScript Beautify", "test input", "test_output"); + // testOp(browser, "JavaScript Minify", "test input", "test_output"); + // testOp(browser, "JavaScript Parser", "test input", "test_output"); + // testOp(browser, "Jump", "test input", "test_output"); + // testOp(browser, "Keccak", "test input", "test_output"); + // testOp(browser, "Label", "test input", "test_output"); + // testOp(browser, "Lorenz", "test input", "test_output"); + // testOp(browser, "Luhn Checksum", "test input", "test_output"); + // testOp(browser, "MD2", "test input", "test_output"); + // testOp(browser, "MD4", "test input", "test_output"); + // testOp(browser, "MD5", "test input", "test_output"); + // testOp(browser, "MD6", "test input", "test_output"); + // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "td", /Result snippet/); + // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "tr:nth-of-type(1) td:nth-of-type(2)", "Result snippet"); + // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "tr:eq(1) td:eq(1)", "test_output"); + // testOp(browser, "Mean", "test input", "test_output"); + // testOp(browser, "Median", "test input", "test_output");` + // testOp(browser, "Merge", "test input", "test_output");` + // testOp(browser, "Microsoft Script Decoder", "test input", "test_output"); + // testOp(browser, "Multiple Bombe", "test input", "test_output"); + // testOp(browser, "Multiply", "test input", "test_output"); + // testOp(browser, "NOT", "test input", "test_output"); + // testOp(browser, "Normalise Image", "test input", "test_output"); + // testOp(browser, "Normalise Unicode", "test input", "test_output"); + // testOp(browser, "Numberwang", "test input", "test_output"); + // testOp(browser, "OR", "test input", "test_output"); + // testOp(browser, "Object Identifier to Hex", "test input", "test_output"); + // testOp(browser, "Offset checker", "test input", "test_output"); + // testOp(browser, "Optical Character Recognition", "test input", "test_output"); + // testOp(browser, "PEM to Hex", "test input", "test_output"); + // testOp(browser, "PGP Decrypt", "test input", "test_output"); + // testOp(browser, "PGP Decrypt and Verify", "test input", "test_output"); + // testOp(browser, "PGP Encrypt", "test input", "test_output"); + // testOp(browser, "PGP Encrypt and Sign", "test input", "test_output"); + // testOp(browser, "PGP Verify", "test input", "test_output"); + // testOp(browser, "PHP Deserialize", "test input", "test_output"); + // testOp(browser, "Pad lines", "test input", "test_output"); + // testOp(browser, "Parse ASN.1 hex string", "test input", "test_output"); + // testOp(browser, "Parse colour code", "test input", "test_output"); + // testOp(browser, "Parse DateTime", "test input", "test_output"); + // testOp(browser, "Parse IP range", "test input", "test_output"); + // testOp(browser, "Parse IPv4 header", "test input", "test_output"); + // testOp(browser, "Parse IPv6 address", "test input", "test_output"); + // testOp(browser, "Parse ObjectID timestamp", "test input", "test_output"); + // testOp(browser, "Parse QR Code", "test input", "test_output"); + // testOp(browser, "Parse SSH Host Key", "test input", "test_output"); + // testOp(browser, "Parse TLV", "test input", "test_output"); + // testOp(browser, "Parse UDP", "test input", "test_output"); + // testOp(browser, "Parse UNIX file permissions", "test input", "test_output"); + // testOp(browser, "Parse URI", "test input", "test_output"); + // testOp(browser, "Parse User Agent", "test input", "test_output"); + // testOp(browser, "Parse X.509 certificate", "test input", "test_output"); + // testOp(browser, "Play Media", "test input", "test_output"); + // testOp(browser, "Power Set", "test input", "test_output"); + // testOp(browser, "Protobuf Decode", "test input", "test_output"); + // testOp(browser, "Pseudo-Random Number Generator", "test input", "test_output"); + // testOp(browser, "RC2 Decrypt", "test input", "test_output"); + // testOp(browser, "RC2 Encrypt", "test input", "test_output"); + // testOp(browser, "RC4", "test input", "test_output"); + // testOp(browser, "RC4 Drop", "test input", "test_output"); + // testOp(browser, "RIPEMD", "test input", "test_output"); + // testOp(browser, "ROT13", "test input", "test_output"); + // testOp(browser, "ROT47", "test input", "test_output"); + // testOp(browser, "Rail Fence Cipher Decode", "test input", "test_output"); + // testOp(browser, "Rail Fence Cipher Encode", "test input", "test_output"); + // testOp(browser, "Randomize Colour Palette", "test input", "test_output"); + // testOp(browser, "Raw Deflate", "test input", "test_output"); + // testOp(browser, "Raw Inflate", "test input", "test_output"); + // testOp(browser, "Register", "test input", "test_output"); + // testOp(browser, "Regular expression", "test input", "test_output"); + // testOp(browser, "Remove Diacritics", "test input", "test_output"); + // testOp(browser, "Remove EXIF", "test input", "test_output"); + // testOp(browser, "Remove line numbers", "test input", "test_output"); + // testOp(browser, "Remove null bytes", "test input", "test_output"); + // testOp(browser, "Remove whitespace", "test input", "test_output"); + // testOp(browser, "Render Image", "test input", "test_output"); + // testOp(browser, "Render Markdown", "test input", "test_output"); + // testOp(browser, "Resize Image", "test input", "test_output"); + // testOp(browser, "Return", "test input", "test_output"); + // testOp(browser, "Reverse", "test input", "test_output"); + // testOp(browser, "Rotate Image", "test input", "test_output"); + // testOp(browser, "Rotate left", "test input", "test_output"); + // testOp(browser, "Rotate right", "test input", "test_output"); + // testOp(browser, "SHA0", "test input", "test_output"); + // testOp(browser, "SHA1", "test input", "test_output"); + // testOp(browser, "SHA2", "test input", "test_output"); + // testOp(browser, "SHA3", "test input", "test_output"); + // testOp(browser, "SQL Beautify", "test input", "test_output"); + // testOp(browser, "SQL Minify", "test input", "test_output"); + // testOp(browser, "SSDEEP", "test input", "test_output"); + // testOp(browser, "SUB", "test input", "test_output"); + // testOp(browser, "Scan for Embedded Files", "test input", "test_output"); + // testOp(browser, "Scatter chart", "test input", "test_output"); + // testOp(browser, "Scrypt", "test input", "test_output"); + // testOp(browser, "Series chart", "test input", "test_output"); + // testOp(browser, "Set Difference", "test input", "test_output"); + // testOp(browser, "Set Intersection", "test input", "test_output"); + // testOp(browser, "Set Union", "test input", "test_output"); + // testOp(browser, "Shake", "test input", "test_output"); + // testOp(browser, "Sharpen Image", "test input", "test_output"); + // testOp(browser, "Show Base64 offsets", "test input", "test_output"); + // testOp(browser, "Show on map", "test input", "test_output"); + // testOp(browser, "Sleep", "test input", "test_output"); + // testOp(browser, "Snefru", "test input", "test_output"); + // testOp(browser, "Sort", "test input", "test_output"); + // testOp(browser, "Split", "test input", "test_output"); + // testOp(browser, "Split Colour Channels", "test input", "test_output"); + // testOp(browser, "Standard Deviation", "test input", "test_output"); + // testOp(browser, "Streebog", "test input", "test_output"); + // testOp(browser, "Strings", "test input", "test_output"); + // testOp(browser, "Strip HTML tags", "test input", "test_output"); + // testOp(browser, "Strip HTTP headers", "test input", "test_output"); + // testOp(browser, "Subsection", "test input", "test_output"); + // testOp(browser, "Substitute", "test input", "test_output"); + // testOp(browser, "Subtract", "test input", "test_output"); + // testOp(browser, "Sum", "test input", "test_output"); + // testOp(browser, "Swap endianness", "test input", "test_output"); + // testOp(browser, "Symmetric Difference", "test input", "test_output"); + // testOp(browser, "Syntax highlighter", "test input", "test_output"); + // testOp(browser, "TCP/IP Checksum", "test input", "test_output"); + // testOp(browser, "Tail", "test input", "test_output"); + // testOp(browser, "Take bytes", "test input", "test_output"); + // testOp(browser, "Tar", "test input", "test_output"); + // testOp(browser, "Text Encoding Brute Force", "test input", "test_output"); + // testOp(browser, "To BCD", "test input", "test_output"); + // testOp(browser, "To Base", "test input", "test_output"); + // testOp(browser, "To Base32", "test input", "test_output"); + // testOp(browser, "To Base58", "test input", "test_output"); + // testOp(browser, "To Base62", "test input", "test_output"); + // testOp(browser, "To Base64", "test input", "test_output"); + // testOp(browser, "To Base85", "test input", "test_output"); + // testOp(browser, "To Binary", "test input", "test_output"); + // testOp(browser, "To Braille", "test input", "test_output"); + // testOp(browser, "To Camel case", "test input", "test_output"); + // testOp(browser, "To Case Insensitive Regex", "test input", "test_output"); + // testOp(browser, "To Charcode", "test input", "test_output"); + // testOp(browser, "To Decimal", "test input", "test_output"); + // testOp(browser, "To HTML Entity", "test input", "test_output"); + // testOp(browser, "To Hex", "test input", "test_output"); + // testOp(browser, "To Hex Content", "test input", "test_output"); + // testOp(browser, "To Hexdump", "test input", "test_output"); + // testOp(browser, "To Kebab case", "test input", "test_output"); + // testOp(browser, "To Lower case", "test input", "test_output"); + // testOp(browser, "To MessagePack", "test input", "test_output"); + // testOp(browser, "To Morse Code", "test input", "test_output"); + // testOp(browser, "To Octal", "test input", "test_output"); + // testOp(browser, "To Punycode", "test input", "test_output"); + // testOp(browser, "To Quoted Printable", "test input", "test_output"); + // testOp(browser, "To Snake case", "test input", "test_output"); + // testOp(browser, "To Table", "test input", "test_output"); + // testOp(browser, "To UNIX Timestamp", "test input", "test_output"); + // testOp(browser, "To Upper case", "test input", "test_output"); + // testOp(browser, "Translate DateTime Format", "test input", "test_output"); + // testOp(browser, "Triple DES Decrypt", "test input", "test_output"); + // testOp(browser, "Triple DES Encrypt", "test input", "test_output"); + // testOp(browser, "Typex", "test input", "test_output"); + // testOp(browser, "UNIX Timestamp to Windows Filetime", "test input", "test_output"); + // testOp(browser, "URL Decode", "test input", "test_output"); + // testOp(browser, "URL Encode", "test input", "test_output"); + // testOp(browser, "Unescape string", "test input", "test_output"); + // testOp(browser, "Unescape Unicode Characters", "test input", "test_output"); + // testOp(browser, "Unique", "test input", "test_output"); + // testOp(browser, "Untar", "test input", "test_output"); + // testOp(browser, "Unzip", "test input", "test_output"); + // testOp(browser, "VarInt Decode", "test input", "test_output"); + // testOp(browser, "VarInt Encode", "test input", "test_output"); + // testOp(browser, "View Bit Plane", "test input", "test_output"); + // testOp(browser, "Vigenère Decode", "test input", "test_output"); + // testOp(browser, "Vigenère Encode", "test input", "test_output"); + // testOp(browser, "Whirlpool", "test input", "test_output"); + // testOp(browser, "Windows Filetime to UNIX Timestamp", "test input", "test_output"); + // testOp(browser, "XKCD Random Number", "test input", "test_output"); + // testOp(browser, "XML Beautify", "test input", "test_output"); + // testOp(browser, "XML Minify", "test input", "test_output"); + // testOp(browser, "XOR", "test input", "test_output"); + // testOp(browser, "XOR Brute Force", "test input", "test_output"); + // testOp(browser, "XPath expression", "test input", "test_output"); + // testOp(browser, "YARA Rules", "test input", "test_output"); + // testOp(browser, "Zip", "test input", "test_output"); + // testOp(browser, "Zlib Deflate", "test input", "test_output"); + // testOp(browser, "Zlib Inflate", "test input", "test_output"); + }); }, @@ -376,22 +387,47 @@ module.exports = { }; /** - * Clears the current recipe and tests a new operation. + * Clears the current recipe and bakes a new operation. * * @param {string} opName * @param {Browser} browser */ -function testOp(browser, opName, input, output, args=[]) { +function bakeOp(browser, opName, input, args=[]) { - const recipeConfig = JSON.stringify([{ - "op": opName, - "args": args - }]); + let recipeConfig; + /* + * Create recipeConfig as single operation + * or wrapped with a pre-op and + * possibly a post-op too + */ + if (typeof(opName) === "string") { + recipeConfig = JSON.stringify([{ + "op": opName, + "args": args + }]); + } else if (opName.length === 2) { + recipeConfig = JSON.stringify([{ + "op": opName[0], + "args": [] + }, { + "op": opName[1], + "args": args + }]); + } else { + recipeConfig = JSON.stringify([{ + "op": opName[0], + "args": [] + }, { + "op": opName[1], + "args": args + }, { + "op": opName[2], + "args": [] + + }]); + } browser - .perform(function() { - console.log(opName); - }) .useCss() .click("#clr-recipe") .click("#clr-io") @@ -400,6 +436,14 @@ function testOp(browser, opName, input, output, args=[]) { browser .urlHash("recipe=" + recipeConfig) + .url(function(result) { + currentUrl = result; + }) + .perform(function() { + console.log(currentUrl); + console.log(opName); + console.log(recipeConfig); + }) .setValue("#input-text", input) .waitForElementPresent("#rec-list li.operation") .expect.element("#input-text").to.have.value.that.equals(input); @@ -412,9 +456,46 @@ function testOp(browser, opName, input, output, args=[]) { .waitForElementPresent("#stale-indicator.hidden", 5000) .waitForElementNotVisible("#output-loader", 5000); + let currentUrl=""; + browser + .url(function(result) { + currentUrl = result; + }) + .perform(function() { + console.log(currentUrl.value); + }); +} + +/** + * Clears the current recipe and tests a new operation. + * + * @param {string} opName + * @param {Browser} browser + */ +function testOp(browser, opName, input, output, args=[]) { + + bakeOp(browser, opName, input, args); + if (typeof output === "string") { browser.expect.element("#output-text").to.have.value.that.equals(output); } else if (output instanceof RegExp) { browser.expect.element("#output-text").to.have.value.that.matches(output); } } + +/** + * Clears the current recipe and tests a new operation. + * + * @param {string} opName + * @param {Browser} browser + */ +function testOpHtml(browser, opName, input, element, output, args=[]) { + + bakeOp(browser, opName, input, args); + browser.waitForElementPresent("#output-html", 5000); + if (typeof output === "string") { + browser.expect.element("#output-html " + element).to.have.value.that.equals(output); + } else if (output instanceof RegExp) { + browser.expect.element("#output-html " + element).to.have.value.that.matches(output); + } +} diff --git a/tests/operations/samples/Images.mjs b/tests/operations/samples/Images.mjs index 663fa201..396e9f7d 100644 --- a/tests/operations/samples/Images.mjs +++ b/tests/operations/samples/Images.mjs @@ -18,6 +18,12 @@ export const GIF_ANIMATED_HEX = "4749463839610f000f00b30b00424242ffe700ffef00ffc */ export const PNG_HEX = "89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000006624b474400ff00ff00ffa0bda793000000097048597300000dd700000dd70142289b78000005184944415458c3c5575d6c145514feeeccecccacdbddb6e096a5dbcdb6d06d80d06090466d6953454ab52ad0a65589840ac1d02a313c989af062820fa66210130d9a68b0363c34610135690b188b7183c13f44506c8115ba535ab6ddd2617f667f66ae0fb41596ddee2eadf13c4de69e7bcf77cff9cecf25b83f613b3b3b975b2c96f25028c47a3c9e1f5a5a5a7e05a0016000d0c9ef9442d23448a60edeb973a769c78e1d077272721a65594620106000505996bf1a1f1f3f67369bebc2e1f0ef6bd7aedd0a409d2d00e2743a1f2929296915046199a66901007aa3d1580600131313da24000000a594124288aaaab72a2b2bed1d1d1d8f8ba2386fc3860d9f25f3c84c0088cbe56a2d2c2cdc4708d12552880770a7288a3228088215003c1ecfd68d1b377e9e488f4b66dde974aeb2dbed498da71251146d538ed1b4e4746092dddee170b4300ca3c32c251c0edfd8bc79f3d164de4e0680110461794a02119292c482202c387efcf86f3d3d3d7b13814816024a2955e62a8b4451b4abaafad8e485d5743ca005028153699c4dd30c83140a857e4c9409c900a0bbbbfbc368343a34a3754a693a1c58b76eddf2dadada5d89002705b07bf7eee13367ce3cab284aff6c482808425e6767e70bc9ea0033d3e6c6c6c65fd6ac5953a1695a3453c3a150c84d295529a59aa669914cd3705adc6eb7926eaca74455d5605555d5c3030303f59224bd525f5f7f30992e87ff40344d5328a5caa64d9bbe4ca5cbe07f1666ae522dae40a5dd8ed30941c8e5727d63341a9f8a5f181a1ac2f0f07022029e02109d2b00bae2e26207cbb2f72cf03c8f9c9c9c441c580c804dc70b330258b6c020beb87ac9abecb59f8b087377b4f4f30a68b6de482549a29224ddb5168bc51cd5d5d54ff6f5f575cfa69633edeb971c78e2d195db055e77cfb6a2eaadb816e5b59ffafb19a7d3095555e3ab64341a8d96f6f6f6fe755f247c69d542abd9c0bd3c70f90a628c30fd5f56542c5c550fc3837600406e6e2eca9e2e433837fcefc0c8b2e079fe7b9fcfe7aba9a9296613c52f55084acc864a027013b28c828a2d30e805bcbe670fac4b5740f5a9285b18c6a0db4da8c180fdc6fdb035d850c555a174a4148410b85cae7293c97442a7d395363434347775757d91b6075a2a6c45d66ce18369258685de644659d96af45ff80345f9f908c932821313c4eff7639b6d1b06838358242c82d96c86288abe582ce6e6797e052184701c9797910796e61976b10c991fff7f7b5313b6373541d5340426d36f747414e5c67294679503a1e90634e6f57adbac56ebb14020f0e9a14387decf84038c8e232b53b45888dc6dec63636389d290c9caca5a3d09a6a2a6a6a628130054d33092a2c52272bbe4515996113f16288ab2c86432bd01001cc72db5582caf651202eaf5473e7e80d7af270409d9cb320c0c66331ca5a5602c1624180d492412392bcbf2db46a3f1394992f665c481b77a2f9f78e719476b5e16ff2e00d31dae8524cb30e8f560390ee72e5e243d7d7d34168bc16030a87575752ccbb20400a2d1e8b7478e1c390ce0f0fd5442fae6d7039f343d643956345f5fcbf1fafd00b219868145afc78d4b97101a1b833a32426d361bcdcfcf87cd6663a7a6649ee70725497a6faede86e4c2c993cf171716eee5753aeb9d0b7f5ebfae5df67a99b86164e8e6cd9badcdcdcdc7d27ae5a6a3f45147c7794dd30e2e59bcf896c0f3851ccbe602c0a8df4fc783413269d8130c06f79d3e7d7a4b5b5bdbd9b45b77c60304c3f0df75752db31714acf8dbe7cbbee2f5fafd7efff9f6f6f6b357af5e8d647ade3fa1780bad734c65970000000049454e44ae426082"; +/** + * The CyberChef logo with 'chef' + * 32x32 + */ +export const PNG_CHEF_HEX = "89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000006e4494441547801a5c17d6c947701c0f1efeff73cf7debbbed0d2a3c7515e5ae81bd1c2601bd0256685e29808a84c9bc00cfec14b8448b205636234997f2ca8c1f9075163c8d61582246b9913df161184a6c46a24a3a1b4bb513aeee8fb95bb722fcf5def797c6a21e5e55abaf9f9083e1fa5b9b9b9c6ebf5ae4b24124a3018bcb27ffffeff003a200103d09903c1dc084002c6c183073dfbf6edfb555e5ede37a2d128b1584c0246341afd606c6ceca3a2a2a22d9aa65ddbb871e31e20c353a8cc4eb4b4b43cbb7cf9f203369bad4ad7f518e070bbdd6b98a23345783c9ead6eb7fb2bc264b3d9caac56ebf79a9a9abe64b7db0bb66ddb7602d0c9423033d1d6d67660f1e2c5c7841016b28844227a2c169364914c266fdb6c361fa66030b867fbf6edef9085ca0c5a5a5a9e292d2d3d2684b0f039d8ed763f530c5dd79989243b515e5ebe5f4a69e1ffa469dad0ae5dbbce02822c14b2530e1f3efc03abd5ea6316a9548a542a259885aaaa39df32eddcb9d3dfdcdcfc218f51c9ce3025793ac11cd8edf6d24c26f33c20810c0f9164a7c762b18b3c9dc11c689a164a24121d80ce631466b068d1a2ae9a9a9a464551dcdc97c964300c0329259392c9a4914ea705b3d0346da8a1a1a1eac48913bf070ca6496081c2a316017540d5f9f3e78b2a2b2bff585a5aba5a55d579985a5b5b0904025454543049d334239d4e0b66a1aaaaabbebebeeff4e9d31d4c73027b81f592699b815701158803b97bf7ee5d5557577748d7f534264551501485b9482412bd8661640cc3d04d291eb50e70026fa94c59013c0b9c006e33ad2e140a6d8d442296fcfc7ce62a93c9c45f78e185d5274f9eac733a9d453b76ec789b47f9818f8188ca94e7804ee0368ffa27f0b54020c09a356b7820994cd2dddd4d2412910e87039fcfc7c3344dd30dc358d1d8d83804dc649a0aac053c80049e9380022c003ee5491a70b4baba9a07464646686e6ea6b7b7974020c0b973e7e8eeeee681f1f171ce9e3d9b036c0096029b80ef00164001ca003b900f2c530107e00286c92e62b7db53801553341aa5b1b191c2c242229188ded2d2223b3b3b59b16205932e5fbe8ccbe5c2741c88032e601fb01ab80234017b8061e00395290230c82ed1d6d6f637b7dbfde5bebe3ea49404834182c12077eedc21180c12080470b95c4c4c4c70e1c2052a2b2b3b8134a00049e026b014b8c23481490574200338c9ce52565656ae280a797979a8aa4a49490993ac562be17098bb77ef525151c1c0c000f3e7cfa7bfbfbf0678134833450706c94205e24014980f74f190aa62977d7da5ffd4e0bfff5ae62b2e428cf4225405d1f72f1c050b8d5c87db4824128c8e8ed2d3d36384c361313232426d6d2d757575572e5dbaf427a6e96421997203a80604d3e4d76b4b7e674875bbd1db810c5c420cde400c7421039729713a854b5184896030487b7bbbe8eaea22180cd2d1d1416e6eeec98686061f700f880371b2904c69030a8097012ba6576abd55b7c7e25b0d2d8eb7681e0f24523a0b9ed981abb094496eb71bdf721f5abe8694128fc743381c46d7f54fc2a6fafafa9552ca5dc02ab2509892046e016b804d409dd7637ba3c065295ce97550d7f8238a2bd6f1c63b2d8cbbfd2c29aba1b8a0806bd7af33343e2edeed7f17e72b4e6ad7d6b279f9662c160b3d3d3d85baaebfae69dafe850b17e68442a15f02134c5905c4816e856911a003b8feedb5beb117cb0b5e2b2b744a4c351bb6e329282692d0f83418e49b2fbd8448a709f4f60ae976b3e0f905b4c5dad8e6d986dfeea7a4a4243c3a3a7ab7b8b8d85d5c5c4c6e6eeef16bd7ae5d62da2de026905279d2f02a9ffb87393645e5318776efe6d0eedd64749dd8c00093a2d128f5f3eaa9cfa98704ff63b3d9462391c86b3e9feffd582cf6db53a74efd82478d719fe449d2a28a55cc42d334ecaacaa4d1d1511ea7ebbaccc9c9d980c966b3addfb469d31266207992a1eb0c320b9bcd460a931046341ac5300c1e964c26977a3c9ed731a9aa5ae9f57abfcb0c549e640cdf4bfdda69757c550814b250a4c4555444f9ca9548af1721048f11a954ea6a341afd89dbedde1a0a858e3103952c7efc974f3e7cf3e5f203f373ac3f053cdca7eb3aa1681497c381a2aa7c74e386f8f3850bc6c4c4042e972bb365cb16c52430a5d3e9bfb7b6b6be07bcc72c54b233beff878f7fb3f38bdef797cc736c56ad8eb7805c29255e8783a14080c4e82899c141c3eff71b252525f8fd7e45983059add6dba150e8e7cc81ca2cce5c1d18049a760f0d6b654ed7cfac168bcf62b3e1abae6652babfdfc81b1e963c2493c9dc89c7e3072f5ebc18620e14e6e0785353a7aeeb6f572c5b366eb35a17ab8a928f69e4de3d632c1e179832994c301e8f1f6b6f6f7ff5c89123579923c16724a5b4fee3cc99aad2850bbf702b1ccebd393c7ccfd479f4e8d1ab7d7d7d293ea3ff02d269af2f0fa7289f0000000049454e44ae426082"; + /** * Sunglasses smiley * 32x32 From 7b497181fdceea62dccfab846c41247a14abc2ff Mon Sep 17 00:00:00 2001 From: John L Date: Mon, 4 Apr 2022 17:40:58 +0100 Subject: [PATCH 3/6] refactor samples, and more tests --- tests/browser/ops.js | 712 ++++++++++----------- tests/operations/tests/Image.mjs | 2 +- tests/operations/tests/Magic.mjs | 2 +- tests/operations/tests/PGP.mjs | 2 +- tests/operations/tests/RSA.mjs | 2 +- tests/{operations => }/samples/Ciphers.mjs | 0 tests/{operations => }/samples/Images.mjs | 8 +- 7 files changed, 361 insertions(+), 367 deletions(-) rename tests/{operations => }/samples/Ciphers.mjs (100%) rename tests/{operations => }/samples/Images.mjs (90%) diff --git a/tests/browser/ops.js b/tests/browser/ops.js index 49e7c63a..90747aef 100644 --- a/tests/browser/ops.js +++ b/tests/browser/ops.js @@ -16,368 +16,356 @@ module.exports = { .click("#auto-bake-label"); }, - "Sanity check operations": browser => { - import("../operations/samples/Images.mjs") - .then(Images => { - testOp(browser, ["From Hex", "Add Text To Image", "To Hex"], Images.PNG_HEX, Images.PNG_CHEF_HEX); - testOp(browser, "A1Z26 Cipher Decode", "20 5 19 20 15 21 20 16 21 20", "testoutput"); - testOp(browser, "A1Z26 Cipher Encode", "test input", "20 5 19 20 9 14 16 21 20"); - }); - }, - "Sanity check operations": browser => { - import("../operations/samples/Images.mjs").then(Images => { - testOp(browser, "ADD", "test input", "Ê»ÉÊv¿ÄÆËÊ", [{ "option": "Hex", "string": "56" }]); - testOp(browser, "AES Decrypt", "b443f7f7c16ac5396a34273f6f639caa", "test output", [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff" }, { "option": "Hex", "string": "00000000000000000000000000000000" }, "CBC", "Hex", "Raw", { "option": "Hex", "string": "" }]); - testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]); - testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]); - testOp(browser, "Add line numbers", "test input", "1 test input"); - // testOp(browser, ["From Hex", "Add Text To Image", "To Hex"], Images.PNG_HEX, Images.PNG_CHEF_HEX); - // testOp(browser, "Add Text To Image", "test input", "test_output"); - testOp(browser, "Adler-32 Checksum", "test input", "16160411"); - testOp(browser, "Affine Cipher Decode", "test input", "rcqr glnsr", [1, 2]); - testOp(browser, "Affine Cipher Encode", "test input", "njln rbfpn", [2, 1]); - testOp(browser, "Analyse hash", "0123456789abcdef", /CRC-64/); - testOp(browser, "Atbash Cipher", "test input", "gvhg rmkfg"); - // testOp(browser, "Avro to JSON", "test input", "test_output"); - // testOp(browser, "BLAKE2b", "test input", "test_output"); - // testOp(browser, "BLAKE2s", "test input", "test_output"); - // testOp(browser, "BSON deserialise", "test input", "test_output"); - // testOp(browser, "BSON serialise", "test input", "test_output"); - // testOp(browser, "Bacon Cipher Decode", "test input", "test_output"); - // testOp(browser, "Bacon Cipher Encode", "test input", "test_output"); - // testOp(browser, "Bcrypt", "test input", "test_output"); - // testOp(browser, "Bcrypt compare", "test input", "test_output"); - // testOp(browser, "Bcrypt parse", "test input", "test_output"); - // testOp(browser, "Bifid Cipher Decode", "test input", "test_output"); - // testOp(browser, "Bifid Cipher Encode", "test input", "test_output"); - // testOp(browser, "Bit shift left", "test input", "test_output"); - // testOp(browser, "Bit shift right", "test input", "test_output"); - testOp(browser, "Blowfish Decrypt", "10884e15427dd84ec35204e9c8e921ae", "test_output", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Hex", "Raw"]); - testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); - // console.log(Images); - // testOp(browser, "Blur Image", Images.PNG_HEX, "test_output"); - // Imaged Error : Undefined ! Must be a way to Reference Exports - - // testOp(browser, "Bombe", "test input", "test_output"); - testOp(browser, "Bzip2 Compress", "test input", "BZh91AY&SYÏ........@..!N. .!.Â.À.3..ß.rE8P.Ï..."); - testOp(browser, ["From Hex", "Bzip2 Decompress"], "425a68393141592653597b0884b7000003038000008200ce00200021a647a4218013709517c5dc914e14241ec2212dc0", "test_output", [true]); - // testOp(browser, "CRC-16 Checksum", "test input", "test_output"); - // testOp(browser, "CRC-32 Checksum", "test input", "test_output"); - // testOp(browser, "CRC-8 Checksum", "test input", "test_output"); - // testOp(browser, "CSS Beautify", "test input", "test_output"); - // testOp(browser, "CSS Minify", "test input", "test_output"); - // testOp(browser, "CSS selector", "test input", "test_output"); - // testOp(browser, "CSV to JSON", "test input", "test_output"); - // testOp(browser, "CTPH", "test input", "test_output"); - // testOp(browser, "Cartesian Product", "test input", "test_output"); - // testOp(browser, "Change IP format", "test input", "test_output"); - // testOp(browser, "Chi Square", "test input", "test_output"); - // testOp(browser, "CipherSaber2 Decrypt", "test input", "test_output"); - // testOp(browser, "CipherSaber2 Encrypt", "test input", "test_output"); - // testOp(browser, "Citrix CTX1 Decode", "test input", "test_output"); - // testOp(browser, "Citrix CTX1 Encode", "test input", "test_output"); - // testOp(browser, "Colossus", "test input", "test_output"); - // testOp(browser, "Comment", "test input", "test_output"); - // testOp(browser, "Compare CTPH hashes", "test input", "test_output"); - // testOp(browser, "Compare SSDEEP hashes", "test input", "test_output"); - // /testOp(browser, "Conditional Jump", "test input", "test_output"); - // testOp(browser, "Contain Image", "test input", "test_output"); - // testOp(browser, "Convert area", "test input", "test_output"); - // /testOp(browser, "Convert co-ordinate format", "test input", "test_output"); - // testOp(browser, "Convert data units", "test input", "test_output"); - // testOp(browser, "Convert distance", "test input", "test_output"); - // testOp(browser, "Convert Image Format", "test input", "test_output"); - // testOp(browser, "Convert mass", "test input", "test_output"); - // testOp(browser, "Convert speed", "test input", "test_output"); - // testOp(browser, "Convert to NATO alphabet", "test input", "test_output"); - // testOp(browser, "Count occurrences", "test input", "test_output"); - // testOp(browser, "Cover Image", "test input", "test_output"); - // testOp(browser, "Crop Image", "test input", "test_output"); - // testOp(browser, "DES Decrypt", "test input", "test_output"); - // testOp(browser, "DES Encrypt", "test input", "test_output"); - // testOp(browser, "DNS over HTTPS", "test input", "test_output"); - // testOp(browser, "Dechunk HTTP response", "test input", "test_output"); - // testOp(browser, "Decode NetBIOS Name", "test input", "test_output"); - // testOp(browser, "Decode text", "test input", "test_output"); - // testOp(browser, "Defang IP Addresses", "test input", "test_output"); - // testOp(browser, "Defang URL", "test input", "test_output"); - // testOp(browser, "Derive EVP key", "test input", "test_output"); - // testOp(browser, "Derive PBKDF2 key", "test input", "test_output"); - // testOp(browser, "Detect File Type", "test input", "test_output"); - // testOp(browser, "Diff", "test input", "test_output"); - // testOp(browser, "Disassemble x86", "test input", "test_output"); - // testOp(browser, "Dither Image", "test input", "test_output"); - // testOp(browser, "Divide", "test input", "test_output"); - // testOp(browser, "Drop bytes", "test input", "test_output"); - // testOp(browser, "Encode NetBIOS Name", "test input", "test_output"); - // testOp(browser, "Encode text", "test input", "test_output"); - // testOp(browser, "Enigma", "test input", "test_output"); - // testOp(browser, "Entropy", "test input", "test_output"); - // testOp(browser, "Escape string", "test input", "test_output"); - // testOp(browser, "Escape Unicode Characters", "test input", "test_output"); - // testOp(browser, "Expand alphabet range", "test input", "test_output"); - // testOp(browser, "Extract dates", "test input", "test_output"); - // testOp(browser, "Extract domains", "test input", "test_output"); - // testOp(browser, "Extract EXIF", "test input", "test_output"); - // testOp(browser, "Extract email addresses", "test input", "test_output"); - // testOp(browser, "Extract file paths", "test input", "test_output"); - // testOp(browser, "Extract Files", "test input", "test_output"); - // testOp(browser, "Extract IP addresses", "test input", "test_output"); - // testOp(browser, "Extract LSB", "test input", "test_output"); - // testOp(browser, "Extract MAC addresses", "test input", "test_output"); - // testOp(browser, "Extract RGBA", "test input", "test_output"); - // testOp(browser, "Extract URLs", "test input", "test_output"); - // testOp(browser, "Filter", "test input", "test_output"); - // testOp(browser, "Find / Replace", "test input", "test_output"); - // testOp(browser, "Fletcher-16 Checksum", "test input", "test_output"); - // testOp(browser, "Fletcher-32 Checksum", "test input", "test_output"); - // testOp(browser, "Fletcher-64 Checksum", "test input", "test_output"); - // testOp(browser, "Fletcher-8 Checksum", "test input", "test_output"); - // testOp(browser, "Flip Image", "test input", "test_output"); - // testOp(browser, "Fork", "test input", "test_output"); - // testOp(browser, "Format MAC addresses", "test input", "test_output"); - // testOp(browser, "Frequency distribution", "test input", "test_output"); - // testOp(browser, "From BCD", "test input", "test_output"); - // testOp(browser, "From Base", "test input", "test_output"); - // testOp(browser, "From Base32", "test input", "test_output"); - // testOp(browser, "From Base58", "test input", "test_output"); - // testOp(browser, "From Base62", "test input", "test_output"); - // testOp(browser, "From Base64", "test input", "test_output"); - // testOp(browser, "From Base85", "test input", "test_output"); - // testOp(browser, "From Binary", "test input", "test_output"); - // testOp(browser, "From Braille", "test input", "test_output"); - // testOp(browser, "From Case Insensitive Regex", "test input", "test_output"); - // testOp(browser, "From Charcode", "test input", "test_output"); - // testOp(browser, "From Decimal", "test input", "test_output"); - // testOp(browser, "From HTML Entity", "test input", "test_output"); - // testOp(browser, "From Hex", "test input", "test_output"); - // testOp(browser, "From Hex Content", "test input", "test_output"); - // testOp(browser, "From Hexdump", "test input", "test_output"); - // testOp(browser, "From MessagePack", "test input", "test_output"); - // testOp(browser, "From Morse Code", "test input", "test_output"); - // testOp(browser, "From Octal", "test input", "test_output"); - // testOp(browser, "From Punycode", "test input", "test_output"); - // testOp(browser, "From Quoted Printable", "test input", "test_output"); - // testOp(browser, "From UNIX Timestamp", "test input", "test_output"); - // testOp(browser, "GOST hash", "test input", "test_output"); - // testOp(browser, "Generate all hashes", "test input", "test_output"); - // testOp(browser, "Generate HOTP", "test input", "test_output"); - // testOp(browser, "Generate Image", "test input", "test_output"); - // testOp(browser, "Generate Lorem Ipsum", "test input", "test_output"); - // testOp(browser, "Generate PGP Key Pair", "test input", "test_output"); - // testOp(browser, "Generate QR Code", "test input", "test_output"); - // testOp(browser, "Generate TOTP", "test input", "test_output"); - // testOp(browser, "Generate UUID", "test input", "test_output"); - // testOp(browser, "Generic Code Beautify", "test input", "test_output"); - // testOp(browser, "Group IP addresses", "test input", "test_output"); - // testOp(browser, "Gunzip", "test input", "test_output"); - // testOp(browser, "Gzip", "test input", "test_output"); - // testOp(browser, "HAS-160", "test input", "test_output"); - // testOp(browser, "HMAC", "test input", "test_output"); - // testOp(browser, "HTML To Text", "test input", "test_output"); - // testOp(browser, "HTTP request", "test input", "test_output"); - // testOp(browser, "Hamming Distance", "test input", "test_output"); - // testOp(browser, "Haversine distance", "test input", "test_output"); - // testOp(browser, "Head", "test input", "test_output"); - // testOp(browser, "Heatmap chart", "test input", "test_output"); - // testOp(browser, "Hex Density chart", "test input", "test_output"); - // testOp(browser, "Hex to Object Identifier", "test input", "test_output"); - // testOp(browser, "Hex to PEM", "test input", "test_output"); - // testOp(browser, "Image Brightness / Contrast", "test input", "test_output"); - // testOp(browser, "Image Filter", "test input", "test_output"); - // testOp(browser, "Image Hue/Saturation/Lightness", "test input", "test_output"); - // testOp(browser, "Image Opacity", "test input", "test_output"); - // testOp(browser, "Index of Coincidence", "test input", "test_output"); - // testOp(browser, "Invert Image", "test input", "test_output"); - // testOp(browser, "JPath expression", "test input", "test_output"); - // testOp(browser, "JSON Beautify", "test input", "test_output"); - // testOp(browser, "JSON Minify", "test input", "test_output"); - // testOp(browser, "JSON to CSV", "test input", "test_output"); - // testOp(browser, "JWT Decode", "test input", "test_output"); - // testOp(browser, "JWT Sign", "test input", "test_output"); - // testOp(browser, "JWT Verify", "test input", "test_output"); - // testOp(browser, "JavaScript Beautify", "test input", "test_output"); - // testOp(browser, "JavaScript Minify", "test input", "test_output"); - // testOp(browser, "JavaScript Parser", "test input", "test_output"); - // testOp(browser, "Jump", "test input", "test_output"); - // testOp(browser, "Keccak", "test input", "test_output"); - // testOp(browser, "Label", "test input", "test_output"); - // testOp(browser, "Lorenz", "test input", "test_output"); - // testOp(browser, "Luhn Checksum", "test input", "test_output"); - // testOp(browser, "MD2", "test input", "test_output"); - // testOp(browser, "MD4", "test input", "test_output"); - // testOp(browser, "MD5", "test input", "test_output"); - // testOp(browser, "MD6", "test input", "test_output"); - // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "td", /Result snippet/); - // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "tr:nth-of-type(1) td:nth-of-type(2)", "Result snippet"); - // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "tr:eq(1) td:eq(1)", "test_output"); - // testOp(browser, "Mean", "test input", "test_output"); - // testOp(browser, "Median", "test input", "test_output");` - // testOp(browser, "Merge", "test input", "test_output");` - // testOp(browser, "Microsoft Script Decoder", "test input", "test_output"); - // testOp(browser, "Multiple Bombe", "test input", "test_output"); - // testOp(browser, "Multiply", "test input", "test_output"); - // testOp(browser, "NOT", "test input", "test_output"); - // testOp(browser, "Normalise Image", "test input", "test_output"); - // testOp(browser, "Normalise Unicode", "test input", "test_output"); - // testOp(browser, "Numberwang", "test input", "test_output"); - // testOp(browser, "OR", "test input", "test_output"); - // testOp(browser, "Object Identifier to Hex", "test input", "test_output"); - // testOp(browser, "Offset checker", "test input", "test_output"); - // testOp(browser, "Optical Character Recognition", "test input", "test_output"); - // testOp(browser, "PEM to Hex", "test input", "test_output"); - // testOp(browser, "PGP Decrypt", "test input", "test_output"); - // testOp(browser, "PGP Decrypt and Verify", "test input", "test_output"); - // testOp(browser, "PGP Encrypt", "test input", "test_output"); - // testOp(browser, "PGP Encrypt and Sign", "test input", "test_output"); - // testOp(browser, "PGP Verify", "test input", "test_output"); - // testOp(browser, "PHP Deserialize", "test input", "test_output"); - // testOp(browser, "Pad lines", "test input", "test_output"); - // testOp(browser, "Parse ASN.1 hex string", "test input", "test_output"); - // testOp(browser, "Parse colour code", "test input", "test_output"); - // testOp(browser, "Parse DateTime", "test input", "test_output"); - // testOp(browser, "Parse IP range", "test input", "test_output"); - // testOp(browser, "Parse IPv4 header", "test input", "test_output"); - // testOp(browser, "Parse IPv6 address", "test input", "test_output"); - // testOp(browser, "Parse ObjectID timestamp", "test input", "test_output"); - // testOp(browser, "Parse QR Code", "test input", "test_output"); - // testOp(browser, "Parse SSH Host Key", "test input", "test_output"); - // testOp(browser, "Parse TLV", "test input", "test_output"); - // testOp(browser, "Parse UDP", "test input", "test_output"); - // testOp(browser, "Parse UNIX file permissions", "test input", "test_output"); - // testOp(browser, "Parse URI", "test input", "test_output"); - // testOp(browser, "Parse User Agent", "test input", "test_output"); - // testOp(browser, "Parse X.509 certificate", "test input", "test_output"); - // testOp(browser, "Play Media", "test input", "test_output"); - // testOp(browser, "Power Set", "test input", "test_output"); - // testOp(browser, "Protobuf Decode", "test input", "test_output"); - // testOp(browser, "Pseudo-Random Number Generator", "test input", "test_output"); - // testOp(browser, "RC2 Decrypt", "test input", "test_output"); - // testOp(browser, "RC2 Encrypt", "test input", "test_output"); - // testOp(browser, "RC4", "test input", "test_output"); - // testOp(browser, "RC4 Drop", "test input", "test_output"); - // testOp(browser, "RIPEMD", "test input", "test_output"); - // testOp(browser, "ROT13", "test input", "test_output"); - // testOp(browser, "ROT47", "test input", "test_output"); - // testOp(browser, "Rail Fence Cipher Decode", "test input", "test_output"); - // testOp(browser, "Rail Fence Cipher Encode", "test input", "test_output"); - // testOp(browser, "Randomize Colour Palette", "test input", "test_output"); - // testOp(browser, "Raw Deflate", "test input", "test_output"); - // testOp(browser, "Raw Inflate", "test input", "test_output"); - // testOp(browser, "Register", "test input", "test_output"); - // testOp(browser, "Regular expression", "test input", "test_output"); - // testOp(browser, "Remove Diacritics", "test input", "test_output"); - // testOp(browser, "Remove EXIF", "test input", "test_output"); - // testOp(browser, "Remove line numbers", "test input", "test_output"); - // testOp(browser, "Remove null bytes", "test input", "test_output"); - // testOp(browser, "Remove whitespace", "test input", "test_output"); - // testOp(browser, "Render Image", "test input", "test_output"); - // testOp(browser, "Render Markdown", "test input", "test_output"); - // testOp(browser, "Resize Image", "test input", "test_output"); - // testOp(browser, "Return", "test input", "test_output"); - // testOp(browser, "Reverse", "test input", "test_output"); - // testOp(browser, "Rotate Image", "test input", "test_output"); - // testOp(browser, "Rotate left", "test input", "test_output"); - // testOp(browser, "Rotate right", "test input", "test_output"); - // testOp(browser, "SHA0", "test input", "test_output"); - // testOp(browser, "SHA1", "test input", "test_output"); - // testOp(browser, "SHA2", "test input", "test_output"); - // testOp(browser, "SHA3", "test input", "test_output"); - // testOp(browser, "SQL Beautify", "test input", "test_output"); - // testOp(browser, "SQL Minify", "test input", "test_output"); - // testOp(browser, "SSDEEP", "test input", "test_output"); - // testOp(browser, "SUB", "test input", "test_output"); - // testOp(browser, "Scan for Embedded Files", "test input", "test_output"); - // testOp(browser, "Scatter chart", "test input", "test_output"); - // testOp(browser, "Scrypt", "test input", "test_output"); - // testOp(browser, "Series chart", "test input", "test_output"); - // testOp(browser, "Set Difference", "test input", "test_output"); - // testOp(browser, "Set Intersection", "test input", "test_output"); - // testOp(browser, "Set Union", "test input", "test_output"); - // testOp(browser, "Shake", "test input", "test_output"); - // testOp(browser, "Sharpen Image", "test input", "test_output"); - // testOp(browser, "Show Base64 offsets", "test input", "test_output"); - // testOp(browser, "Show on map", "test input", "test_output"); - // testOp(browser, "Sleep", "test input", "test_output"); - // testOp(browser, "Snefru", "test input", "test_output"); - // testOp(browser, "Sort", "test input", "test_output"); - // testOp(browser, "Split", "test input", "test_output"); - // testOp(browser, "Split Colour Channels", "test input", "test_output"); - // testOp(browser, "Standard Deviation", "test input", "test_output"); - // testOp(browser, "Streebog", "test input", "test_output"); - // testOp(browser, "Strings", "test input", "test_output"); - // testOp(browser, "Strip HTML tags", "test input", "test_output"); - // testOp(browser, "Strip HTTP headers", "test input", "test_output"); - // testOp(browser, "Subsection", "test input", "test_output"); - // testOp(browser, "Substitute", "test input", "test_output"); - // testOp(browser, "Subtract", "test input", "test_output"); - // testOp(browser, "Sum", "test input", "test_output"); - // testOp(browser, "Swap endianness", "test input", "test_output"); - // testOp(browser, "Symmetric Difference", "test input", "test_output"); - // testOp(browser, "Syntax highlighter", "test input", "test_output"); - // testOp(browser, "TCP/IP Checksum", "test input", "test_output"); - // testOp(browser, "Tail", "test input", "test_output"); - // testOp(browser, "Take bytes", "test input", "test_output"); - // testOp(browser, "Tar", "test input", "test_output"); - // testOp(browser, "Text Encoding Brute Force", "test input", "test_output"); - // testOp(browser, "To BCD", "test input", "test_output"); - // testOp(browser, "To Base", "test input", "test_output"); - // testOp(browser, "To Base32", "test input", "test_output"); - // testOp(browser, "To Base58", "test input", "test_output"); - // testOp(browser, "To Base62", "test input", "test_output"); - // testOp(browser, "To Base64", "test input", "test_output"); - // testOp(browser, "To Base85", "test input", "test_output"); - // testOp(browser, "To Binary", "test input", "test_output"); - // testOp(browser, "To Braille", "test input", "test_output"); - // testOp(browser, "To Camel case", "test input", "test_output"); - // testOp(browser, "To Case Insensitive Regex", "test input", "test_output"); - // testOp(browser, "To Charcode", "test input", "test_output"); - // testOp(browser, "To Decimal", "test input", "test_output"); - // testOp(browser, "To HTML Entity", "test input", "test_output"); - // testOp(browser, "To Hex", "test input", "test_output"); - // testOp(browser, "To Hex Content", "test input", "test_output"); - // testOp(browser, "To Hexdump", "test input", "test_output"); - // testOp(browser, "To Kebab case", "test input", "test_output"); - // testOp(browser, "To Lower case", "test input", "test_output"); - // testOp(browser, "To MessagePack", "test input", "test_output"); - // testOp(browser, "To Morse Code", "test input", "test_output"); - // testOp(browser, "To Octal", "test input", "test_output"); - // testOp(browser, "To Punycode", "test input", "test_output"); - // testOp(browser, "To Quoted Printable", "test input", "test_output"); - // testOp(browser, "To Snake case", "test input", "test_output"); - // testOp(browser, "To Table", "test input", "test_output"); - // testOp(browser, "To UNIX Timestamp", "test input", "test_output"); - // testOp(browser, "To Upper case", "test input", "test_output"); - // testOp(browser, "Translate DateTime Format", "test input", "test_output"); - // testOp(browser, "Triple DES Decrypt", "test input", "test_output"); - // testOp(browser, "Triple DES Encrypt", "test input", "test_output"); - // testOp(browser, "Typex", "test input", "test_output"); - // testOp(browser, "UNIX Timestamp to Windows Filetime", "test input", "test_output"); - // testOp(browser, "URL Decode", "test input", "test_output"); - // testOp(browser, "URL Encode", "test input", "test_output"); - // testOp(browser, "Unescape string", "test input", "test_output"); - // testOp(browser, "Unescape Unicode Characters", "test input", "test_output"); - // testOp(browser, "Unique", "test input", "test_output"); - // testOp(browser, "Untar", "test input", "test_output"); - // testOp(browser, "Unzip", "test input", "test_output"); - // testOp(browser, "VarInt Decode", "test input", "test_output"); - // testOp(browser, "VarInt Encode", "test input", "test_output"); - // testOp(browser, "View Bit Plane", "test input", "test_output"); - // testOp(browser, "Vigenère Decode", "test input", "test_output"); - // testOp(browser, "Vigenère Encode", "test input", "test_output"); - // testOp(browser, "Whirlpool", "test input", "test_output"); - // testOp(browser, "Windows Filetime to UNIX Timestamp", "test input", "test_output"); - // testOp(browser, "XKCD Random Number", "test input", "test_output"); - // testOp(browser, "XML Beautify", "test input", "test_output"); - // testOp(browser, "XML Minify", "test input", "test_output"); - // testOp(browser, "XOR", "test input", "test_output"); - // testOp(browser, "XOR Brute Force", "test input", "test_output"); - // testOp(browser, "XPath expression", "test input", "test_output"); - // testOp(browser, "YARA Rules", "test input", "test_output"); - // testOp(browser, "Zip", "test input", "test_output"); - // testOp(browser, "Zlib Deflate", "test input", "test_output"); - // testOp(browser, "Zlib Inflate", "test input", "test_output"); - }); + "Sanity check operations": async browser => { + const Images = await import("../samples/Images.mjs"); + testOp(browser, "A1Z26 Cipher Decode", "20 5 19 20 15 21 20 16 21 20", "testoutput"); + testOp(browser, "A1Z26 Cipher Encode", "test input", "20 5 19 20 9 14 16 21 20"); + testOp(browser, "ADD", "test input", "Ê»ÉÊv¿ÄÆËÊ", [{ "option": "Hex", "string": "56" }]); + testOp(browser, "AES Decrypt", "b443f7f7c16ac5396a34273f6f639caa", "test output", [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff" }, { "option": "Hex", "string": "00000000000000000000000000000000" }, "CBC", "Hex", "Raw", { "option": "Hex", "string": "" }]); + testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]); + testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]); + testOp(browser, "Add line numbers", "test input", "1 test input"); + testOp(browser, ["From Hex", "Add Text To Image", "To Base64"], Images.PNG_HEX, Images.PNG_CHEF_B64, ["Chef", "Center", "Middle", 0, 0, 16]); + testOp(browser, "Adler-32 Checksum", "test input", "16160411"); + testOp(browser, "Affine Cipher Decode", "test input", "rcqr glnsr", [1, 2]); + testOp(browser, "Affine Cipher Encode", "test input", "njln rbfpn", [2, 1]); + testOp(browser, "Analyse hash", "0123456789abcdef", /CRC-64/); + testOp(browser, "Atbash Cipher", "test input", "gvhg rmkfg"); + // testOp(browser, "Avro to JSON", "test input", "test_output"); + // testOp(browser, "BLAKE2b", "test input", "test_output"); + // testOp(browser, "BLAKE2s", "test input", "test_output"); + // testOp(browser, "BSON deserialise", "test input", "test_output"); + // testOp(browser, "BSON serialise", "test input", "test_output"); + // testOp(browser, "Bacon Cipher Decode", "test input", "test_output"); + // testOp(browser, "Bacon Cipher Encode", "test input", "test_output"); + // testOp(browser, "Bcrypt", "test input", "test_output"); + // testOp(browser, "Bcrypt compare", "test input", "test_output"); + // testOp(browser, "Bcrypt parse", "test input", "test_output"); + // testOp(browser, "Bifid Cipher Decode", "test input", "test_output"); + // testOp(browser, "Bifid Cipher Encode", "test input", "test_output"); + // testOp(browser, "Bit shift left", "test input", "test_output"); + // testOp(browser, "Bit shift right", "test input", "test_output"); + testOp(browser, "Blowfish Decrypt", "10884e15427dd84ec35204e9c8e921ae", "test_output", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Hex", "Raw"]); + testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); + testOp(browser, ["From Hex", "Blur Image", "To Base64"], Images.PNG_HEX, Images.PNG_BLUR_B64); + // testOp(browser, "Bombe", "test input", "test_output"); + testOp(browser, "Bzip2 Compress", "test input", "BZh91AY&SYÏ........@..!N. .!.Â.À.3..ß.rE8P.Ï..."); + testOp(browser, ["From Hex", "Bzip2 Decompress"], "425a68393141592653597b0884b7000003038000008200ce00200021a647a4218013709517c5dc914e14241ec2212dc0", "test_output", [true]); + // testOp(browser, "CRC-16 Checksum", "test input", "test_output"); + // testOp(browser, "CRC-32 Checksum", "test input", "test_output"); + // testOp(browser, "CRC-8 Checksum", "test input", "test_output"); + // testOp(browser, "CSS Beautify", "test input", "test_output"); + // testOp(browser, "CSS Minify", "test input", "test_output"); + // testOp(browser, "CSS selector", "test input", "test_output"); + // testOp(browser, "CSV to JSON", "test input", "test_output"); + // testOp(browser, "CTPH", "test input", "test_output"); + // testOp(browser, "Cartesian Product", "test input", "test_output"); + // testOp(browser, "Change IP format", "test input", "test_output"); + // testOp(browser, "Chi Square", "test input", "test_output"); + // testOp(browser, "CipherSaber2 Decrypt", "test input", "test_output"); + // testOp(browser, "CipherSaber2 Encrypt", "test input", "test_output"); + // testOp(browser, "Citrix CTX1 Decode", "test input", "test_output"); + // testOp(browser, "Citrix CTX1 Encode", "test input", "test_output"); + // testOp(browser, "Colossus", "test input", "test_output"); + // testOp(browser, "Comment", "test input", "test_output"); + // testOp(browser, "Compare CTPH hashes", "test input", "test_output"); + // testOp(browser, "Compare SSDEEP hashes", "test input", "test_output"); + // /testOp(browser, "Conditional Jump", "test input", "test_output"); + // testOp(browser, "Contain Image", "test input", "test_output"); + // testOp(browser, "Convert area", "test input", "test_output"); + // /testOp(browser, "Convert co-ordinate format", "test input", "test_output"); + // testOp(browser, "Convert data units", "test input", "test_output"); + // testOp(browser, "Convert distance", "test input", "test_output"); + // testOp(browser, "Convert Image Format", "test input", "test_output"); + // testOp(browser, "Convert mass", "test input", "test_output"); + // testOp(browser, "Convert speed", "test input", "test_output"); + // testOp(browser, "Convert to NATO alphabet", "test input", "test_output"); + // testOp(browser, "Count occurrences", "test input", "test_output"); + // testOp(browser, "Cover Image", "test input", "test_output"); + // testOp(browser, "Crop Image", "test input", "test_output"); + // testOp(browser, "DES Decrypt", "test input", "test_output"); + // testOp(browser, "DES Encrypt", "test input", "test_output"); + // testOp(browser, "DNS over HTTPS", "test input", "test_output"); + // testOp(browser, "Dechunk HTTP response", "test input", "test_output"); + // testOp(browser, "Decode NetBIOS Name", "test input", "test_output"); + // testOp(browser, "Decode text", "test input", "test_output"); + // testOp(browser, "Defang IP Addresses", "test input", "test_output"); + // testOp(browser, "Defang URL", "test input", "test_output"); + // testOp(browser, "Derive EVP key", "test input", "test_output"); + // testOp(browser, "Derive PBKDF2 key", "test input", "test_output"); + // testOp(browser, "Detect File Type", "test input", "test_output"); + // testOp(browser, "Diff", "test input", "test_output"); + // testOp(browser, "Disassemble x86", "test input", "test_output"); + // testOp(browser, "Dither Image", "test input", "test_output"); + // testOp(browser, "Divide", "test input", "test_output"); + // testOp(browser, "Drop bytes", "test input", "test_output"); + // testOp(browser, "Encode NetBIOS Name", "test input", "test_output"); + // testOp(browser, "Encode text", "test input", "test_output"); + // testOp(browser, "Enigma", "test input", "test_output"); + // testOp(browser, "Entropy", "test input", "test_output"); + // testOp(browser, "Escape string", "test input", "test_output"); + // testOp(browser, "Escape Unicode Characters", "test input", "test_output"); + // testOp(browser, "Expand alphabet range", "test input", "test_output"); + // testOp(browser, "Extract dates", "test input", "test_output"); + // testOp(browser, "Extract domains", "test input", "test_output"); + // testOp(browser, "Extract EXIF", "test input", "test_output"); + // testOp(browser, "Extract email addresses", "test input", "test_output"); + // testOp(browser, "Extract file paths", "test input", "test_output"); + // testOp(browser, "Extract Files", "test input", "test_output"); + // testOp(browser, "Extract IP addresses", "test input", "test_output"); + // testOp(browser, "Extract LSB", "test input", "test_output"); + // testOp(browser, "Extract MAC addresses", "test input", "test_output"); + // testOp(browser, "Extract RGBA", "test input", "test_output"); + // testOp(browser, "Extract URLs", "test input", "test_output"); + // testOp(browser, "Filter", "test input", "test_output"); + // testOp(browser, "Find / Replace", "test input", "test_output"); + // testOp(browser, "Fletcher-16 Checksum", "test input", "test_output"); + // testOp(browser, "Fletcher-32 Checksum", "test input", "test_output"); + // testOp(browser, "Fletcher-64 Checksum", "test input", "test_output"); + // testOp(browser, "Fletcher-8 Checksum", "test input", "test_output"); + // testOp(browser, "Flip Image", "test input", "test_output"); + // testOp(browser, "Fork", "test input", "test_output"); + // testOp(browser, "Format MAC addresses", "test input", "test_output"); + // testOp(browser, "Frequency distribution", "test input", "test_output"); + // testOp(browser, "From BCD", "test input", "test_output"); + // testOp(browser, "From Base", "test input", "test_output"); + // testOp(browser, "From Base32", "test input", "test_output"); + // testOp(browser, "From Base58", "test input", "test_output"); + // testOp(browser, "From Base62", "test input", "test_output"); + // testOp(browser, "From Base64", "test input", "test_output"); + // testOp(browser, "From Base85", "test input", "test_output"); + // testOp(browser, "From Binary", "test input", "test_output"); + // testOp(browser, "From Braille", "test input", "test_output"); + // testOp(browser, "From Case Insensitive Regex", "test input", "test_output"); + // testOp(browser, "From Charcode", "test input", "test_output"); + // testOp(browser, "From Decimal", "test input", "test_output"); + // testOp(browser, "From HTML Entity", "test input", "test_output"); + // testOp(browser, "From Hex", "test input", "test_output"); + // testOp(browser, "From Hex Content", "test input", "test_output"); + // testOp(browser, "From Hexdump", "test input", "test_output"); + // testOp(browser, "From MessagePack", "test input", "test_output"); + // testOp(browser, "From Morse Code", "test input", "test_output"); + // testOp(browser, "From Octal", "test input", "test_output"); + // testOp(browser, "From Punycode", "test input", "test_output"); + // testOp(browser, "From Quoted Printable", "test input", "test_output"); + // testOp(browser, "From UNIX Timestamp", "test input", "test_output"); + // testOp(browser, "GOST hash", "test input", "test_output"); + // testOp(browser, "Generate all hashes", "test input", "test_output"); + // testOp(browser, "Generate HOTP", "test input", "test_output"); + // testOp(browser, "Generate Image", "test input", "test_output"); + // testOp(browser, "Generate Lorem Ipsum", "test input", "test_output"); + // testOp(browser, "Generate PGP Key Pair", "test input", "test_output"); + // testOp(browser, "Generate QR Code", "test input", "test_output"); + // testOp(browser, "Generate TOTP", "test input", "test_output"); + // testOp(browser, "Generate UUID", "test input", "test_output"); + // testOp(browser, "Generic Code Beautify", "test input", "test_output"); + // testOp(browser, "Group IP addresses", "test input", "test_output"); + // testOp(browser, "Gunzip", "test input", "test_output"); + // testOp(browser, "Gzip", "test input", "test_output"); + // testOp(browser, "HAS-160", "test input", "test_output"); + // testOp(browser, "HMAC", "test input", "test_output"); + // testOp(browser, "HTML To Text", "test input", "test_output"); + // testOp(browser, "HTTP request", "test input", "test_output"); + // testOp(browser, "Hamming Distance", "test input", "test_output"); + // testOp(browser, "Haversine distance", "test input", "test_output"); + // testOp(browser, "Head", "test input", "test_output"); + // testOp(browser, "Heatmap chart", "test input", "test_output"); + // testOp(browser, "Hex Density chart", "test input", "test_output"); + // testOp(browser, "Hex to Object Identifier", "test input", "test_output"); + // testOp(browser, "Hex to PEM", "test input", "test_output"); + // testOp(browser, "Image Brightness / Contrast", "test input", "test_output"); + // testOp(browser, "Image Filter", "test input", "test_output"); + // testOp(browser, "Image Hue/Saturation/Lightness", "test input", "test_output"); + // testOp(browser, "Image Opacity", "test input", "test_output"); + // testOp(browser, "Index of Coincidence", "test input", "test_output"); + // testOp(browser, "Invert Image", "test input", "test_output"); + // testOp(browser, "JPath expression", "test input", "test_output"); + // testOp(browser, "JSON Beautify", "test input", "test_output"); + // testOp(browser, "JSON Minify", "test input", "test_output"); + // testOp(browser, "JSON to CSV", "test input", "test_output"); + // testOp(browser, "JWT Decode", "test input", "test_output"); + // testOp(browser, "JWT Sign", "test input", "test_output"); + // testOp(browser, "JWT Verify", "test input", "test_output"); + // testOp(browser, "JavaScript Beautify", "test input", "test_output"); + // testOp(browser, "JavaScript Minify", "test input", "test_output"); + // testOp(browser, "JavaScript Parser", "test input", "test_output"); + // testOp(browser, "Jump", "test input", "test_output"); + // testOp(browser, "Keccak", "test input", "test_output"); + // testOp(browser, "Label", "test input", "test_output"); + // testOp(browser, "Lorenz", "test input", "test_output"); + // testOp(browser, "Luhn Checksum", "test input", "test_output"); + // testOp(browser, "MD2", "test input", "test_output"); + // testOp(browser, "MD4", "test input", "test_output"); + // testOp(browser, "MD5", "test input", "test_output"); + // testOp(browser, "MD6", "test input", "test_output"); + // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "td", /Result snippet/); + testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "tr:{1} td:{2}", "Result snippet"); + // testOp(browser, "Mean", "test input", "test_output"); + // testOp(browser, "Median", "test input", "test_output");` + // testOp(browser, "Merge", "test input", "test_output");` + // testOp(browser, "Microsoft Script Decoder", "test input", "test_output"); + // testOp(browser, "Multiple Bombe", "test input", "test_output"); + // testOp(browser, "Multiply", "test input", "test_output"); + // testOp(browser, "NOT", "test input", "test_output"); + // testOp(browser, "Normalise Image", "test input", "test_output"); + // testOp(browser, "Normalise Unicode", "test input", "test_output"); + // testOp(browser, "Numberwang", "test input", "test_output"); + // testOp(browser, "OR", "test input", "test_output"); + // testOp(browser, "Object Identifier to Hex", "test input", "test_output"); + // testOp(browser, "Offset checker", "test input", "test_output"); + // testOp(browser, "Optical Character Recognition", "test input", "test_output"); + // testOp(browser, "PEM to Hex", "test input", "test_output"); + // testOp(browser, "PGP Decrypt", "test input", "test_output"); + // testOp(browser, "PGP Decrypt and Verify", "test input", "test_output"); + // testOp(browser, "PGP Encrypt", "test input", "test_output"); + // testOp(browser, "PGP Encrypt and Sign", "test input", "test_output"); + // testOp(browser, "PGP Verify", "test input", "test_output"); + // testOp(browser, "PHP Deserialize", "test input", "test_output"); + // testOp(browser, "Pad lines", "test input", "test_output"); + // testOp(browser, "Parse ASN.1 hex string", "test input", "test_output"); + // testOp(browser, "Parse colour code", "test input", "test_output"); + // testOp(browser, "Parse DateTime", "test input", "test_output"); + // testOp(browser, "Parse IP range", "test input", "test_output"); + // testOp(browser, "Parse IPv4 header", "test input", "test_output"); + // testOp(browser, "Parse IPv6 address", "test input", "test_output"); + // testOp(browser, "Parse ObjectID timestamp", "test input", "test_output"); + // testOp(browser, "Parse QR Code", "test input", "test_output"); + // testOp(browser, "Parse SSH Host Key", "test input", "test_output"); + // testOp(browser, "Parse TLV", "test input", "test_output"); + // testOp(browser, "Parse UDP", "test input", "test_output"); + // testOp(browser, "Parse UNIX file permissions", "test input", "test_output"); + // testOp(browser, "Parse URI", "test input", "test_output"); + // testOp(browser, "Parse User Agent", "test input", "test_output"); + // testOp(browser, "Parse X.509 certificate", "test input", "test_output"); + // testOp(browser, "Play Media", "test input", "test_output"); + // testOp(browser, "Power Set", "test input", "test_output"); + // testOp(browser, "Protobuf Decode", "test input", "test_output"); + // testOp(browser, "Pseudo-Random Number Generator", "test input", "test_output"); + // testOp(browser, "RC2 Decrypt", "test input", "test_output"); + // testOp(browser, "RC2 Encrypt", "test input", "test_output"); + // testOp(browser, "RC4", "test input", "test_output"); + // testOp(browser, "RC4 Drop", "test input", "test_output"); + // testOp(browser, "RIPEMD", "test input", "test_output"); + // testOp(browser, "ROT13", "test input", "test_output"); + // testOp(browser, "ROT47", "test input", "test_output"); + // testOp(browser, "Rail Fence Cipher Decode", "test input", "test_output"); + // testOp(browser, "Rail Fence Cipher Encode", "test input", "test_output"); + // testOp(browser, "Randomize Colour Palette", "test input", "test_output"); + // testOp(browser, "Raw Deflate", "test input", "test_output"); + // testOp(browser, "Raw Inflate", "test input", "test_output"); + // testOp(browser, "Register", "test input", "test_output"); + // testOp(browser, "Regular expression", "test input", "test_output"); + // testOp(browser, "Remove Diacritics", "test input", "test_output"); + // testOp(browser, "Remove EXIF", "test input", "test_output"); + // testOp(browser, "Remove line numbers", "test input", "test_output"); + // testOp(browser, "Remove null bytes", "test input", "test_output"); + // testOp(browser, "Remove whitespace", "test input", "test_output"); + // testOp(browser, "Render Image", "test input", "test_output"); + // testOp(browser, "Render Markdown", "test input", "test_output"); + // testOp(browser, "Resize Image", "test input", "test_output"); + // testOp(browser, "Return", "test input", "test_output"); + // testOp(browser, "Reverse", "test input", "test_output"); + // testOp(browser, "Rotate Image", "test input", "test_output"); + // testOp(browser, "Rotate left", "test input", "test_output"); + // testOp(browser, "Rotate right", "test input", "test_output"); + // testOp(browser, "SHA0", "test input", "test_output"); + // testOp(browser, "SHA1", "test input", "test_output"); + // testOp(browser, "SHA2", "test input", "test_output"); + // testOp(browser, "SHA3", "test input", "test_output"); + // testOp(browser, "SQL Beautify", "test input", "test_output"); + // testOp(browser, "SQL Minify", "test input", "test_output"); + // testOp(browser, "SSDEEP", "test input", "test_output"); + // testOp(browser, "SUB", "test input", "test_output"); + // testOp(browser, "Scan for Embedded Files", "test input", "test_output"); + // testOp(browser, "Scatter chart", "test input", "test_output"); + // testOp(browser, "Scrypt", "test input", "test_output"); + // testOp(browser, "Series chart", "test input", "test_output"); + // testOp(browser, "Set Difference", "test input", "test_output"); + // testOp(browser, "Set Intersection", "test input", "test_output"); + // testOp(browser, "Set Union", "test input", "test_output"); + // testOp(browser, "Shake", "test input", "test_output"); + // testOp(browser, "Sharpen Image", "test input", "test_output"); + // testOp(browser, "Show Base64 offsets", "test input", "test_output"); + // testOp(browser, "Show on map", "test input", "test_output"); + // testOp(browser, "Sleep", "test input", "test_output"); + // testOp(browser, "Snefru", "test input", "test_output"); + // testOp(browser, "Sort", "test input", "test_output"); + // testOp(browser, "Split", "test input", "test_output"); + // testOp(browser, "Split Colour Channels", "test input", "test_output"); + // testOp(browser, "Standard Deviation", "test input", "test_output"); + // testOp(browser, "Streebog", "test input", "test_output"); + // testOp(browser, "Strings", "test input", "test_output"); + // testOp(browser, "Strip HTML tags", "test input", "test_output"); + // testOp(browser, "Strip HTTP headers", "test input", "test_output"); + // testOp(browser, "Subsection", "test input", "test_output"); + // testOp(browser, "Substitute", "test input", "test_output"); + // testOp(browser, "Subtract", "test input", "test_output"); + // testOp(browser, "Sum", "test input", "test_output"); + // testOp(browser, "Swap endianness", "test input", "test_output"); + // testOp(browser, "Symmetric Difference", "test input", "test_output"); + // testOp(browser, "Syntax highlighter", "test input", "test_output"); + // testOp(browser, "TCP/IP Checksum", "test input", "test_output"); + // testOp(browser, "Tail", "test input", "test_output"); + // testOp(browser, "Take bytes", "test input", "test_output"); + // testOp(browser, "Tar", "test input", "test_output"); + // testOp(browser, "Text Encoding Brute Force", "test input", "test_output"); + // testOp(browser, "To BCD", "test input", "test_output"); + // testOp(browser, "To Base", "test input", "test_output"); + // testOp(browser, "To Base32", "test input", "test_output"); + // testOp(browser, "To Base58", "test input", "test_output"); + // testOp(browser, "To Base62", "test input", "test_output"); + // testOp(browser, "To Base64", "test input", "test_output"); + // testOp(browser, "To Base85", "test input", "test_output"); + // testOp(browser, "To Binary", "test input", "test_output"); + // testOp(browser, "To Braille", "test input", "test_output"); + // testOp(browser, "To Camel case", "test input", "test_output"); + // testOp(browser, "To Case Insensitive Regex", "test input", "test_output"); + // testOp(browser, "To Charcode", "test input", "test_output"); + // testOp(browser, "To Decimal", "test input", "test_output"); + // testOp(browser, "To HTML Entity", "test input", "test_output"); + // testOp(browser, "To Hex", "test input", "test_output"); + // testOp(browser, "To Hex Content", "test input", "test_output"); + // testOp(browser, "To Hexdump", "test input", "test_output"); + // testOp(browser, "To Kebab case", "test input", "test_output"); + // testOp(browser, "To Lower case", "test input", "test_output"); + // testOp(browser, "To MessagePack", "test input", "test_output"); + // testOp(browser, "To Morse Code", "test input", "test_output"); + // testOp(browser, "To Octal", "test input", "test_output"); + // testOp(browser, "To Punycode", "test input", "test_output"); + // testOp(browser, "To Quoted Printable", "test input", "test_output"); + // testOp(browser, "To Snake case", "test input", "test_output"); + // testOp(browser, "To Table", "test input", "test_output"); + // testOp(browser, "To UNIX Timestamp", "test input", "test_output"); + // testOp(browser, "To Upper case", "test input", "test_output"); + // testOp(browser, "Translate DateTime Format", "test input", "test_output"); + // testOp(browser, "Triple DES Decrypt", "test input", "test_output"); + // testOp(browser, "Triple DES Encrypt", "test input", "test_output"); + // testOp(browser, "Typex", "test input", "test_output"); + // testOp(browser, "UNIX Timestamp to Windows Filetime", "test input", "test_output"); + // testOp(browser, "URL Decode", "test input", "test_output"); + // testOp(browser, "URL Encode", "test input", "test_output"); + // testOp(browser, "Unescape string", "test input", "test_output"); + // testOp(browser, "Unescape Unicode Characters", "test input", "test_output"); + // testOp(browser, "Unique", "test input", "test_output"); + // testOp(browser, "Untar", "test input", "test_output"); + // testOp(browser, "Unzip", "test input", "test_output"); + // testOp(browser, "VarInt Decode", "test input", "test_output"); + // testOp(browser, "VarInt Encode", "test input", "test_output"); + // testOp(browser, "View Bit Plane", "test input", "test_output"); + // testOp(browser, "Vigenère Decode", "test input", "test_output"); + // testOp(browser, "Vigenère Encode", "test input", "test_output"); + // testOp(browser, "Whirlpool", "test input", "test_output"); + // testOp(browser, "Windows Filetime to UNIX Timestamp", "test input", "test_output"); + // testOp(browser, "XKCD Random Number", "test input", "test_output"); + // testOp(browser, "XML Beautify", "test input", "test_output"); + // testOp(browser, "XML Minify", "test input", "test_output"); + // testOp(browser, "XOR", "test input", "test_output"); + // testOp(browser, "XOR Brute Force", "test input", "test_output"); + // testOp(browser, "XPath expression", "test input", "test_output"); + // testOp(browser, "YARA Rules", "test input", "test_output"); + // testOp(browser, "Zip", "test input", "test_output"); + // testOp(browser, "Zlib Deflate", "test input", "test_output"); + // testOp(browser, "Zlib Inflate", "test input", "test_output"); }, diff --git a/tests/operations/tests/Image.mjs b/tests/operations/tests/Image.mjs index 2ca363b8..1f450433 100644 --- a/tests/operations/tests/Image.mjs +++ b/tests/operations/tests/Image.mjs @@ -9,7 +9,7 @@ * @license Apache-2.0 */ import TestRegister from "../../lib/TestRegister.mjs"; -import { GIF_ANIMATED_HEX, PNG_HEX, JPG_B64, EXIF_JPG_HEX, NO_EXIF_JPG_HEX } from "../samples/Images.mjs"; +import { GIF_ANIMATED_HEX, PNG_HEX, JPG_B64, EXIF_JPG_HEX, NO_EXIF_JPG_HEX } from "../../samples/Images.mjs"; TestRegister.addTests([ { diff --git a/tests/operations/tests/Magic.mjs b/tests/operations/tests/Magic.mjs index 3ae143d2..24353565 100644 --- a/tests/operations/tests/Magic.mjs +++ b/tests/operations/tests/Magic.mjs @@ -7,7 +7,7 @@ * @license Apache-2.0 */ import TestRegister from "../../lib/TestRegister.mjs"; -import { JPG_RAW } from "../samples/Images.mjs"; +import { JPG_RAW } from "../../samples/Images.mjs"; TestRegister.addTests([ { diff --git a/tests/operations/tests/PGP.mjs b/tests/operations/tests/PGP.mjs index 9748f937..8df05fe9 100644 --- a/tests/operations/tests/PGP.mjs +++ b/tests/operations/tests/PGP.mjs @@ -6,7 +6,7 @@ * @license Apache-2.0 */ import TestRegister from "../../lib/TestRegister.mjs"; -import {ASCII_TEXT, UTF8_TEXT, ALL_BYTES} from "../samples/Ciphers.mjs"; +import {ASCII_TEXT, UTF8_TEXT, ALL_BYTES} from "../../samples/Ciphers.mjs"; // RSA-1024 const ALICE_PRIVATE = `-----BEGIN PGP PRIVATE KEY BLOCK----- diff --git a/tests/operations/tests/RSA.mjs b/tests/operations/tests/RSA.mjs index 33e7139f..42bc7246 100644 --- a/tests/operations/tests/RSA.mjs +++ b/tests/operations/tests/RSA.mjs @@ -6,7 +6,7 @@ * @license Apache-2.0 */ import TestRegister from "../../lib/TestRegister.mjs"; -import {ASCII_TEXT, UTF8_TEXT, ALL_BYTES} from "../samples/Ciphers.mjs"; +import {ASCII_TEXT, UTF8_TEXT, ALL_BYTES} from "../../samples/Ciphers.mjs"; const PEM_PRIV_2048 = `-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAwfaUOpUEutKyU3wkCv6kYunz4MqxzSuTSckRz1IxwZtwIiqq diff --git a/tests/operations/samples/Ciphers.mjs b/tests/samples/Ciphers.mjs similarity index 100% rename from tests/operations/samples/Ciphers.mjs rename to tests/samples/Ciphers.mjs diff --git a/tests/operations/samples/Images.mjs b/tests/samples/Images.mjs similarity index 90% rename from tests/operations/samples/Images.mjs rename to tests/samples/Images.mjs index 396e9f7d..c9aff915 100644 --- a/tests/operations/samples/Images.mjs +++ b/tests/samples/Images.mjs @@ -22,7 +22,13 @@ export const PNG_HEX = "89504e470d0a1a0a0000000d49484452000000200000002008060000 * The CyberChef logo with 'chef' * 32x32 */ -export const PNG_CHEF_HEX = "89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000006e4494441547801a5c17d6c947701c0f1efeff73cf7debbbed0d2a3c7515e5ae81bd1c2601bd0256685e29808a84c9bc00cfec14b8448b205636234997f2ca8c1f9075163c8d61582246b9913df161184a6c46a24a3a1b4bb513aeee8fb95bb722fcf5def797c6a21e5e55abaf9f9083e1fa5b9b9b9c6ebf5ae4b24124a3018bcb27ffffeff003a200103d09903c1dc084002c6c183073dfbf6edfb555e5ede37a2d128b1584c0246341afd606c6ceca3a2a2a22d9aa65ddbb871e31e20c353a8cc4eb4b4b43cbb7cf9f203369bad4ad7f518e070bbdd6b98a23345783c9ead6eb7fb2bc264b3d9caac56ebf79a9a9abe64b7db0bb66ddb7602d0c9423033d1d6d67660f1e2c5c7841016b28844227a2c169364914c266fdb6c361fa66030b867fbf6edef9085ca0c5a5a5a9e292d2d3d2684b0f039d8ed763f530c5dd79989243b515e5ebe5f4a69e1ffa469dad0ae5dbbce02822c14b2530e1f3efc03abd5ea6316a9548a542a259885aaaa39df32eddcb9d3dfdcdcfc218f51c9ce3025793ac11cd8edf6d24c26f33c20810c0f9164a7c762b18b3c9dc11c689a164a24121d80ce631466b068d1a2ae9a9a9a464551dcdc97c964300c0329259392c9a4914ea705b3d0346da8a1a1a1eac48913bf070ca6496081c2a316017540d5f9f3e78b2a2b2bff585a5aba5a55d579985a5b5b0904025454543049d334239d4e0b66a1aaaaabbebebeeff4e9d31d4c73027b81f592699b815701158803b97bf7ee5d5557577748d7f534264551501485b9482412bd8661640cc3d04d291eb50e70026fa94c59013c0b9c006e33ad2e140a6d8d442296fcfc7ce62a93c9c45f78e185d5274f9eac733a9d453b76ec789b47f9818f8188ca94e7804ee0368ffa27f0b54020c09a356b7820994cd2dddd4d2412910e87039fcfc7c3344dd30dc358d1d8d83804dc649a0aac053c80049e9380022c003ee5491a70b4baba9a07464646686e6ea6b7b7974020c0b973e7e8eeeee681f1f171ce9e3d9b036c0096029b80ef00164001ca003b900f2c530107e00286c92e62b7db53801553341aa5b1b191c2c242229188ded2d2223b3b3b59b16205932e5fbe8ccbe5c2741c88032e601fb01ab80234017b8061e00395290230c82ed1d6d6f637b7dbfde5bebe3ea49404834182c12077eedc21180c12080470b95c4c4c4c70e1c2052a2b2b3b8134a00049e026b014b8c23481490574200338c9ce52565656ae280a797979a8aa4a49490993ac562be17098bb77ef525151c1c0c000f3e7cfa7bfbfbf0678134833450706c94205e24014980f74f190aa62977d7da5ffd4e0bfff5ae62b2e428cf4225405d1f72f1c050b8d5c87db4824128c8e8ed2d3d36384c361313232426d6d2d757575572e5dbaf427a6e96421997203a80604d3e4d76b4b7e674875bbd1db810c5c420cde400c7421039729713a854b5184896030487b7bbbe8eaea22180cd2d1d1416e6eeec98686061f700f880371b2904c69030a8097012ba6576abd55b7c7e25b0d2d8eb7681e0f24523a0b9ed981abb094496eb71bdf721f5abe8694128fc743381c46d7f54fc2a6fafafa9552ca5dc02ab2509892046e016b804d409dd7637ba3c065295ce97550d7f8238a2bd6f1c63b2d8cbbfd2c29aba1b8a0806bd7af33343e2edeed7f17e72b4e6ad7d6b279f9662c160b3d3d3d85baaebfae69dafe850b17e68442a15f02134c5905c4816e856911a003b8feedb5beb117cb0b5e2b2b744a4c351bb6e329282692d0f83418e49b2fbd8448a709f4f60ae976b3e0f905b4c5dad8e6d986dfeea7a4a4243c3a3a7ab7b8b8d85d5c5c4c6e6eeef16bd7ae5d62da2de026905279d2f02a9ffb87393645e5318776efe6d0eedd64749dd8c00093a2d128f5f3eaa9cfa98704ff63b3d9462391c86b3e9feffd582cf6db53a74efd82478d719fe449d2a28a55cc42d334ecaacaa4d1d1511ea7ebbaccc9c9d980c966b3addfb469d31266207992a1eb0c320b9bcd460a931046341ac5300c1e964c26977a3c9ed731a9aa5ae9f57abfcb0c549e640cdf4bfdda69757c550814b250a4c4555444f9ca9548af1721048f11a954ea6a341afd89dbedde1a0a858e3103952c7efc974f3e7cf3e5f203f373ac3f053cdca7eb3aa1681497c381a2aa7c74e386f8f3850bc6c4c4042e972bb365cb16c52430a5d3e9bfb7b6b6be07bcc72c54b233beff878f7fb3f38bdef797cc736c56ad8eb7805c29255e8783a14080c4e82899c141c3eff71b252525f8fd7e45983059add6dba150e8e7cc81ca2cce5c1d18049a760f0d6b654ed7cfac168bcf62b3e1abae6652babfdfc81b1e963c2493c9dc89c7e3072f5ebc18620e14e6e0785353a7aeeb6f572c5b366eb35a17ab8a928f69e4de3d632c1e179832994c301e8f1f6b6f6f7ff5c89123579923c16724a5b4fee3cc99aad2850bbf702b1ccebd393c7ccfd479f4e8d1ab7d7d7d293ea3ff02d269af2f0fa7289f0000000049454e44ae426082"; +export const PNG_CHEF_B64 = "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"; + +/** + * The CyberChef logo with blur + * 32x32 + */ +export const PNG_BLUR_B64 = "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"; /** * Sunglasses smiley From 1c048484808b63ad01160b51d666daf061e64ac4 Mon Sep 17 00:00:00 2001 From: John L Date: Wed, 6 Apr 2022 10:51:52 +0100 Subject: [PATCH 4/6] added log_path --- nightwatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nightwatch.json b/nightwatch.json index 072e6c52..5b33631b 100644 --- a/nightwatch.json +++ b/nightwatch.json @@ -10,7 +10,7 @@ "start_process": true, "server_path": "./node_modules/.bin/chromedriver", "port": 9515, - "log_path": false + "log_path": "tests/browser/output" }, "desiredCapabilities": { "browserName": "chrome" From c431fb30c5a8225c1fc6a63adfc40350a4d3a5d6 Mon Sep 17 00:00:00 2001 From: John L Date: Wed, 6 Apr 2022 10:54:20 +0100 Subject: [PATCH 5/6] added logging & jsdoc --- tests/browser/ops.js | 65 ++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/tests/browser/ops.js b/tests/browser/ops.js index 09740cc8..34fd6a5b 100644 --- a/tests/browser/ops.js +++ b/tests/browser/ops.js @@ -198,8 +198,9 @@ module.exports = { // testOp(browser, "MD4", "test input", "test_output"); // testOp(browser, "MD5", "test input", "test_output"); // testOp(browser, "MD6", "test input", "test_output"); - // testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "td", /Result snippet/); - testOpHtml(browser, "Magic", "dGVzdCBvdXRwdXQ=", "tr:{1} td:{2}", "Result snippet"); + testOpHtml(browser, "Magic", "dGVzdF9vdXRwdXQ=", "tr:nth-of-type(1) th:nth-of-type(2)", "Result snippet"); + testOpHtml(browser, "Magic", "dGVzdF9vdXRwdXQ=", "tr:nth-of-type(2) td:nth-of-type(2)", "test_output"); + testOpHtml(browser, "Magic", "dGVzdF9vdXRwdXQ=", "tr:nth-of-type(2) td:nth-of-type(1)", /Base64/); // testOp(browser, "Mean", "test input", "test_output"); // testOp(browser, "Median", "test input", "test_output");` // testOp(browser, "Merge", "test input", "test_output");` @@ -374,26 +375,30 @@ module.exports = { } }; -/** +/** @function * Clears the current recipe and bakes a new operation. * - * @param {string} opName - * @param {Browser} browser + * @param {Browser} browser - Nightwatch client + * @param {string|Array} opName - name of operation to be tested, array for pre & post ops + * @param {string} input - input text for test + * @param {Array.} args - arguments for test */ function bakeOp(browser, opName, input, args=[]) { - let recipeConfig; + let op, recipeConfig; /* * Create recipeConfig as single operation * or wrapped with a pre-op and * possibly a post-op too */ if (typeof(opName) === "string") { + op = opName; recipeConfig = JSON.stringify([{ "op": opName, "args": args }]); } else if (opName.length === 2) { + op = opName[1]; recipeConfig = JSON.stringify([{ "op": opName[0], "args": [] @@ -402,6 +407,7 @@ function bakeOp(browser, opName, input, args=[]) { "args": args }]); } else { + op = opName[1]; recipeConfig = JSON.stringify([{ "op": opName[0], "args": [] @@ -411,7 +417,6 @@ function bakeOp(browser, opName, input, args=[]) { }, { "op": opName[2], "args": [] - }]); } @@ -419,18 +424,22 @@ function bakeOp(browser, opName, input, args=[]) { .useCss() .click("#clr-recipe") .click("#clr-io") + .perform(function() { + console.log("\nCurrent Operation: ", op); + }) .waitForElementNotPresent("#rec-list li.operation") .expect.element("#input-text").to.have.property("value").that.equals(""); + let currentUrl; browser .urlHash("recipe=" + recipeConfig) + // get the current URL .url(function(result) { currentUrl = result; }) + // and put it out .perform(function() { - console.log(currentUrl); - console.log(opName); - console.log(recipeConfig); + console.log("Current URL: ", currentUrl.value); }) .setValue("#input-text", input) .waitForElementPresent("#rec-list li.operation") @@ -443,22 +452,16 @@ function bakeOp(browser, opName, input, args=[]) { .pause(100) .waitForElementPresent("#stale-indicator.hidden", 5000) .waitForElementNotVisible("#output-loader", 5000); - - let currentUrl=""; - browser - .url(function(result) { - currentUrl = result; - }) - .perform(function() { - console.log(currentUrl.value); - }); } -/** +/** @function * Clears the current recipe and tests a new operation. * - * @param {string} opName - * @param {Browser} browser + * @param {Browser} browser - Nightwatch client + * @param {string|Array} opName - name of operation to be tested, array for pre & post ops + * @param {string} input - input text for test + * @param {string} output - expected output + * @param {Array.} args - arguments for test */ function testOp(browser, opName, input, output, args=[]) { @@ -471,19 +474,23 @@ function testOp(browser, opName, input, output, args=[]) { } } -/** +/** @function * Clears the current recipe and tests a new operation. * - * @param {string} opName - * @param {Browser} browser + * @param {Browser} browser - Nightwatch client + * @param {string} opName - name of operation to be tested + * @param {string} input - input text for test + * @param {string} cssSelector - CSS selector for HTML output + * @param {string} output - expected output + * @param {Array.} args - arguments for test */ -function testOpHtml(browser, opName, input, element, output, args=[]) { +function testOpHtml(browser, opName, input, cssSelector, output, args=[]) { bakeOp(browser, opName, input, args); - browser.waitForElementPresent("#output-html", 5000); + if (typeof output === "string") { - browser.expect.element("#output-html " + element).to.have.value.that.equals(output); + browser.expect.element("#output-html " + cssSelector).text.that.equals(output); } else if (output instanceof RegExp) { - browser.expect.element("#output-html " + element).to.have.value.that.matches(output); + browser.expect.element("#output-html " + cssSelector).text.that.matches(output); } } From fb3eceaee04ed11ca9e80aa0e2ecacf0ba4d3206 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Thu, 14 Apr 2022 13:16:36 +0100 Subject: [PATCH 6/6] Tidied up UI tests --- nightwatch.json | 3 +- tests/browser/ops.js | 74 ++++++++++++++------------------------------ 2 files changed, 26 insertions(+), 51 deletions(-) diff --git a/nightwatch.json b/nightwatch.json index 5b33631b..21836547 100644 --- a/nightwatch.json +++ b/nightwatch.json @@ -14,7 +14,8 @@ }, "desiredCapabilities": { "browserName": "chrome" - } + }, + "enable_fail_fast": true }, "dev": { diff --git a/tests/browser/ops.js b/tests/browser/ops.js index 34fd6a5b..bb18dc5d 100644 --- a/tests/browser/ops.js +++ b/tests/browser/ops.js @@ -25,7 +25,7 @@ module.exports = { testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]); testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]); testOp(browser, "Add line numbers", "test input", "1 test input"); - testOp(browser, ["From Hex", "Add Text To Image", "To Base64"], Images.PNG_HEX, Images.PNG_CHEF_B64, ["Chef", "Center", "Middle", 0, 0, 16]); + testOp(browser, ["From Hex", "Add Text To Image", "To Base64"], Images.PNG_HEX, Images.PNG_CHEF_B64, [[], ["Chef", "Center", "Middle", 0, 0, 16], []]); testOp(browser, "Adler-32 Checksum", "test input", "16160411"); testOp(browser, "Affine Cipher Decode", "test input", "rcqr glnsr", [1, 2]); testOp(browser, "Affine Cipher Encode", "test input", "njln rbfpn", [2, 1]); @@ -49,8 +49,8 @@ module.exports = { testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); testOp(browser, ["From Hex", "Blur Image", "To Base64"], Images.PNG_HEX, Images.PNG_BLUR_B64); // testOp(browser, "Bombe", "test input", "test_output"); - testOp(browser, "Bzip2 Compress", "test input", "BZh91AY&SYÏ........@..!N. .!.Â.À.3..ß.rE8P.Ï..."); - testOp(browser, ["From Hex", "Bzip2 Decompress"], "425a68393141592653597b0884b7000003038000008200ce00200021a647a4218013709517c5dc914e14241ec2212dc0", "test_output", [true]); + testOp(browser, ["Bzip2 Compress", "To Hex"], "test input", "42 5a 68 39 31 41 59 26 53 59 cf 96 82 1d 00 00 03 91 80 40 00 02 21 4e 00 20 00 21 90 c2 10 c0 88 33 92 8e df 17 72 45 38 50 90 cf 96 82 1d"); + testOp(browser, ["From Hex", "Bzip2 Decompress"], "425a68393141592653597b0884b7000003038000008200ce00200021a647a4218013709517c5dc914e14241ec2212dc0", "test_output", [[], [true]]); // testOp(browser, "CRC-16 Checksum", "test input", "test_output"); // testOp(browser, "CRC-32 Checksum", "test input", "test_output"); // testOp(browser, "CRC-8 Checksum", "test input", "test_output"); @@ -379,68 +379,43 @@ module.exports = { * Clears the current recipe and bakes a new operation. * * @param {Browser} browser - Nightwatch client - * @param {string|Array} opName - name of operation to be tested, array for pre & post ops + * @param {string|Array} opName - name of operation to be tested, array for multiple ops * @param {string} input - input text for test - * @param {Array.} args - arguments for test + * @param {Array|Array>} args - aarguments, nested if multiple ops */ function bakeOp(browser, opName, input, args=[]) { + let recipeConfig; - let op, recipeConfig; - /* - * Create recipeConfig as single operation - * or wrapped with a pre-op and - * possibly a post-op too - */ if (typeof(opName) === "string") { - op = opName; recipeConfig = JSON.stringify([{ "op": opName, "args": args }]); - } else if (opName.length === 2) { - op = opName[1]; - recipeConfig = JSON.stringify([{ - "op": opName[0], - "args": [] - }, { - "op": opName[1], - "args": args - }]); + } else if (opName instanceof Array) { + recipeConfig = JSON.stringify( + opName.map((op, i) => { + return { + op: op, + args: args.length ? args[i] : [] + }; + }) + ); } else { - op = opName[1]; - recipeConfig = JSON.stringify([{ - "op": opName[0], - "args": [] - }, { - "op": opName[1], - "args": args - }, { - "op": opName[2], - "args": [] - }]); + throw new Error("Invalid operation type. Must be string or array of strings. Received: " + typeof(opName)); } browser .useCss() .click("#clr-recipe") .click("#clr-io") - .perform(function() { - console.log("\nCurrent Operation: ", op); - }) .waitForElementNotPresent("#rec-list li.operation") .expect.element("#input-text").to.have.property("value").that.equals(""); - let currentUrl; browser - .urlHash("recipe=" + recipeConfig) - // get the current URL - .url(function(result) { - currentUrl = result; - }) - // and put it out .perform(function() { - console.log("Current URL: ", currentUrl.value); + console.log(`Current test: ${opName}`); }) + .urlHash("recipe=" + recipeConfig) .setValue("#input-text", input) .waitForElementPresent("#rec-list li.operation") .expect.element("#input-text").to.have.property("value").that.equals(input); @@ -458,10 +433,10 @@ function bakeOp(browser, opName, input, args=[]) { * Clears the current recipe and tests a new operation. * * @param {Browser} browser - Nightwatch client - * @param {string|Array} opName - name of operation to be tested, array for pre & post ops - * @param {string} input - input text for test + * @param {string|Array} opName - name of operation to be tested, array for multiple ops + * @param {string} input - input text * @param {string} output - expected output - * @param {Array.} args - arguments for test + * @param {Array|Array>} args - arguments, nested if multiple ops */ function testOp(browser, opName, input, output, args=[]) { @@ -478,14 +453,13 @@ function testOp(browser, opName, input, output, args=[]) { * Clears the current recipe and tests a new operation. * * @param {Browser} browser - Nightwatch client - * @param {string} opName - name of operation to be tested - * @param {string} input - input text for test + * @param {string|Array} opName - name of operation to be tested array for multiple ops + * @param {string} input - input text * @param {string} cssSelector - CSS selector for HTML output * @param {string} output - expected output - * @param {Array.} args - arguments for test + * @param {Array|Array>} args - arguments, nested if multiple ops */ function testOpHtml(browser, opName, input, cssSelector, output, args=[]) { - bakeOp(browser, opName, input, args); if (typeof output === "string") {