Skip to content

Commit 0abd303

Browse files
author
Andrea Briganti
committed
update documentation
Signed-off-by: Andrea Briganti <[email protected]>
1 parent 28b9029 commit 0abd303

File tree

2 files changed

+34
-15
lines changed

2 files changed

+34
-15
lines changed

README.MD

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,20 @@ node ./node_modules/selenium-cucumber-js/index.js -s ./step-definitions
4141
### Options
4242

4343
```bash
44-
-h, --help output usage information
45-
-V, --version output the version number
46-
-s, --steps <path> path to step definitions. defaults to ./step-definitions
47-
-p, --pageObjects <path> path to page objects. defaults to ./page-objects
48-
-o, --sharedObjects [paths] path to shared objects (repeatable). defaults to ./shared-objects
49-
-b, --browser <path> name of browser to use. defaults to chrome
50-
-r, --reports <path> output path to save reports. defaults to ./reports
51-
-d, --disableLaunchReport disable the auto opening the browser with test report
52-
-j, --junit <path> output path to save junit-report.xml defaults to ./reports
53-
-t, --tags <tagName> name of tag to run
54-
-f, --featureFile <path> a specific feature file to run
55-
-x, --timeOut <n> steps definition timeout in milliseconds. defaults to 10 seconds
56-
-n, --noScreenshot disable auto capturing of screenshots when an error is encountered
44+
-h, --help output usage information
45+
-V, --version output the version number
46+
-s, --steps <path> path to step definitions. defaults to ./step-definitions
47+
-p, --pageObjects <path> path to page objects. defaults to ./page-objects
48+
-o, --sharedObjects [paths] path to shared objects (repeatable). defaults to ./shared-objects
49+
-b, --browser <path> name of browser to use. defaults to chrome
50+
-k, --browser-teardown <optional> browser teardown strategy after every scenario (always, clear, none). defaults to "always"
51+
-r, --reports <path> output path to save reports. defaults to ./reports
52+
-d, --disableLaunchReport disable the auto opening the browser with test report
53+
-j, --junit <path> output path to save junit-report.xml defaults to ./reports
54+
-t, --tags <tagName> name of tag to run
55+
-f, --featureFile <path> a specific feature file to run
56+
-x, --timeOut <n> steps definition timeout in milliseconds. defaults to 10 seconds
57+
-n, --noScreenshot disable auto capturing of screenshots when an error is encountered
5758
```
5859

5960
By default tests are run using Google Chrome, to run tests using another browser supply the name of that browser along with the `-b` switch. Available options are:
@@ -112,7 +113,16 @@ Feature: Searching for vote cards app
112113
Then I should see some results
113114
```
114115

115-
The browser automatically closes after each scenario to ensure the next scenario uses a fresh browser environment.
116+
### Browser teardown strategy
117+
118+
The browser automatically closes after each scenario to ensure the next scenario uses a fresh browser environment. But
119+
you can change this behavior with the "-k" or the "--browser-teardown" parameter.
120+
121+
Value | Description
122+
---------- | ---------------
123+
`always` | the browser automatically closes (default)
124+
`clear` | the browser automatically clears cookies, local and session storages
125+
`none` | the browser does nothing
116126

117127
### Step definitions
118128

@@ -270,6 +280,15 @@ helpers.getPseudoElementBeforeValue('body header');
270280

271281
// get the content value of a :after pseudo element
272282
helpers.getPseudoElementAfterValue('body header');
283+
284+
// clear the cookies
285+
helpers.clearCookies();
286+
287+
// clear both local and session storages
288+
helpers.clearStorages();
289+
290+
// clear both cookies and storages
291+
helpers.clearCookiesAndStorages('body header');
273292
```
274293

275294
### Visual Comparison

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ program
4545
.option('-p, --pageObjects <path>', 'path to page objects. defaults to ' + config.pageObjects, config.pageObjects)
4646
.option('-o, --sharedObjects [paths]', 'path to shared objects (repeatable). defaults to ' + config.sharedObjects, collectPaths, [config.sharedObjects])
4747
.option('-b, --browser <path>', 'name of browser to use. defaults to ' + config.browser, config.browser)
48-
.option('-k, --browser-teardown <optional>', 'browser teardown strategy after every scenario (always, clear, none). defaults to "none"', config.browserTeardownStrategy)
48+
.option('-k, --browser-teardown <optional>', 'browser teardown strategy after every scenario (always, clear, none). defaults to "always"', config.browserTeardownStrategy)
4949
.option('-r, --reports <path>', 'output path to save reports. defaults to ' + config.reports, config.reports)
5050
.option('-d, --disableLaunchReport [optional]', 'Disables the auto opening the browser with test report')
5151
.option('-j, --junit <path>', 'output path to save junit-report.xml defaults to ' + config.reports)

0 commit comments

Comments
 (0)