codeceptjs 2.3.4 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/README.md +28 -6
- package/bin/codecept.js +42 -0
- package/docs/advanced.md +45 -1
- package/docs/angular.md +3 -3
- package/docs/basics.md +162 -118
- package/docs/bdd.md +30 -5
- package/docs/best.md +8 -6
- package/docs/books.md +6 -1
- package/docs/build/Appium.js +95 -85
- package/docs/build/FileSystem.js +48 -3
- package/docs/build/GraphQL.js +3 -2
- package/docs/build/GraphQLDataFactory.js +1 -0
- package/docs/build/Mochawesome.js +3 -2
- package/docs/build/MockRequest.js +23 -5
- package/docs/build/Nightmare.js +87 -128
- package/docs/build/Protractor.js +107 -155
- package/docs/build/Puppeteer.js +190 -174
- package/docs/build/REST.js +13 -9
- package/docs/build/SeleniumWebdriver.js +0 -17
- package/docs/build/TestCafe.js +164 -158
- package/docs/build/WebDriver.js +236 -211
- package/docs/build/WebDriverIO.js +218 -187
- package/docs/changelog.md +57 -1
- package/docs/commands.md +41 -2
- package/docs/community-helpers.md +12 -1
- package/docs/configuration.md +5 -2
- package/docs/continuous-integration.md +22 -0
- package/docs/{helpers.md → custom-helpers.md} +16 -10
- package/docs/data.md +7 -6
- package/docs/detox.md +6 -6
- package/docs/email.md +4 -2
- package/docs/examples.md +22 -3
- package/docs/helpers/ApiDataFactory.md +15 -13
- package/docs/helpers/Appium.md +1011 -468
- package/docs/helpers/Detox.md +33 -26
- package/docs/helpers/FileSystem.md +43 -13
- package/docs/helpers/GraphQL.md +17 -15
- package/docs/helpers/GraphQLDataFactory.md +15 -13
- package/docs/helpers/Mochawesome.md +3 -1
- package/docs/helpers/MockRequest.md +37 -19
- package/docs/helpers/Nightmare.md +129 -240
- package/docs/helpers/Polly.md +1 -1
- package/docs/helpers/Protractor.md +157 -298
- package/docs/helpers/Puppeteer.md +216 -335
- package/docs/helpers/REST.md +29 -24
- package/docs/helpers/TestCafe.md +137 -235
- package/docs/helpers/WebDriver.md +250 -347
- package/docs/hooks.md +14 -10
- package/docs/index.md +112 -0
- package/docs/installation.md +3 -1
- package/docs/locators.md +19 -8
- package/docs/mobile-react-native-locators.md +2 -2
- package/docs/mobile.md +5 -3
- package/docs/nightmare.md +2 -1
- package/docs/pageobjects.md +4 -2
- package/docs/parallel.md +4 -2
- package/docs/plugins.md +41 -15
- package/docs/puppeteer.md +8 -6
- package/docs/quickstart.md +130 -0
- package/docs/react.md +4 -2
- package/docs/reports.md +6 -4
- package/docs/testcafe.md +10 -8
- package/docs/translation.md +4 -2
- package/docs/ui.md +56 -0
- package/docs/videos.md +11 -2
- package/docs/visual.md +7 -5
- package/docs/vue.md +121 -0
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/checkOption.mustache +2 -2
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/click.mustache +2 -2
- package/docs/webapi/clickLink.mustache +2 -2
- package/docs/webapi/dontSee.mustache +1 -2
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +2 -2
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +2 -1
- package/docs/webapi/executeScript.mustache +2 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/grabAttributeFrom.mustache +1 -1
- package/docs/webapi/grabBrowserLogs.mustache +1 -1
- package/docs/webapi/grabCookie.mustache +2 -2
- package/docs/webapi/grabCssPropertyFrom.mustache +1 -1
- package/docs/webapi/grabHTMLFrom.mustache +1 -1
- package/docs/webapi/grabNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/grabPageScrollPosition.mustache +1 -1
- package/docs/webapi/grabTextFrom.mustache +2 -2
- package/docs/webapi/grabValueFrom.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +3 -3
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/rightClick.mustache +2 -2
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +10 -0
- package/docs/webapi/scrollTo.mustache +3 -3
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +8 -0
- package/docs/webapi/selectOption.mustache +2 -2
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +2 -2
- package/docs/webapi/waitForClickable.mustache +10 -0
- package/docs/webapi/waitForDetached.mustache +2 -2
- package/docs/webapi/waitForElement.mustache +2 -2
- package/docs/webapi/waitForEnabled.mustache +2 -2
- package/docs/webapi/waitForFunction.mustache +2 -2
- package/docs/webapi/waitForInvisible.mustache +2 -2
- package/docs/webapi/waitForText.mustache +2 -2
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +2 -2
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -2
- package/docs/webapi/waitToHide.mustache +2 -2
- package/docs/webapi/waitUntil.mustache +3 -2
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/docs/webdriver.md +20 -18
- package/docs/wiki/.git/FETCH_HEAD +1 -0
- package/docs/wiki/.git/HEAD +1 -0
- package/docs/wiki/.git/ORIG_HEAD +1 -0
- package/docs/wiki/.git/config +11 -0
- package/docs/wiki/.git/description +1 -0
- package/docs/wiki/.git/hooks/applypatch-msg.sample +15 -0
- package/docs/wiki/.git/hooks/commit-msg.sample +24 -0
- package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +114 -0
- package/docs/wiki/.git/hooks/post-update.sample +8 -0
- package/docs/wiki/.git/hooks/pre-applypatch.sample +14 -0
- package/docs/wiki/.git/hooks/pre-commit.sample +49 -0
- package/docs/wiki/.git/hooks/pre-push.sample +53 -0
- package/docs/wiki/.git/hooks/pre-rebase.sample +169 -0
- package/docs/wiki/.git/hooks/pre-receive.sample +24 -0
- package/docs/wiki/.git/hooks/prepare-commit-msg.sample +42 -0
- package/docs/wiki/.git/hooks/update.sample +128 -0
- package/docs/wiki/.git/index +0 -0
- package/docs/wiki/.git/info/exclude +6 -0
- package/docs/wiki/.git/logs/HEAD +4 -0
- package/docs/wiki/.git/logs/refs/heads/master +4 -0
- package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/.git/logs/refs/remotes/origin/master +3 -0
- package/docs/wiki/.git/objects/00/d216b0774d15db2d0a2a0d4ce249b5251acc55 +3 -0
- package/docs/wiki/.git/objects/09/01d87c5241905fdfe3493cfe8f04df4a2685ea +0 -0
- package/docs/wiki/.git/objects/0d/bdd0c20c4deb6a8cc81dbbf32ecf8c09238983 +2 -0
- package/docs/wiki/.git/objects/1a/c29e4fa82422c52392f22f0f2b8d1a759535bf +0 -0
- package/docs/wiki/.git/objects/27/12f92898d3e8f68e229b6cda76570d6c66d781 +0 -0
- package/docs/wiki/.git/objects/2d/dbe22c257166b648928eeb9460ecfb71ba702d +0 -0
- package/docs/wiki/.git/objects/2f/c942ec3773efd2678d9ff98035c61fcded81a1 +0 -0
- package/docs/wiki/.git/objects/40/a2856342c67796b48911a256b764fb06888b94 +5 -0
- package/docs/wiki/.git/objects/47/53181844fc4dc563cf3aa5e80462243cb58d38 +0 -0
- package/docs/wiki/.git/objects/4e/24a95fb2e4f8ffef51f19b694451a205c06f10 +3 -0
- package/docs/wiki/.git/objects/73/31ebd96f3c7e08a9f63f05a25f939afa0d4de1 +0 -0
- package/docs/wiki/.git/objects/86/19cbb2289caa502e33fccf0ed14eecf6ba2ba0 +0 -0
- package/docs/wiki/.git/objects/a4/72f797d9d74b87c9f71a2b1539d75bb07d1e35 +0 -0
- package/docs/wiki/.git/objects/c9/9f3e4bd227d6b050b2e416f9876df49583dbf6 +0 -0
- package/docs/wiki/.git/objects/ca/e609b4ef3e0ef85fcbe0d68d1a58246584b915 +0 -0
- package/docs/wiki/.git/objects/d5/8386ca72f6d550548f3d71d74e3ac73d5ad488 +0 -0
- package/docs/wiki/.git/objects/d9/c6874a6de524bdafeb563a20d847f4fdd59a86 +0 -0
- package/docs/wiki/.git/objects/f1/c944675bb38b40ae553b0be36c14674c79af54 +0 -0
- package/docs/wiki/.git/objects/pack/pack-28da0fc7e6c08d4c5350717bfbb7b1c53e8198ad.idx +0 -0
- package/docs/wiki/.git/objects/pack/pack-28da0fc7e6c08d4c5350717bfbb7b1c53e8198ad.pack +0 -0
- package/docs/wiki/.git/packed-refs +2 -0
- package/docs/wiki/.git/refs/heads/master +1 -0
- package/docs/wiki/.git/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/.git/refs/remotes/origin/master +1 -0
- package/docs/wiki/Books-&-Posts.md +27 -0
- package/docs/wiki/Community-Helpers.md +41 -0
- package/docs/wiki/Examples.md +138 -0
- package/docs/wiki/Home.md +11 -0
- package/docs/wiki/Release-process.md +25 -0
- package/docs/wiki/Roadmap.md +23 -0
- package/docs/wiki/Videos.md +19 -0
- package/lib/actor.js +18 -1
- package/lib/assert/error.js +3 -3
- package/lib/codecept.js +9 -6
- package/lib/command/configMigrate.js +7 -6
- package/lib/command/definitions.js +98 -350
- package/lib/command/generate.js +22 -17
- package/lib/command/gherkin/init.js +2 -1
- package/lib/command/gherkin/snippets.js +6 -6
- package/lib/command/gherkin/steps.js +0 -1
- package/lib/command/info.js +40 -0
- package/lib/command/init.js +54 -41
- package/lib/command/run-multiple.js +5 -4
- package/lib/command/run-rerun.js +39 -0
- package/lib/command/run-workers.js +4 -6
- package/lib/command/run.js +8 -18
- package/lib/command/utils.js +23 -2
- package/lib/command/workers/runTests.js +1 -2
- package/lib/config.js +10 -4
- package/lib/container.js +31 -6
- package/lib/data/dataTableArgument.js +31 -0
- package/lib/data/table.js +4 -0
- package/lib/event.js +65 -1
- package/lib/helper/Appium.js +52 -38
- package/lib/helper/FileSystem.js +48 -3
- package/lib/helper/GraphQL.js +3 -2
- package/lib/helper/GraphQLDataFactory.js +1 -0
- package/lib/helper/Mochawesome.js +3 -2
- package/lib/helper/MockRequest.js +23 -5
- package/lib/helper/Nightmare.js +5 -6
- package/lib/helper/Protractor.js +7 -8
- package/lib/helper/Puppeteer.js +76 -20
- package/lib/helper/REST.js +13 -9
- package/lib/helper/SeleniumWebdriver.js +0 -17
- package/lib/helper/TestCafe.js +84 -36
- package/lib/helper/WebDriver.js +113 -59
- package/lib/helper/WebDriverIO.js +43 -59
- package/lib/helper/clientscripts/nightmare.js +66 -4
- package/lib/helper/scripts/isElementClickable.js +24 -0
- package/lib/helper.js +34 -10
- package/lib/history.js +1 -1
- package/lib/hooks.js +2 -1
- package/lib/index.js +19 -0
- package/lib/interfaces/bdd.js +4 -0
- package/lib/interfaces/featureConfig.js +10 -3
- package/lib/interfaces/gherkin.js +6 -2
- package/lib/interfaces/scenarioConfig.js +17 -6
- package/lib/listener/config.js +1 -1
- package/lib/listener/exit.js +6 -0
- package/lib/listener/steps.js +0 -1
- package/lib/listener/trace.js +0 -1
- package/lib/locator.js +67 -2
- package/lib/output.js +53 -0
- package/lib/parser.js +2 -71
- package/lib/pause.js +3 -2
- package/lib/plugin/allure.js +41 -22
- package/lib/plugin/autoLogin.js +4 -1
- package/lib/plugin/pauseOnFail.js +38 -0
- package/lib/plugin/puppeteerCoverage.js +8 -7
- package/lib/plugin/screenshotOnFail.js +13 -8
- package/lib/plugin/stepByStepReport.js +7 -6
- package/lib/plugin/wdio.js +2 -1
- package/lib/recorder.js +85 -7
- package/lib/rerun.js +81 -0
- package/lib/secret.js +6 -0
- package/lib/session.js +9 -2
- package/lib/step.js +37 -2
- package/lib/store.js +5 -1
- package/lib/ui.js +34 -8
- package/lib/utils.js +6 -13
- package/lib/within.js +5 -0
- package/package.json +49 -29
- package/typings/Mocha.d.ts +21 -0
- package/typings/Protractor.d.ts +16 -0
- package/typings/index.d.ts +169 -0
- package/typings/jsdoc.conf.js +34 -0
- package/typings/jsdoc.namespace.js +29 -0
- package/typings/types.d.ts +9827 -0
- package/typings/utils.d.ts +7 -0
- package/docs/acceptance.md +0 -409
- package/docs/api/codecept.md +0 -75
- package/docs/api/config.md +0 -49
- package/docs/api/container.md +0 -66
- package/docs/api/helper.md +0 -116
- package/docs/api/output.md +0 -67
- package/docs/api/recorder.md +0 -63
- package/docs/helpers/SeleniumWebdriver.md +0 -92
- package/docs/helpers/WebDriverIO.md +0 -1671
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
## 2.4.1
|
|
2
|
+
|
|
3
|
+
* [Hotfix] - Add missing lib that prevents codeceptjs from initializing.
|
|
4
|
+
|
|
5
|
+
## 2.4.0
|
|
6
|
+
|
|
7
|
+
* Improved setup wizard with `npx codecept init`:
|
|
8
|
+
* **enabled [retryFailedStep](/plugins/#retryfailedstep) plugin for new setups**.
|
|
9
|
+
* enabled [@codeceptjs/configure](/configuration/#common-configuration-patterns) to toggle headless/window mode via env variable
|
|
10
|
+
* creates a new test on init
|
|
11
|
+
* removed question on "steps file", create it by default.
|
|
12
|
+
* Added [pauseOnFail plugin](/plugins/#pauseonfail). *Sponsored by Paul Vincent Beigang and his book "[Practical End 2 End Testing with CodeceptJS](https://leanpub.com/codeceptjs/)"*.
|
|
13
|
+
* Added [`run-rerun` command](/commands/#run-rerun) to run tests multiple times to detect and fix flaky tests. By @Ilrilan and @Vorobeyko.
|
|
14
|
+
* Added [`Scenario.todo()` to declare tests as pending](/basics#todotest). See #2100 by @Vorobeyko
|
|
15
|
+
* Added support for absolute path for `output` dir. See #2049 by @elukoyanov
|
|
16
|
+
* Fixed error in `npx codecept init` caused by calling `console.print`. See #2071 by @Atinux.
|
|
17
|
+
* [Filesystem] Methods added by @aefluke:
|
|
18
|
+
* `seeFileNameMatching`
|
|
19
|
+
* `grabFileNames`
|
|
20
|
+
* [Puppeteer] Fixed grabbing attributes with hyphen by @Holorium
|
|
21
|
+
* [TestCafe] Fixed `grabAttributeFrom` method by @elukoyanov
|
|
22
|
+
* [MockRequest] Added support for [Polly config options](https://netflix.github.io/pollyjs/#/configuration?id=configuration) by @ecrmnn
|
|
23
|
+
* [TestCafe] Fixes exiting with zero code on failure. Fixed #2090 with #2106 by @koushikmohan1996
|
|
24
|
+
* [WebDriver][Puppeteer] Added basicAuth support via config. Example: `basicAuth: {username: 'username', password: 'password'}`. See #1962 by @PeterNgTr
|
|
25
|
+
* [WebDriver][Appium] Added `scrollIntoView` by @pablopaul
|
|
26
|
+
* Fixed #2118: No error stack trace for syntax error by @senthillkumar
|
|
27
|
+
* Added `parse()` method to data table inside Cucumber tests. Use it to obtain rows and hashes for test data. See #2082 by @Sraime
|
|
28
|
+
|
|
29
|
+
## 2.3.6
|
|
30
|
+
|
|
31
|
+
* Create better Typescript definition file through JSDoc. By @lemnis
|
|
32
|
+
* `run-workers` now can use glob pattern. By @Ilrilan
|
|
33
|
+
```js
|
|
34
|
+
// Example:
|
|
35
|
+
exports.config = {
|
|
36
|
+
tests: '{./workers/base_test.workers.js,./workers/test_grep.workers.js}',
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
* Added new command `npx codeceptjs info` which print information about your environment and CodeceptJS configs. By @jamesgeorge007
|
|
40
|
+
* Fixed some typos in documantation. By @pablopaul @atomicpages @EricTendian
|
|
41
|
+
* Added PULL_REQUEST template.
|
|
42
|
+
* [Puppeteer][WebDriver] Added `waitForClickable` for waiting clickable element on page.
|
|
43
|
+
* [TestCafe] Added support for remote connection. By @jvdieten
|
|
44
|
+
* [Puppeteer] Fixed `waitForText` XPath context now works correctly. By @Heavik
|
|
45
|
+
* [TestCafe] Fixed `clearField` clear field now awaits TestCafe's promise. By @orihomie
|
|
46
|
+
* [Puppeteer] Fixed fails when executing localStorage on services pages. See #2026
|
|
47
|
+
* Fixed empty tags in test name. See #2038
|
|
48
|
+
|
|
49
|
+
## 2.3.5
|
|
50
|
+
|
|
51
|
+
* Set "parse-function" dependency to "5.2.11" to avoid further installation errors.
|
|
52
|
+
|
|
1
53
|
## 2.3.4
|
|
2
54
|
|
|
3
55
|
* Fixed installation error "Cannot find module '@babel/runtime/helpers/interopRequireDefault'". The issue came from `parse-function` package. Fixed by @pablopaul.
|
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
[<img src="https://img.shields.io/badge/slack-@codeceptjs-purple.svg?logo=slack">](https://join.slack.com/t/codeceptjs/shared_invite/enQtMzA5OTM4NDM2MzA4LWE4MThhN2NmYTgxNTU5MTc4YzAyYWMwY2JkMmZlYWI5MWQ2MDM5MmRmYzZmYmNiNmY5NTAzM2EwMGIwOTNhOGQ) [<img src="https://img.shields.io/badge/discourse-codeceptjs-purple">](https://codecept.discourse.group) [![NPM version][npm-image]][npm-url] [](https://travis-ci.org/Codeception/CodeceptJS) [](https://www.codacy.com/app/DavertMik/CodeceptJS?utm_source=github.com&utm_medium=referral&utm_content=Codeception/CodeceptJS&utm_campaign=badger) [](https://houndci.com)
|
|
2
2
|
|
|
3
|
+
# CodeceptJS
|
|
3
4
|
|
|
4
5
|
Reference: [Helpers API](https://github.com/Codeception/CodeceptJS/blob/master/docs) | [Demo](https://github.com/Codeception/codeceptjs-demo)
|
|
5
6
|
|
|
6
|
-
## Supercharged
|
|
7
|
+
## Supercharged E2E Testing
|
|
7
8
|
|
|
8
9
|
CodeceptJS is a new testing framework for end-to-end testing with WebDriver (or others).
|
|
9
|
-
It abstracts browser interaction to simple steps
|
|
10
|
+
It abstracts browser interaction to simple steps that are written from a user perspective.
|
|
10
11
|
A simple test that verifies the "Welcome" text is present on a main page of a site will look like:
|
|
11
12
|
|
|
12
13
|
```js
|
|
@@ -64,8 +65,7 @@ Move to directory where you'd like to have your tests (and codeceptjs config) st
|
|
|
64
65
|
npx codeceptjs init
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
to create and configure test environment. It is recommended to select WebDriverIO from the list of helpers,
|
|
68
|
-
if you need to write Selenium WebDriver tests.
|
|
68
|
+
to create and configure test environment. It is recommended to select WebDriverIO from the list of helpers, if you need to write Selenium WebDriver tests.
|
|
69
69
|
|
|
70
70
|
After that create your first test by executing:
|
|
71
71
|
|
|
@@ -87,7 +87,7 @@ npx codeceptjs def .
|
|
|
87
87
|
|
|
88
88
|
Later you can even automagically update Type Definitions to include your own custom [helpers methods](docs/helpers.md).
|
|
89
89
|
|
|
90
|
-
Note that CodeceptJS requires Node.js version
|
|
90
|
+
Note that CodeceptJS requires Node.js version `8.9.1+` or later.
|
|
91
91
|
|
|
92
92
|
## Usage
|
|
93
93
|
|
|
@@ -263,6 +263,28 @@ Scenario('test some forms', (I, docsPage) => {
|
|
|
263
263
|
});
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
+
When using typescript, replace `module.exports` with `export` for autocompletion.
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
## Contributing
|
|
270
|
+
|
|
271
|
+
- ### [Contributing Guide](https://github.com/Codeception/CodeceptJS/blob/master/.github/CONTRIBUTING.md)
|
|
272
|
+
- ### [Code of conduct](https://github.com/Codeception/CodeceptJS/blob/master/.github/CODE_OF_CONDUCT.md)
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
## Contributors
|
|
276
|
+
|
|
277
|
+
Thanks all to those who are and will have contributing to this awesome project!
|
|
278
|
+
|
|
279
|
+
[//]: contributor-faces
|
|
280
|
+
<a href="https://github.com/DavertMik"><img src="https://avatars0.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a><a href="https://github.com/PeterNgTr"><img src="https://avatars0.githubusercontent.com/u/7845001?v=4" title="PeterNgTr" width="80" height="80"></a><a href="https://github.com/APshenkin"><img src="https://avatars1.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a><a href="https://github.com/reubenmiller"><img src="https://avatars0.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a><a href="https://github.com/fabioel"><img src="https://avatars1.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a><a href="https://github.com/Vorobeyko"><img src="https://avatars3.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a><a href="https://github.com/pablopaul"><img src="https://avatars1.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a><a href="https://github.com/tsuemura"><img src="https://avatars1.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
|
|
281
|
+
<a href="https://github.com/VikalpP"><img src="https://avatars2.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a><a href="https://github.com/MercifulCode"><img src="https://avatars2.githubusercontent.com/u/1740822?v=4" title="MercifulCode" width="80" height="80"></a><a href="https://github.com/elukoyanov"><img src="https://avatars3.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a><a href="https://github.com/hubidu"><img src="https://avatars2.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a><a href="https://github.com/BorisOsipov"><img src="https://avatars0.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a><a href="https://github.com/jploskonka"><img src="https://avatars3.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a><a href="https://github.com/martomo"><img src="https://avatars2.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a><a href="https://github.com/denis-sokolov"><img src="https://avatars0.githubusercontent.com/u/113721?v=4" title="denis-sokolov" width="80" height="80"></a>
|
|
282
|
+
<a href="https://github.com/lennym"><img src="https://avatars3.githubusercontent.com/u/117398?v=4" title="lennym" width="80" height="80"></a><a href="https://github.com/petehouston"><img src="https://avatars0.githubusercontent.com/u/9006720?v=4" title="petehouston" width="80" height="80"></a><a href="https://github.com/Holorium"><img src="https://avatars1.githubusercontent.com/u/10815542?v=4" title="Holorium" width="80" height="80"></a><a href="https://github.com/johnyb"><img src="https://avatars2.githubusercontent.com/u/86358?v=4" title="johnyb" width="80" height="80"></a><a href="https://github.com/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" title="jamesgeorge007" width="80" height="80"></a><a href="https://github.com/jinjorge"><img src="https://avatars3.githubusercontent.com/u/2208083?v=4" title="jinjorge" width="80" height="80"></a>
|
|
283
|
+
<a href="https://github.com/galkin"><img src="https://avatars3.githubusercontent.com/u/5930544?v=4" title="galkin" width="80" height="80"></a><a href="https://github.com/radhey1851"><img src="https://avatars2.githubusercontent.com/u/22446528?v=4" title="radhey1851" width="80" height="80"></a>
|
|
284
|
+
<a href="https://github.com/nitschSB"><img src="https://avatars0.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a><a href="https://github.com/abner"><img src="https://avatars1.githubusercontent.com/u/42773?v=4" title="abner" width="80" height="80"></a><a href="https://github.com/Akxe"><img src="https://avatars3.githubusercontent.com/u/2001798?v=4" title="Akxe" width="80" height="80"></a><a href="https://github.com/Kalostrinho"><img src="https://avatars0.githubusercontent.com/u/19229249?v=4" title="Kalostrinho" width="80" height="80"></a><a href="https://github.com/asselin"><img src="https://avatars2.githubusercontent.com/u/911250?v=4" title="asselin" width="80" height="80"></a><a href="https://github.com/xt1"><img src="https://avatars2.githubusercontent.com/u/3820037?v=4" title="xt1" width="80" height="80"></a>
|
|
285
|
+
|
|
286
|
+
[//]: contributor-faces
|
|
287
|
+
|
|
266
288
|
## License
|
|
267
289
|
|
|
268
290
|
MIT © [CodeceptJS Team](http://codecept.io)
|
package/bin/codecept.js
CHANGED
|
@@ -120,6 +120,43 @@ program.command('run [test]')
|
|
|
120
120
|
|
|
121
121
|
.action(require('../lib/command/run'));
|
|
122
122
|
|
|
123
|
+
program.command('run-rerun [test]')
|
|
124
|
+
.description('Executes tests in more than one test suite run')
|
|
125
|
+
|
|
126
|
+
// codecept-only options
|
|
127
|
+
.option('--steps', 'show step-by-step execution')
|
|
128
|
+
.option('--debug', 'output additional information')
|
|
129
|
+
.option('--verbose', 'output internal logging information')
|
|
130
|
+
.option('-o, --override [value]', 'override current config options')
|
|
131
|
+
.option('--profile [value]', 'configuration profile to be used')
|
|
132
|
+
.option('-c, --config [file]', 'configuration file to be used')
|
|
133
|
+
.option('--features', 'run only *.feature files and skip tests')
|
|
134
|
+
.option('--tests', 'run only JS test files and skip features')
|
|
135
|
+
.option('-p, --plugins <k=v,k2=v2,...>', 'enable plugins, comma-separated')
|
|
136
|
+
|
|
137
|
+
// mocha options
|
|
138
|
+
.option('--colors', 'force enabling of colors')
|
|
139
|
+
.option('--no-colors', 'force disabling of colors')
|
|
140
|
+
.option('-G, --growl', 'enable growl notification support')
|
|
141
|
+
.option('-O, --reporter-options <k=v,k2=v2,...>', 'reporter-specific options')
|
|
142
|
+
.option('-R, --reporter <name>', 'specify the reporter to use')
|
|
143
|
+
.option('-S, --sort', 'sort test files')
|
|
144
|
+
.option('-b, --bail', 'bail after first test failure')
|
|
145
|
+
.option('-d, --debug', "enable node's debugger, synonym for node --debug")
|
|
146
|
+
.option('-g, --grep <pattern>', 'only run tests matching <pattern>')
|
|
147
|
+
.option('-f, --fgrep <string>', 'only run tests containing <string>')
|
|
148
|
+
.option('-i, --invert', 'inverts --grep and --fgrep matches')
|
|
149
|
+
.option('--full-trace', 'display the full stack trace')
|
|
150
|
+
.option('--compilers <ext>:<module>,...', 'use the given module(s) to compile files')
|
|
151
|
+
.option('--debug-brk', "enable node's debugger breaking on the first line")
|
|
152
|
+
.option('--inline-diffs', 'display actual/expected differences inline within each string')
|
|
153
|
+
.option('--no-exit', 'require a clean shutdown of the event loop: mocha will not call process.exit')
|
|
154
|
+
.option('--recursive', 'include sub directories')
|
|
155
|
+
.option('--trace', 'trace function calls')
|
|
156
|
+
.option('--child <string>', 'option for child processes')
|
|
157
|
+
|
|
158
|
+
.action(require('../lib/command/run-rerun'));
|
|
159
|
+
|
|
123
160
|
program.command('run-workers <workers>')
|
|
124
161
|
.description('Executes tests in workers')
|
|
125
162
|
.option('-c, --config [file]', 'configuration file to be used')
|
|
@@ -155,6 +192,11 @@ program.command('run-multiple [suites...]')
|
|
|
155
192
|
|
|
156
193
|
.action(require('../lib/command/run-multiple'));
|
|
157
194
|
|
|
195
|
+
program.command('info [path]')
|
|
196
|
+
.description('Print debugging information concerning the local environment')
|
|
197
|
+
.option('-c, --config', 'your config file path')
|
|
198
|
+
.action(require('../lib/command/info'));
|
|
199
|
+
|
|
158
200
|
program.command('dry-run [test]')
|
|
159
201
|
.description('Prints step-by-step scenario for a test without actually running it')
|
|
160
202
|
.option('-p, --plugins <k=v,k2=v2,...>', 'enable plugins, comma-separated')
|
package/docs/advanced.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /advanced
|
|
3
3
|
title: Advanced Usage
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
# Advanced Usage
|
|
7
|
+
|
|
6
8
|
## Data Driven Tests
|
|
7
9
|
|
|
8
10
|
Execute the same scenario on a different data set.
|
|
@@ -226,3 +228,45 @@ Please note that some config changes can't be applied on the fly. For instance,
|
|
|
226
228
|
|
|
227
229
|
Configuration changes will be reverted after a test or a suite.
|
|
228
230
|
|
|
231
|
+
|
|
232
|
+
### Rerunning Flaky Tests Multiple Times <Badge text="Since 2.4" type="warning"/>
|
|
233
|
+
|
|
234
|
+
End to end tests can be flaky for various reasons. Even when we can't do anything to solve this problem it we can do next two things:
|
|
235
|
+
|
|
236
|
+
* Detect flaky tests in our suite
|
|
237
|
+
* Fix flaky tests by rerunning them.
|
|
238
|
+
|
|
239
|
+
Both tasks can be achieved with [`run-rerun` command](/commands/#run-rerun) which runs tests multiple times until all tests are passed.
|
|
240
|
+
|
|
241
|
+
You should set min and max runs boundaries so when few tests fail in a row you can rerun them until they are succeeded.
|
|
242
|
+
|
|
243
|
+
```js
|
|
244
|
+
// inside to codecept.conf.js
|
|
245
|
+
exports.config = { // ...
|
|
246
|
+
rerun: {
|
|
247
|
+
// run 4 times until 1st success
|
|
248
|
+
minSuccess: 1,
|
|
249
|
+
maxReruns: 4,
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
If you want to check all your tests for stability you can set high boundaries for minimal success:
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
// inside to codecept.conf.js
|
|
258
|
+
exports.config = { // ...
|
|
259
|
+
rerun: {
|
|
260
|
+
// run all tests must pass exactly 5 times
|
|
261
|
+
minSuccess: 5,
|
|
262
|
+
maxReruns: 5,
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Now execute tests with `run-rerun` command:
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
npx codeceptjs run-rerun
|
|
271
|
+
```
|
|
272
|
+
|
package/docs/angular.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /angular
|
|
3
3
|
title: Testing with Protractor
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -14,12 +14,12 @@ This way you aren't bound to a specific implementation, and your acceptance test
|
|
|
14
14
|
[Protractor](http://www.protractortest.org/#/) is an official tool for testing AngularJS applications.
|
|
15
15
|
CodeceptJS should not be considered as alternative to Protractor, but rather a testing framework that leverages this powerful library.
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
19
|
There is no magic in testing of AngularJS application in CodeceptJS.
|
|
20
20
|
You just execute regular Protractor commands, packaged into a simple, high-level API.
|
|
21
21
|
|
|
22
|
-

|
|
23
23
|
|
|
24
24
|
As an example, we will use the popular [TodoMVC application](http://todomvc.com/examples/angularjs/#/).
|
|
25
25
|
How would we test creating a new todo item using CodeceptJS?
|