Skip to content

Commit 4dc0f47

Browse files
author
John Doherty
committed
added table of contents
1 parent 6227730 commit 4dc0f47

File tree

1 file changed

+42
-25
lines changed

1 file changed

+42
-25
lines changed

README.MD

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44

55
JavaScript browser automation framework using official [selenium-webdriver](http://seleniumhq.github.io/selenium/docs/api/javascript/ "view webdriver js documentation") and [cucumber-js](https://github.com/cucumber/cucumber-js "view cucumber js documentation").
66

7+
**Table of Contents**
8+
9+
* [Installation](#installation)
10+
* [Usage](#usage)
11+
* [Options](#options)
12+
* [Feature files](#feature-files)
13+
* [Step definitions](#step-definitions)
14+
* [Page objects](#page-objects)
15+
* [Shared objects](#shared-objects)
16+
* [Reports](#reports)
17+
* [Event handlers](#event-handlers)
18+
* [How to debug](#how-to-debug)
19+
* [Default directory structure](#default-directory-structure)
20+
* [Demo](#demo)
21+
* [Bugs](#bugs)
22+
* [Contributing](#contributing)
23+
* [Troubleshooting](#troubleshooting)
24+
* [IntelliJ Cucumber Plugin](#intellij-cucumber-plugin)
25+
726
## Installation
827

928
```bash
@@ -35,11 +54,11 @@ node ./node_modules/selenium-cucumber-js/index.js -s ./step-definitions
3554

3655
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:
3756

38-
| Browser | Example |
39-
| :--- | :--- |
40-
| Chrome | `-b chrome` |
41-
| Firefox | `-b firefox` |
42-
| Phantom JS | `-b phantomjs` |
57+
| Browser | Example
58+
| ---------- | ---------------
59+
| Chrome | `-b chrome`
60+
| Firefox | `-b firefox`
61+
| Phantom JS | `-b phantomjs`
4362

4463
### Feature files
4564

@@ -90,20 +109,18 @@ module.exports = function () {
90109

91110
The following variables are available within the ```Given()```, ```When()``` and ```Then()``` functions:
92111

93-
| Variable | Description |
94-
| :--- | :--- |
95-
| `driver` | an instance of [selenium web driver](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebDriver.html) (_the browser_) |
96-
| `selenium` | the raw [selenium-webdriver](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/) module, providing access to static properties/methods |
97-
| `page` | collection of **page** objects loaded from disk and keyed by filename |
98-
| `shared` | collection of **shared** objects loaded from disk and keyed by filename |
99-
| `helpers` | a collection of [helper methods](runtime/helpers.js) _things selenium does not provide but really should!_ |
100-
| `by` | the selenium [By](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_By.html) class used to locate elements on the page |
101-
| `until` | the selenium [until](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/until.html) class used to wait for elements/events |
102-
| `expect` | instance of [chai expect](http://chaijs.com/api/bdd/) to ```expect('something').to.equal('something')``` |
103-
| `assert` | instance of [chai assert](http://chaijs.com/api/assert/) to ```assert.isOk('everything', 'everything is ok')``` |
104-
| `trace` | handy trace method to log console output with increased visibility |
105-
106-
112+
| Variable | Description |
113+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
114+
| `driver` | an instance of [selenium web driver](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebDriver.html) (_the browser_)
115+
| `selenium` | the raw [selenium-webdriver](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/) module, providing access to static properties/methods
116+
| `page` | collection of **page** objects loaded from disk and keyed by filename
117+
| `shared` | collection of **shared** objects loaded from disk and keyed by filename
118+
| `helpers` | a collection of [helper methods](runtime/helpers.js) _things selenium does not provide but really should!_
119+
| `by` | the selenium [By](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_By.html) class used to locate elements on the page
120+
| `until` | the selenium [until](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/until.html) class used to wait for elements/events
121+
| `expect` | instance of [chai expect](http://chaijs.com/api/bdd/) to ```expect('something').to.equal('something')```
122+
| `assert` | instance of [chai assert](http://chaijs.com/api/assert/) to ```assert.isOk('everything', 'everything is ok')```
123+
| `trace` | handy trace method to log console output with increased visibility
107124

108125
### Page objects
109126

@@ -194,12 +211,12 @@ HTML and JSON reports are automatically generated and stored in the default `./r
194211

195212
You can register event handlers for the following events within the cucumber life cycle.
196213

197-
| Event | Example |
198-
|----------------|-------------------------------------------------------------|
199-
| BeforeFeature | ```this.BeforeFeatures(function(feature, callback) {}) ``` |
200-
| BeforeScenario | ```this.BeforeScenario(function(scenario, callback) {});``` |
201-
| AfterScenario | ```this.AfterScenario(function(scenario, callback) {});``` |
202-
| AfterFeature | ```this.AfterFeature(function(feature, callback) {});``` |
214+
| Event | Example
215+
| -------------- | ------------------------------------------------------------
216+
| BeforeFeature | ```this.BeforeFeatures(function(feature, callback) {}) ```
217+
| BeforeScenario | ```this.BeforeScenario(function(scenario, callback) {});```
218+
| AfterScenario | ```this.AfterScenario(function(scenario, callback) {});```
219+
| AfterFeature | ```this.AfterFeature(function(feature, callback) {});```
203220

204221
## How to debug
205222

0 commit comments

Comments
 (0)