Skip to content

Commit 644b957

Browse files
Drew DiamantoukosDavertMik
Drew Diamantoukos
authored andcommitted
Documentation (#638)
* 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
1 parent f527ddd commit 644b957

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+279
-243
lines changed

.markdownlint.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"MD007": {
3+
"indent": 4
4+
},
5+
"MD013": false,
6+
"MD026": {
7+
"punctuation": ".,;:!"
8+
},
9+
"MD029": {
10+
"style": "ordered"
11+
},
12+
"MD030": {
13+
"ul_multi": 1,
14+
"ul_single": 1,
15+
"ol_single": 2,
16+
"ol_multi": 2
17+
},
18+
"MD036": false
19+
}

CODE_OF_CONDUCT.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ Examples of unacceptable behavior by participants include:
1818

1919
* The use of sexualized language or imagery and unwelcome sexual attention or advances
2020
* Trolling, insulting/derogatory comments, and personal or political attacks
21-
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
21+
* Public or private harassment Publishing others' private information, such as a physical or electronic address, without explicit permission
2322
* Other conduct which could reasonably be considered inappropriate in a professional setting
2423

2524
## Our Responsibilities

CONTRIBUTING.md

+22-20
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Thanks for getting here. If you have a good will to improve CodeceptJS we are al
44

55
To start you need:
66

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
1313

1414
Depending on a type of a change you should do the following.
1515

@@ -21,34 +21,37 @@ Please keep in mind that CodeceptJS have **unified API** for WebDriverIO, Appium
2121

2222
*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! *
2323

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:
2525

2626
* selenium server + chromedriver
2727
* PHP installed
2828

2929
To launch PHP demo application run:
3030

31-
```
31+
```sh
3232
php -S 127.0.0.1:8000 -t test/data/app
3333
```
3434

3535
Execute test suite:
3636

37-
```
37+
```sh
3838
mocha test/helper/WebDriverIO_test.js
3939
mocha test/helper/SeleniumWebdriver_test.js
4040
```
41+
4142
Use `--grep` to execute tests only for changed parts.
4243

4344
If you need to add new HTML page for a test, please create new `.php` file in to `tests/data/app/view/form`:
4445

4546
Adding `myexample` page:
47+
48+
```sh
49+
tests/data/app/view/form/myexample.php
4650
```
47-
tests/data/app/view/form/myexample.php
48-
```
51+
4952
Then is should be accessible at:
5053

51-
```
54+
```sh
5255
http://localhost:8000/form/myexample
5356
```
5457

@@ -58,7 +61,7 @@ http://localhost:8000/form/myexample
5861

5962
Protractor Helper extends SeleniumWebdriver. For non-protractor specific changes you will need to update SeleniumWebdriver helper instead. See section above.
6063

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:
6265

6366
* selenium server + chromedriver
6467

@@ -68,11 +71,11 @@ Demo application is located at: [http://davertmik.github.io/angular-demo-app](ht
6871

6972
*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required!*
7073

71-
Adding a test is highly appreciated.
74+
Adding a test is highly appreciated.
7275

7376
Start JSON server to run tests:
7477

75-
```
78+
```sh
7679
npm run json-server
7780
```
7881

@@ -82,26 +85,25 @@ Edit a test at `tests/helper/REST_test.js` or `test/helper/ApiDataFactory_test.j
8285

8386
*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! *
8487

85-
It is recommened to run mobile tests on CI.
88+
It is recommended to run mobile tests on CI.
8689
So do the changes, make pull request, see the CI status.
8790
Appium tests are executed at **Semaphore CI**.
8891

89-
9092
## Core Changes
9193

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.
9395

9496
Whenever you implemented a feature/bugfix
9597

9698
Run unit tests:
9799

98-
```
100+
```sh
99101
mocha test/unit
100102
```
101103

102104
Run general tests:
103105

104-
```
106+
```sh
105107
mocha test/runner
106108
```
107109

ISSUE_TEMPLATE.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
```bash
88
# paste output here
99
```
10+
1011
> Provide test source code if related
1112
1213
```php
1314
// paste test
1415
```
16+
1517
### Details
1618

17-
* CodeceptJS version:
19+
* CodeceptJS version:
1820
* NodeJS Version:
1921
* Operating System:
2022
* Protractor || WebDriverIO || Nightmare version (if related)

README.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ Codeception tests are:
2626
Codeception uses **Helper** modules to provide actions to `I` object. Currently CodeceptJS has these helpers:
2727

2828
* [**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
3030
* [**Nightmare**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/Nightmare.md) - helper which for testing web applications indi Electron using NightmareJS.
3131
* [**Appium**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/Appium.md)
3232
* [**SeleniumWebdriver**](https://github.com/Codeception/CodeceptJS/blob/master/docs/helpers/SeleniumWebdriver.md) - helper which for selenium testing using official Selenium Webdriver JS bindings.
33+
3334
And more to come...
3435

3536
## Why CodeceptJS?
@@ -50,16 +51,15 @@ as CodeceptJS unifies them and makes them work as they were synchronous.
5051
* Interactive debugging shell: pause test at any point and try different commands in a browser.
5152
* Easily create tests, pageobjects, stepobjects with CLI generators.
5253

53-
5454
## Install
5555

5656
```sh
57-
$ npm install -g codeceptjs
57+
npm install -g codeceptjs
5858
```
5959

6060
Move to directory where you'd like to have your tests (and codeceptjs config) stored, and run
6161

62-
```
62+
```sh
6363
codeceptjs init
6464
```
6565

@@ -68,19 +68,19 @@ if you need to write Selenium WebDriver tests.
6868

6969
After that create your first test by executing:
7070

71-
```
71+
```sh
7272
codeceptjs generate:test
7373
```
7474

7575
Now test is created and can be executed with
7676

77-
```
77+
```sh
7878
codeceptjs run
7979
```
8080

8181
If you want to write your tests using TypeScript just generate standard Type Definitions by executing:
8282

83-
```
83+
```sh
8484
codeceptjs def .
8585
```
8686

@@ -95,7 +95,8 @@ Learn CodeceptJS by examples. Let's assume we have CodeceptJS installed and WebD
9595
### Basics
9696

9797
Let's see how we can handle basic form testing:
98-
```js
98+
99+
```sh
99100
Feature('CodeceptJS Demonstration');
100101

101102
Scenario('test some forms', (I) => {
@@ -115,13 +116,13 @@ In this examples all methods of `I` are taken from WebDriverIO helper, see [refe
115116

116117
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.
117118

118-
```
119+
```sh
119120
codeceptjs run --steps
120121
```
121122

122123
This will produce an output:
123124

124-
```
125+
```sh
125126
CodeceptJS Demonstration --
126127
test some forms
127128
• 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.
141142

142143
Interactive shell can be started outside test context by running:
143144

144-
```
145+
```sh
145146
codeceptjs shell
146147
```
147148

@@ -220,7 +221,7 @@ Scenario('test title', (I) => {
220221
CodeceptJS provides the most simple way to create and use page objects in your test.
221222
You can create one by running
222223

223-
```
224+
```sh
224225
codeceptjs generate pageobject
225226
```
226227

@@ -268,12 +269,10 @@ Scenario('test some forms', (I, docsPage) => {
268269
});
269270
```
270271

271-
272272
## License
273273

274274
MIT © [DavertMik](http://codegyre.com)
275275

276-
277276
[npm-image]: https://badge.fury.io/js/codeceptjs.svg
278277
[npm-url]: https://npmjs.org/package/codeceptjs
279278
[travis-image]: https://travis-ci.org/Codeception/codeceptjs.svg?branch=master

bin/codecept.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ program.command('init [path]')
1515

1616
program.command('shell [path]')
1717
.alias('sh')
18-
.description('Interative shell')
18+
.description('Interactive shell')
1919
.option('--verbose', 'output internal logging information')
2020
.option('--profile [value]', 'configuration profile to be used')
2121
.action(require('../lib/command/interactive'));

docker/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ Sample mount: `-v path/to/codecept.json:/tests`
1111

1212
### Locally
1313

14-
1514
You can execute CodeceptJS with Nightmare locally with no extra configuration.
1615

17-
```
16+
```sh
1817
docker run --net=host -v $PWD:/tests codeception/codeceptjs
1918
```
2019

@@ -77,5 +76,5 @@ _Note: If running with the Nightmare driver, it is not necessary to run a seleni
7776
To build this image:
7877

7978
```sh
80-
$ docker build -t codeception/codeceptjs .
79+
docker build -t codeception/codeceptjs .
8180
```

docs/acceptance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ In case of CodeceptJS you can be sure that in code it will be as easy as it soun
1313
Within web page you can locate elements, interact with them, and check that expected elements are present on a page. That is what a test look like.
1414
That is what a test look like.
1515

16-
1716
```js
1817
I.amOnPage('/login');
1918
I.fillField('Username', 'john');
@@ -200,6 +199,7 @@ I.waitForElement('#agree_button', 30); // secs
200199
// clicks a button only when it is visible
201200
I.click('#agree_button');
202201
```
202+
203203
More wait actions can be found in helper's reference.
204204

205205
## SmartWait

docs/advanced.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Data(accounts).Scenario('Test Login', (I, current) => {
2929
This will produce 2 tests with different data sets.
3030
Current data set is appended to a test name in output:
3131

32-
```
32+
```sh
3333
✓ Test Login | {"login":"davert","password":"123456"}
3434
✓ Test Login | {"login":"admin","password":"123456"}
3535
```
@@ -54,7 +54,7 @@ all tests with `@tag` could be executed with `--grep @tag` option.
5454
Scenario('update user profile @slow')
5555
```
5656

57-
```
57+
```sh
5858
codeceptjs run --grep @slow
5959
```
6060

@@ -70,23 +70,22 @@ Use regex for more flexible filtering:
7070
CodeceptJS provides a debug mode in which additional information is printed.
7171
It can be turned on with `--debug` flag.
7272

73-
```
73+
```sh
7474
codeceptjs run --debug
7575
```
7676

7777
While running in debug mode you can pause execution and enter interactive console mode by using `pause()` function.
7878

7979
For advanced debugging use NodeJS debugger. In WebStorm IDE:
8080

81-
```
81+
```sh
8282
node $NODE_DEBUG_OPTION ./node_modules/.bin/codeceptjs run
8383
```
8484

8585
## Multiple Execution
8686

8787
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:
8888

89-
9089
```js
9190
"multiple": {
9291
"basic": {

0 commit comments

Comments
 (0)