From e86331dea46dcc779f70eb7e549fa7255b3a1ba1 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 18 Sep 2023 08:53:48 -0700 Subject: [PATCH] Fix crash when wait-for-property fails --- src/commands/wait.js | 2 +- tests/ui-tests/wait-for-property-3.goml | 6 ++++++ tests/ui-tests/wait-for-property-3.output | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/ui-tests/wait-for-property-3.goml create mode 100644 tests/ui-tests/wait-for-property-3.output diff --git a/src/commands/wait.js b/src/commands/wait.js index e2f858718..1a7b1ff4c 100644 --- a/src/commands/wait.js +++ b/src/commands/wait.js @@ -752,7 +752,7 @@ function parseWaitForProperty(parser) { const varValue = varName + 'Value'; const { checks, hasSpecialChecks } = makeExtendedChecks( - enabledChecks, false, 'nonMatchingAttrs', 'property', 'prop', varKey, varValue); + enabledChecks, false, 'nonMatchingProps', 'property', 'prop', varKey, varValue); let checker; if (!enabledChecks['ALL']) { diff --git a/tests/ui-tests/wait-for-property-3.goml b/tests/ui-tests/wait-for-property-3.goml new file mode 100644 index 000000000..1dce2dc81 --- /dev/null +++ b/tests/ui-tests/wait-for-property-3.goml @@ -0,0 +1,6 @@ +// This test ensures that the `wait-for-property` command is behaving like expected. +go-to: "file://" + |CURRENT_DIR| + "/" + |DOC_PATH| + "/elements.html" +set-timeout: 500 +// Try a property with a different type. +// This should give a failure, not an internal error. +wait-for-property: ("html", {"offsetLeft": "0"}) diff --git a/tests/ui-tests/wait-for-property-3.output b/tests/ui-tests/wait-for-property-3.output new file mode 100644 index 000000000..937e35cc5 --- /dev/null +++ b/tests/ui-tests/wait-for-property-3.output @@ -0,0 +1,7 @@ +=> Starting doc-ui tests... + +wait-for-property-3... FAILED +[ERROR] (line 6) Error: The following properties still don't match: [expected `0` for property `offsetLeft`, found `0`]: for command `wait-for-property: ("html", {"offsetLeft": "0"})` + + +<= doc-ui tests done: 0 succeeded, 1 failed \ No newline at end of file