diff --git a/src/commands/wait.js b/src/commands/wait.js index e2f85871..1a7b1ff4 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/test-js/api-output/parseWaitForProperty/basic-1.toml b/tests/test-js/api-output/parseWaitForProperty/basic-1.toml index 91174951..ac6f1307 100644 --- a/tests/test-js/api-output/parseWaitForProperty/basic-1.toml +++ b/tests/test-js/api-output/parseWaitForProperty/basic-1.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/basic-2.toml b/tests/test-js/api-output/parseWaitForProperty/basic-2.toml index efe4628a..dd39e118 100644 --- a/tests/test-js/api-output/parseWaitForProperty/basic-2.toml +++ b/tests/test-js/api-output/parseWaitForProperty/basic-2.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/basic-3.toml b/tests/test-js/api-output/parseWaitForProperty/basic-3.toml index 55af5d35..7962a422 100644 --- a/tests/test-js/api-output/parseWaitForProperty/basic-3.toml +++ b/tests/test-js/api-output/parseWaitForProperty/basic-3.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/color-1.toml b/tests/test-js/api-output/parseWaitForProperty/color-1.toml index 3c980ec1..93767426 100644 --- a/tests/test-js/api-output/parseWaitForProperty/color-1.toml +++ b/tests/test-js/api-output/parseWaitForProperty/color-1.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/extra-1.toml b/tests/test-js/api-output/parseWaitForProperty/extra-1.toml index 53875fe6..3b9e334d 100644 --- a/tests/test-js/api-output/parseWaitForProperty/extra-1.toml +++ b/tests/test-js/api-output/parseWaitForProperty/extra-1.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/extra-2.toml b/tests/test-js/api-output/parseWaitForProperty/extra-2.toml index fa27f5da..af9206c0 100644 --- a/tests/test-js/api-output/parseWaitForProperty/extra-2.toml +++ b/tests/test-js/api-output/parseWaitForProperty/extra-2.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (!prop.includes(parseWaitForPropValue)) { - nonMatchingAttrs.push(\"property `\" + parseWaitForPropKey + \"` (`\" + prop + \"`) doesn't contain `\" + parseWaitForPropValue + \"` (for CONTAINS check)\"); + nonMatchingProps.push(\"property `\" + parseWaitForPropKey + \"` (`\" + prop + \"`) doesn't contain `\" + parseWaitForPropValue + \"` (for CONTAINS check)\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/extra-3.toml b/tests/test-js/api-output/parseWaitForProperty/extra-3.toml index da8dadc5..f42b26da 100644 --- a/tests/test-js/api-output/parseWaitForProperty/extra-3.toml +++ b/tests/test-js/api-output/parseWaitForProperty/extra-3.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (!prop.includes(parseWaitForPropValue)) { - nonMatchingAttrs.push(\"property `\" + parseWaitForPropKey + \"` (`\" + prop + \"`) doesn't contain `\" + parseWaitForPropValue + \"` (for CONTAINS check)\"); + nonMatchingProps.push(\"property `\" + parseWaitForPropKey + \"` (`\" + prop + \"`) doesn't contain `\" + parseWaitForPropValue + \"` (for CONTAINS check)\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/pseudo-1.toml b/tests/test-js/api-output/parseWaitForProperty/pseudo-1.toml index 1fb6e6bd..bcb1e0da 100644 --- a/tests/test-js/api-output/parseWaitForProperty/pseudo-1.toml +++ b/tests/test-js/api-output/parseWaitForProperty/pseudo-1.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/xpath-2.toml b/tests/test-js/api-output/parseWaitForProperty/xpath-2.toml index 8de1126c..f7f5fb14 100644 --- a/tests/test-js/api-output/parseWaitForProperty/xpath-2.toml +++ b/tests/test-js/api-output/parseWaitForProperty/xpath-2.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; diff --git a/tests/test-js/api-output/parseWaitForProperty/xpath-3.toml b/tests/test-js/api-output/parseWaitForProperty/xpath-3.toml index a9b3ef9d..8865db32 100644 --- a/tests/test-js/api-output/parseWaitForProperty/xpath-3.toml +++ b/tests/test-js/api-output/parseWaitForProperty/xpath-3.toml @@ -18,7 +18,7 @@ instructions = [ } const prop = e[parseWaitForPropKey]; if (prop !== parseWaitForPropValue) { - nonMatchingAttrs.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); + nonMatchingProps.push(\"expected `\" + parseWaitForPropValue + \"` for property `\" + parseWaitForPropKey + \"`, found `\" + prop + \"`\"); } } return nonMatchingProps; 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 00000000..1dce2dc8 --- /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 00000000..937e35cc --- /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