From b65ebda7eb703fcf01594e7ec87819e63089a9eb Mon Sep 17 00:00:00 2001 From: Ivan Kalinin Date: Mon, 22 Aug 2022 15:58:58 +0300 Subject: [PATCH] [docs] Document browser console steps --- .../modules/plugins/pages/plugin-web-app.adoc | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docs/modules/plugins/pages/plugin-web-app.adoc b/docs/modules/plugins/pages/plugin-web-app.adoc index c833e1b3bb..6a635b3b3d 100644 --- a/docs/modules/plugins/pages/plugin-web-app.adoc +++ b/docs/modules/plugins/pages/plugin-web-app.adoc @@ -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.*' +----