You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Marking script blocks, fixing spelling errors, adding cSpell.json for VSCode users for common words
* Added a markdown-lint configuration file to encapsulate what previous authors were following
* Responding to code review comments and reverting unordered list spacing
* Touched up spacing
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+22-20
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ Thanks for getting here. If you have a good will to improve CodeceptJS we are al
4
4
5
5
To start you need:
6
6
7
-
1. Fork the repo.
8
-
2. Run `npm install` to install all required libraries
9
-
3. Do the changes.
10
-
4. Add/Update Test (if possible)
11
-
5. Commit and Push to your fork
12
-
6. Make Pull Request
7
+
1.Fork the repo.
8
+
2.Run `npm install` to install all required libraries
9
+
3.Do the changes.
10
+
4.Add/Update Test (if possible)
11
+
5.Commit and Push to your fork
12
+
6.Make Pull Request
13
13
14
14
Depending on a type of a change you should do the following.
15
15
@@ -21,34 +21,37 @@ Please keep in mind that CodeceptJS have **unified API** for WebDriverIO, Appium
21
21
22
22
*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required! Do **not edit**`docs/helpers/`, those files are generated from docblocks in corresponding helpers! *
23
23
24
-
Working test is highly appreciated. To run the test suite you need:
24
+
Working test is highly appreciated. To run the test suite you need:
25
25
26
26
* selenium server + chromedriver
27
27
* PHP installed
28
28
29
29
To launch PHP demo application run:
30
30
31
-
```
31
+
```sh
32
32
php -S 127.0.0.1:8000 -t test/data/app
33
33
```
34
34
35
35
Execute test suite:
36
36
37
-
```
37
+
```sh
38
38
mocha test/helper/WebDriverIO_test.js
39
39
mocha test/helper/SeleniumWebdriver_test.js
40
40
```
41
+
41
42
Use `--grep` to execute tests only for changed parts.
42
43
43
44
If you need to add new HTML page for a test, please create new `.php` file in to `tests/data/app/view/form`:
Protractor Helper extends SeleniumWebdriver. For non-protractor specific changes you will need to update SeleniumWebdriver helper instead. See section above.
60
63
61
-
In case you do Protractor-specific change, please add a test:To run the test suite you need:
64
+
In case you do Protractor-specific change, please add a test:To run the test suite you need:
62
65
63
66
* selenium server + chromedriver
64
67
@@ -68,11 +71,11 @@ Demo application is located at: [http://davertmik.github.io/angular-demo-app](ht
68
71
69
72
*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required!*
70
73
71
-
Adding a test is highly appreciated.
74
+
Adding a test is highly appreciated.
72
75
73
76
Start JSON server to run tests:
74
77
75
-
```
78
+
```sh
76
79
npm run json-server
77
80
```
78
81
@@ -82,26 +85,25 @@ Edit a test at `tests/helper/REST_test.js` or `test/helper/ApiDataFactory_test.j
82
85
83
86
*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required! Do **not edit**`docs/helpers/`, those files are generated from docblocks in corresponding helpers! *
84
87
85
-
It is recommened to run mobile tests on CI.
88
+
It is recommended to run mobile tests on CI.
86
89
So do the changes, make pull request, see the CI status.
87
90
Appium tests are executed at **Semaphore CI**.
88
91
89
-
90
92
## Core Changes
91
93
92
-
Before applying any Core changes please raise an issue to disucss that change with core team.
94
+
Before applying any Core changes please raise an issue to discuss that change with core team.
Copy file name to clipboardExpand all lines: README.md
+13-14
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,11 @@ Codeception tests are:
26
26
Codeception uses **Helper** modules to provide actions to `I` object. Currently CodeceptJS has these helpers:
27
27
28
28
*[**WebDriverIO**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/WebDriverIO.md) - wrapper on top of Selenium bindings library [WebDriverIO](http://webdriver.io/)
29
-
*[**Protractor**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/Protractor.md) - helper enpowered by [Protractor](http://protractortest.org/) framework for AngularJS testing
29
+
*[**Protractor**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/Protractor.md) - helper empowered by [Protractor](http://protractortest.org/) framework for AngularJS testing
30
30
*[**Nightmare**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/Nightmare.md) - helper which for testing web applications indi Electron using NightmareJS.
*[**SeleniumWebdriver**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/SeleniumWebdriver.md) - helper which for selenium testing using official Selenium Webdriver JS bindings.
33
+
33
34
And more to come...
34
35
35
36
## Why CodeceptJS?
@@ -50,16 +51,15 @@ as CodeceptJS unifies them and makes them work as they were synchronous.
50
51
* Interactive debugging shell: pause test at any point and try different commands in a browser.
51
52
* Easily create tests, pageobjects, stepobjects with CLI generators.
52
53
53
-
54
54
## Install
55
55
56
56
```sh
57
-
$ npm install -g codeceptjs
57
+
npm install -g codeceptjs
58
58
```
59
59
60
60
Move to directory where you'd like to have your tests (and codeceptjs config) stored, and run
61
61
62
-
```
62
+
```sh
63
63
codeceptjs init
64
64
```
65
65
@@ -68,19 +68,19 @@ if you need to write Selenium WebDriver tests.
68
68
69
69
After that create your first test by executing:
70
70
71
-
```
71
+
```sh
72
72
codeceptjs generate:test
73
73
```
74
74
75
75
Now test is created and can be executed with
76
76
77
-
```
77
+
```sh
78
78
codeceptjs run
79
79
```
80
80
81
81
If you want to write your tests using TypeScript just generate standard Type Definitions by executing:
82
82
83
-
```
83
+
```sh
84
84
codeceptjs def .
85
85
```
86
86
@@ -95,7 +95,8 @@ Learn CodeceptJS by examples. Let's assume we have CodeceptJS installed and WebD
95
95
### Basics
96
96
97
97
Let's see how we can handle basic form testing:
98
-
```js
98
+
99
+
```sh
99
100
Feature('CodeceptJS Demonstration');
100
101
101
102
Scenario('test some forms', (I) => {
@@ -115,13 +116,13 @@ In this examples all methods of `I` are taken from WebDriverIO helper, see [refe
115
116
116
117
Let's execute this test with `run` command. Additional option `--steps` will show us the running process. We recommend use `--steps` or `--debug` during development.
117
118
118
-
```
119
+
```sh
119
120
codeceptjs run --steps
120
121
```
121
122
122
123
This will produce an output:
123
124
124
-
```
125
+
```sh
125
126
CodeceptJS Demonstration --
126
127
test some forms
127
128
• I am on page "http://simple-form-bootstrap.plataformatec.com.br/documentation"
@@ -141,7 +142,7 @@ Just add `pause()` call at any place in a test and run it.
141
142
142
143
Interactive shell can be started outside test context by running:
This will produce 2 tests with different data sets.
30
30
Current data set is appended to a test name in output:
31
31
32
-
```
32
+
```sh
33
33
✓ Test Login | {"login":"davert","password":"123456"}
34
34
✓ Test Login | {"login":"admin","password":"123456"}
35
35
```
@@ -54,7 +54,7 @@ all tests with `@tag` could be executed with `--grep @tag` option.
54
54
Scenario('update user profile @slow')
55
55
```
56
56
57
-
```
57
+
```sh
58
58
codeceptjs run --grep @slow
59
59
```
60
60
@@ -70,23 +70,22 @@ Use regex for more flexible filtering:
70
70
CodeceptJS provides a debug mode in which additional information is printed.
71
71
It can be turned on with `--debug` flag.
72
72
73
-
```
73
+
```sh
74
74
codeceptjs run --debug
75
75
```
76
76
77
77
While running in debug mode you can pause execution and enter interactive console mode by using `pause()` function.
78
78
79
79
For advanced debugging use NodeJS debugger. In WebStorm IDE:
80
80
81
-
```
81
+
```sh
82
82
node $NODE_DEBUG_OPTION ./node_modules/.bin/codeceptjs run
83
83
```
84
84
85
85
## Multiple Execution
86
86
87
87
CodeceptJS can execute multiple suites in parallel. This is useful if you want to execute same tests but on different browsers and with different configurations. Before using this feature you need to add `multiple` option to the config:
0 commit comments