mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
Further operation tests
This commit is contained in:
parent
73f5069971
commit
c5766c89f6
2 changed files with 25 additions and 25 deletions
|
@ -170,11 +170,16 @@ function loadRecipe(browser, opName, input, args) {
|
|||
* Tests whether the output matches a given value
|
||||
*
|
||||
* @param {Browser} browser - Nightwatch client
|
||||
* @param {string} expected - The expected output value
|
||||
* @param {string|RegExp} expected - The expected output value
|
||||
*/
|
||||
function expectOutput(browser, expected) {
|
||||
browser.execute(expected => {
|
||||
return expected === window.app.manager.output.outputEditorView.state.doc.toString();
|
||||
const output = window.app.manager.output.outputEditorView.state.doc.toString();
|
||||
if (expected instanceof RegExp) {
|
||||
return expected.test(output);
|
||||
} else {
|
||||
return expected === output;
|
||||
}
|
||||
}, [expected]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue