Skip to content

Commit

Permalink
[docs] Document browser console steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalinin1 committed Aug 23, 2022
1 parent 4ead235 commit b65ebda
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions docs/modules/plugins/pages/plugin-web-app.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1117,3 +1117,62 @@ xhr.onreadystatechange = function() {
xhr.send();` and save result to scenario variable `response`
Then `${response}` matcher `.+`
----

=== Browser logs steps

This set of steps allows you to validate the https://developer.mozilla.org/en-US/docs/Web/API/console[browser's console logging messages].

:log-levels: List of the comma-separated mesagges' levels. The supported levels are: ERRORS, WARNINGS.

==== Validate log entries absence

Step validates the absence of log entries of desired level in the browser's console.

[source,gherkin]
----
Then there are no browser console $logLevels
----
* `$logLevels` - {log-levels}

.Validate absence of JS errors
[source,gherkin]
----
Given I am on a page with the URL 'https://vividus-test-site.herokuapp.com/'
Then there are no browser console ERRORS
----

==== Validate specific log entries absence

Step validates absence of specific log entries of desired level in the browser's console.

[source,gherkin]
----
Then there are no browser console $logLevels by regex '$pattern'
----
* `$logLevels` - {log-levels}
* `$pattern` - The pattern to match log entry message.

.Validate absence of JS error referencing user
[source,gherkin]
----
Given I am on a page with the URL 'https://vividus-test-site.herokuapp.com/'
Then there are no browser console ERRORS by regex '.*user.*'
----

==== Validate specific log entries presence

Step validates the presence of specific log entries of desired level in the browser's console.

[source,gherkin]
----
Then there are browser console $logLevels by regex '$pattern'
----
* `$logLevels` - {log-levels}
* `$pattern` - The pattern to match log entry message.

.Validate presence of JS errors referencing user
[source,gherkin]
----
Given I am on a page with the URL 'https://vividus-test-site.herokuapp.com/'
Then there are browser console ERRORS by regex '.*user.*'
----

0 comments on commit b65ebda

Please sign in to comment.