From 9cbf217d424065b222b601f491ff8a828de3839e Mon Sep 17 00:00:00 2001 From: n1474335 Date: Mon, 27 Feb 2023 18:21:06 +0000 Subject: [PATCH] Fixed UI tests to work with new input and output areas --- tests/browser/nightwatch.js | 6 +++--- tests/browser/ops.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/browser/nightwatch.js b/tests/browser/nightwatch.js index e63a8036..f7a4d673 100644 --- a/tests/browser/nightwatch.js +++ b/tests/browser/nightwatch.js @@ -82,7 +82,7 @@ module.exports = { // Enter input browser .useCss() - .setValue("#input-text", "Don't Panic.") // TODO + .sendKeys("#input-text .cm-content", "Don't Panic.") .pause(1000) .click("#bake"); @@ -90,7 +90,7 @@ module.exports = { browser .useCss() .waitForElementNotVisible("#stale-indicator", 1000) - .expect.element("#output-text").to.have.property("value").that.equals("44 6f 6e 27 74 20 50 61 6e 69 63 2e"); // TODO + .expect.element("#output-text .cm-content").to.have.property("textContent").that.equals("44 6f 6e 27 74 20 50 61 6e 69 63 2e"); // Clear recipe browser @@ -206,7 +206,7 @@ module.exports = { .useCss() .waitForElementVisible(".operation .op-title", 1000) .waitForElementNotVisible("#stale-indicator", 1000) - .expect.element("#output-text").to.have.property("value").which.matches(/[\da-f-]{36}/); // TODO + .expect.element("#output-text .cm-content").to.have.property("textContent").which.matches(/[\da-f-]{36}/); browser.click("#clr-recipe"); }, diff --git a/tests/browser/ops.js b/tests/browser/ops.js index 0e7735d0..7d7bd340 100644 --- a/tests/browser/ops.js +++ b/tests/browser/ops.js @@ -410,16 +410,16 @@ function bakeOp(browser, opName, input, args=[]) { .click("#clr-recipe") .click("#clr-io") .waitForElementNotPresent("#rec-list li.operation") - .expect.element("#input-text").to.have.property("value").that.equals(""); // TODO + .expect.element("#input-text .cm-content").to.have.property("textContent").that.equals(""); browser .perform(function() { console.log(`Current test: ${opName}`); }) .urlHash("recipe=" + recipeConfig) - .setValue("#input-text", input) // TODO + .sendKeys("#input-text .cm-content", input) .waitForElementPresent("#rec-list li.operation") - .expect.element("#input-text").to.have.property("value").that.equals(input); // TODO + .expect.element("#input-text .cm-content").to.have.property("textContent").that.equals(input); browser .waitForElementVisible("#stale-indicator", 5000) @@ -444,9 +444,9 @@ function testOp(browser, opName, input, output, args=[]) { bakeOp(browser, opName, input, args); if (typeof output === "string") { - browser.expect.element("#output-text").to.have.property("value").that.equals(output); // TODO + browser.expect.element("#output-text .cm-content").to.have.property("textContent").that.equals(output); } else if (output instanceof RegExp) { - browser.expect.element("#output-text").to.have.property("value").that.matches(output); // TODO + browser.expect.element("#output-text .cm-content").to.have.property("textContent").that.matches(output); } }