Skip to content

Commit

Permalink
Fix crash when wait-for-property fails
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle-cerebrum committed Sep 18, 2023
1 parent f6452af commit e86331d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down
6 changes: 6 additions & 0 deletions tests/ui-tests/wait-for-property-3.goml
Original file line number Diff line number Diff line change
@@ -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"})
7 changes: 7 additions & 0 deletions tests/ui-tests/wait-for-property-3.output
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e86331d

Please sign in to comment.