Skip to content

Commit

Permalink
Update UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 21, 2023
1 parent e5a9597 commit aa9a227
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
5 changes: 5 additions & 0 deletions tests/test-js/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,11 @@ assert-css: (".item-left sup", {"color": |color|})`);
p = new Parser('("hello",{"a": "1"))');
p.parse();
x.assert(p.error, 'expected `,` or `}` after `"1"`, found `)`');

p = new Parser('{"x": |a|}');
p.parse();
x.assert(p.elems[0].kind, 'json');
x.assert(p.elems[0].error, null);
}

function checkComment(x) {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-tests/call-function-before-goto.output
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=> Starting doc-ui tests...

call-function-before-goto... FAILED
[ERROR] line 7 from 23: First command must be `go-to` (`assert-variable`, `assert-variable-false`, `call-function`, `debug`, `define-function`, `emulate`, `expect-failure`, `fail-on-js-error`, `fail-on-request-error`, `javascript`, `screenshot-comparison`, `screenshot-on-failure`, `store-value` or `set-timeout` can be used before)!
[ERROR] line 7 from line 23: First command must be `go-to` (`assert-variable`, `assert-variable-false`, `call-function`, `debug`, `define-function`, `emulate`, `expect-failure`, `fail-on-js-error`, `fail-on-request-error`, `javascript`, `screenshot-comparison`, `screenshot-on-failure`, `store-value` or `set-timeout` can be used before)!

<= doc-ui tests done: 0 succeeded, 1 failed
2 changes: 1 addition & 1 deletion tests/ui-tests/error-before-variable-inference.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This test ensures that if the command is unknown, it'll fail before trying to infer variables.
go-to: "file://" + |CURRENT_DIR| + "/" + |DOC_PATH| + "/elements.html"
//go-to: "file://" + |CURRENT_DIR| + "/" + |DOC_PATH| + "/elements.html"
whatever: {"a": |non_existent|}
3 changes: 2 additions & 1 deletion tests/ui-tests/error-before-variable-inference.output
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
=> Starting doc-ui tests...

error-before-variable-inference... FAILED
[ERROR] line 3: Unknown command "whatever"
Syntax errors:
line 3: Unknown command "whatever"

<= doc-ui tests done: 0 succeeded, 1 failed
14 changes: 6 additions & 8 deletions tests/ui-tests/functions.output
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
=> Starting doc-ui tests...

functions... FAILED
[WARNING] line 11 from 22: overwriting existing `fn1` function
[WARNING] line 23: overwriting existing `fn1` function
[WARNING] line 12 from line 22: overwriting existing `fn1` function
[WARNING] line 28: overwriting existing `fn1` function

[ERROR] (line 8 from 22) The following errors happened (for selector `header`): [expected `a` for key `background-color`, found `rgb(17, 17, 17)`; expected `y` for key `color`, found `rgb(255, 255, 255)`]: for command `assert-css: ("header", {"background-color": |background_color|, "color": |color|})`
[ERROR] (line 9 from 22) The following errors happened (for selector `header`): [expected `a` for key `color`, found `rgb(255, 255, 255)`]: for command `assert-css: ("header", |whole_check|)`
[ERROR] (line 12 from 22) Error: Evaluation failed: The following errors happened (for selector `header`): [No attribute named `color`]: for command `assert-attribute: ("header", {"color": "blue"})`
[ERROR] (line 16 from 22) The following errors happened (for selector `header`): [expected `red` for key `color`, found `red`]: for command `assert-css: ("header", {"color": "red"})`
[ERROR] (line 27 from 32) The following errors happened (for selector `header`): [expected `a` for key `background-color`, found `rgb(17, 17, 17)`]: for command `assert-css: ("header", {"background-color": |background_color|})`
[ERROR] (line 28 from 32) The following errors happened (for selector `header`): [expected `a` for key `color`, found `rgb(255, 255, 255)`]: for command `assert-css: ("header", |whole_check|)`
[ERROR] (line 8 from line 22) The following errors happened (for selector `header`): [expected `a` for key `background-color`, found `rgb(17, 17, 17)`; expected `y` for key `color`, found `rgb(255, 255, 255)`]: for command `assert-css: ("header", {"background-color": |background_color|, "color": |color|})`
[ERROR] (line 12 from line 15 from line 22) Error: Evaluation failed: The following errors happened (for selector `header`): [No attribute named `color`]: for command `assert-attribute: ("header", {"color": "blue"})`
[ERROR] (line 16 from line 22) The following errors happened (for selector `header`): [expected `red` for key `color`, found `red`]: for command `assert-css: ("header", {"color": "red"})`
[ERROR] (line 27 from line 32) The following errors happened (for selector `header`): [expected `a` for key `background-color`, found `rgb(17, 17, 17)`]: for command `assert-css: ("header", {"background-color": |background_color|})`
[ERROR] line 34: Missing argument "whole_check"

<= doc-ui tests done: 0 succeeded, 1 failed

0 comments on commit aa9a227

Please sign in to comment.