codeceptjs 3.6.0-beta.1.ai-healers → 3.6.0

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.
Files changed (129) hide show
  1. package/README.md +2 -2
  2. package/bin/codecept.js +2 -1
  3. package/docs/webapi/dontSeeTraffic.mustache +13 -0
  4. package/docs/webapi/flushNetworkTraffics.mustache +5 -0
  5. package/docs/webapi/grabRecordedNetworkTraffics.mustache +10 -0
  6. package/docs/webapi/seeTraffic.mustache +36 -0
  7. package/docs/webapi/startRecordingTraffic.mustache +8 -0
  8. package/docs/webapi/startRecordingWebSocketMessages.mustache +8 -0
  9. package/docs/webapi/stopRecordingTraffic.mustache +5 -0
  10. package/docs/webapi/stopRecordingWebSocketMessages.mustache +7 -0
  11. package/docs/webapi/waitForCookie.mustache +9 -0
  12. package/lib/actor.js +6 -3
  13. package/lib/command/dryRun.js +44 -13
  14. package/lib/helper/Appium.js +36 -12
  15. package/lib/helper/Expect.js +11 -8
  16. package/lib/helper/JSONResponse.js +8 -8
  17. package/lib/helper/MockServer.js +221 -0
  18. package/lib/helper/Playwright.js +107 -371
  19. package/lib/helper/Puppeteer.js +404 -71
  20. package/lib/helper/REST.js +4 -1
  21. package/lib/helper/WebDriver.js +189 -13
  22. package/lib/helper/errors/ElementAssertion.js +38 -0
  23. package/lib/helper/extras/PlaywrightReactVueLocator.js +6 -1
  24. package/lib/helper/network/actions.js +123 -0
  25. package/lib/helper/network/utils.js +187 -0
  26. package/lib/locator.js +36 -5
  27. package/lib/plugin/coverage.js +112 -99
  28. package/lib/step.js +3 -1
  29. package/package.json +48 -37
  30. package/typings/index.d.ts +19 -2
  31. package/typings/promiseBasedTypes.d.ts +505 -41
  32. package/typings/types.d.ts +609 -56
  33. package/docs/advanced.md +0 -351
  34. package/docs/ai.md +0 -365
  35. package/docs/api.md +0 -323
  36. package/docs/basics.md +0 -979
  37. package/docs/bdd.md +0 -539
  38. package/docs/best.md +0 -237
  39. package/docs/books.md +0 -37
  40. package/docs/bootstrap.md +0 -135
  41. package/docs/build/AI.js +0 -124
  42. package/docs/build/ApiDataFactory.js +0 -410
  43. package/docs/build/Appium.js +0 -2027
  44. package/docs/build/Expect.js +0 -422
  45. package/docs/build/FileSystem.js +0 -228
  46. package/docs/build/GraphQL.js +0 -229
  47. package/docs/build/GraphQLDataFactory.js +0 -309
  48. package/docs/build/JSONResponse.js +0 -338
  49. package/docs/build/Mochawesome.js +0 -71
  50. package/docs/build/Nightmare.js +0 -2152
  51. package/docs/build/OpenAI.js +0 -126
  52. package/docs/build/Playwright.js +0 -5110
  53. package/docs/build/Protractor.js +0 -2706
  54. package/docs/build/Puppeteer.js +0 -3905
  55. package/docs/build/REST.js +0 -344
  56. package/docs/build/TestCafe.js +0 -2125
  57. package/docs/build/WebDriver.js +0 -4240
  58. package/docs/changelog.md +0 -2572
  59. package/docs/commands.md +0 -266
  60. package/docs/community-helpers.md +0 -58
  61. package/docs/configuration.md +0 -157
  62. package/docs/continuous-integration.md +0 -22
  63. package/docs/custom-helpers.md +0 -306
  64. package/docs/data.md +0 -379
  65. package/docs/detox.md +0 -235
  66. package/docs/docker.md +0 -136
  67. package/docs/email.md +0 -183
  68. package/docs/examples.md +0 -149
  69. package/docs/heal.md +0 -186
  70. package/docs/helpers/ApiDataFactory.md +0 -266
  71. package/docs/helpers/Appium.md +0 -1374
  72. package/docs/helpers/Detox.md +0 -586
  73. package/docs/helpers/Expect.md +0 -275
  74. package/docs/helpers/FileSystem.md +0 -152
  75. package/docs/helpers/GraphQL.md +0 -151
  76. package/docs/helpers/GraphQLDataFactory.md +0 -226
  77. package/docs/helpers/JSONResponse.md +0 -254
  78. package/docs/helpers/Mochawesome.md +0 -8
  79. package/docs/helpers/MockRequest.md +0 -377
  80. package/docs/helpers/Nightmare.md +0 -1305
  81. package/docs/helpers/OpenAI.md +0 -70
  82. package/docs/helpers/Playwright.md +0 -2759
  83. package/docs/helpers/Polly.md +0 -44
  84. package/docs/helpers/Protractor.md +0 -1769
  85. package/docs/helpers/Puppeteer-firefox.md +0 -86
  86. package/docs/helpers/Puppeteer.md +0 -2317
  87. package/docs/helpers/REST.md +0 -218
  88. package/docs/helpers/TestCafe.md +0 -1321
  89. package/docs/helpers/WebDriver.md +0 -2547
  90. package/docs/hooks.md +0 -340
  91. package/docs/index.md +0 -111
  92. package/docs/installation.md +0 -75
  93. package/docs/internal-api.md +0 -266
  94. package/docs/locators.md +0 -339
  95. package/docs/mobile-react-native-locators.md +0 -67
  96. package/docs/mobile.md +0 -338
  97. package/docs/pageobjects.md +0 -291
  98. package/docs/parallel.md +0 -400
  99. package/docs/playwright.md +0 -632
  100. package/docs/plugins.md +0 -1247
  101. package/docs/puppeteer.md +0 -316
  102. package/docs/quickstart.md +0 -162
  103. package/docs/react.md +0 -70
  104. package/docs/reports.md +0 -392
  105. package/docs/secrets.md +0 -36
  106. package/docs/shadow.md +0 -68
  107. package/docs/shared/keys.mustache +0 -31
  108. package/docs/shared/react.mustache +0 -1
  109. package/docs/testcafe.md +0 -174
  110. package/docs/translation.md +0 -247
  111. package/docs/tutorial.md +0 -271
  112. package/docs/typescript.md +0 -180
  113. package/docs/ui.md +0 -59
  114. package/docs/videos.md +0 -28
  115. package/docs/visual.md +0 -202
  116. package/docs/vue.md +0 -143
  117. package/docs/webdriver.md +0 -701
  118. package/docs/wiki/Books-&-Posts.md +0 -27
  119. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -53
  120. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -61
  121. package/docs/wiki/Examples.md +0 -145
  122. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  123. package/docs/wiki/Home.md +0 -16
  124. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +0 -83
  125. package/docs/wiki/Release-Process.md +0 -24
  126. package/docs/wiki/Roadmap.md +0 -23
  127. package/docs/wiki/Tests.md +0 -1393
  128. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  129. package/docs/wiki/Videos.md +0 -19
package/docs/commands.md DELETED
@@ -1,266 +0,0 @@
1
- ---
2
- permalink: /commands
3
- title: Commands
4
- ---
5
-
6
- # Commands
7
-
8
- ## Run
9
-
10
- Executes tests. Requires `codecept.conf.js` config to be present in provided path.
11
-
12
- ---
13
-
14
- Run all tests from current dir
15
-
16
- ```sh
17
- npx codeceptjs run
18
- ```
19
-
20
- Load config and run tests from `test` dir
21
-
22
- ```sh
23
- npx codeceptjs run -c test
24
- ```
25
-
26
- Run only tests with "signin" word in name
27
-
28
- ```sh
29
- npx codeceptjs run --grep "signin"
30
- ```
31
-
32
- Run all tests without "@IEOnly" word in name
33
-
34
- ```sh
35
- npx codeceptjs run --grep "@IEOnly" --invert
36
- ```
37
-
38
- Run single test [path to codecept.js] [test filename]
39
-
40
- ```sh
41
- npx codeceptjs run github_test.js
42
- ```
43
-
44
- Run single test with steps printed
45
-
46
- ```sh
47
- npx codeceptjs run github_test.js --steps
48
- ```
49
-
50
- Run single test in debug mode (see more in [debugging](#Debugging) section)
51
-
52
- ```sh
53
- npx codeceptjs run github_test.js --debug
54
- ```
55
-
56
- Select config file manually (`-c` or `--config` option)
57
-
58
- ```sh
59
- npx codeceptjs run -c my.codecept.conf.js
60
- npx codeceptjs run --config path/to/codecept.conf.js
61
- ```
62
-
63
- Override config on the fly. Provide valid JSON which will be merged into current config:
64
-
65
- ```sh
66
- npx codeceptjs run --override '{ "helpers": {"WebDriver": {"browser": "chrome"}}}'
67
- ```
68
-
69
- Run tests and produce xunit report:
70
-
71
- ```sh
72
- npx codeceptjs run --reporter xunit
73
- ```
74
-
75
- Use any of [Mocha reporters](https://github.com/mochajs/mocha/tree/master/lib/reporters) used.
76
-
77
- #### Debugging
78
-
79
- Run single test in debug mode
80
-
81
- ```sh
82
- npx codeceptjs run --debug
83
- ```
84
-
85
- Run test with internal logs printed.
86
-
87
- ```sh
88
- npx codeceptjs run --verbose
89
- ```
90
-
91
- Display complete debug output including scheduled promises
92
-
93
- ```
94
- DEBUG=codeceptjs:* npx codeceptjs run
95
- ```
96
-
97
- ## Run Workers
98
-
99
- Run tests in parallel threads.
100
-
101
- ```
102
- npx codeceptjs run-workers 3
103
- ```
104
-
105
- ## Run Rerun <Badge text="Since 3.3.6" type="warning"/>
106
-
107
- Run tests multiple times to detect and fix flaky tests.
108
-
109
- ```
110
- npx codeceptjs run-rerun
111
- ```
112
-
113
- For this command configuration is required:
114
-
115
- ```js
116
- {
117
- // inside codecept.conf.js
118
- rerun: {
119
- // how many times all tests should pass
120
- minSuccess: 2,
121
-
122
- // how many times to try to rerun all tests
123
- maxReruns: 4,
124
- }
125
- }
126
- ```
127
-
128
- Use Cases:
129
-
130
- * `minSuccess: 1, maxReruns: 5` - run all tests no more than 5 times, until first successful run.
131
- * `minSuccess: 3, maxReruns: 5` - run all tests no more than 5 times, until reaching 3 successfull runs.
132
- * `minSuccess: 10, maxReruns: 10` - run all tests exactly 10 times, to check their stability.
133
-
134
-
135
- ## Dry Run
136
-
137
- Prints test scenarios without executing them
138
-
139
- ```
140
- npx codeceptjs dry-run
141
- ```
142
-
143
- When passed `--steps` or `--debug` option runs tests, disabling all plugins and helpers, so you can get step-by-step report with no tests actually executed.
144
-
145
- ```
146
- npx codeceptjs dry-run --steps
147
- ```
148
-
149
- If a plugin needs to be enabled in `dry-run` mode, pass its name in `-p` option:
150
-
151
- ```
152
- npx codeceptjs dry-run --steps -p allure
153
- ```
154
-
155
- If some plugins need to be enabled in `dry-run` mode, pass its name in `-p` option:
156
-
157
- ```
158
- npx codeceptjs dry-run --steps -p allure,customLocator
159
- ```
160
-
161
- If all plugins need to be enabled in `dry-run` mode, pass its name in `-p` option:
162
-
163
- ```
164
- npx codeceptjs dry-run --steps -p all
165
- ```
166
-
167
- To enable bootstrap script in dry-run mode, pass in `--bootstrap` option when running with `--steps` or `--debug`
168
-
169
- ```
170
- npx codeceptjs dry-run --steps --bootstrap
171
- ```
172
-
173
- ## Run Multiple
174
-
175
- > ⚠️ prefer using run-workers instead
176
-
177
- Run multiple suites. Unlike `run-workers` spawns processes to execute tests.
178
- [Requires additional configuration](/advanced#multiple-browsers-execution) and can be used to execute tests in multiple browsers.
179
-
180
- ```sh
181
- npx codeceptjs run-multiple smoke:chrome regression:firefox
182
- ```
183
-
184
- ## Init
185
-
186
- Creates `codecept.conf.js` file in current directory:
187
-
188
- ```sh
189
- npx codeceptjs init
190
- ```
191
-
192
- Or in provided path
193
-
194
- ```sh
195
- npx codecept init test
196
- ```
197
-
198
- ## Migrate
199
-
200
- Migrate your current `codecept.json` to `codecept.conf.js`
201
-
202
- ```sh
203
- npx codeceptjs migrate
204
- ```
205
-
206
- ## Shell
207
-
208
- Interactive shell. Allows to try `I.` commands in runtime
209
-
210
- ```sh
211
- npx codeceptjs shell
212
- ```
213
-
214
- ## Generators
215
-
216
- Create new test
217
-
218
- ```sh
219
- npx codeceptjs generate:test
220
- ```
221
-
222
- Create new pageobject
223
-
224
- ```sh
225
- npx codeceptjs generate:pageobject
226
- ```
227
-
228
- Create new helper
229
-
230
- ```sh
231
- npx codeceptjs generate:helper
232
- ```
233
-
234
- ## TypeScript Definitions
235
-
236
- TypeScript Definitions allows IDEs to provide autocompletion when writing tests.
237
-
238
- ```sh
239
- npx codeceptjs def
240
- npx codeceptjs def --config path/to/codecept.conf.js
241
- ```
242
-
243
- After doing that IDE should provide autocompletion for `I` object inside `Scenario` and `within` blocks.
244
-
245
- Add optional parameter `output` (or shortcut `-o`), if you want to place your definition file in specific folder:
246
-
247
- ```sh
248
- npx codeceptjs def --output ./tests/typings
249
- npx codeceptjs def -o ./tests/typings
250
- ```
251
-
252
- ## List Commands
253
-
254
- Prints all available methods of `I` to console
255
-
256
- ```sh
257
- npx codeceptjs list
258
- ```
259
-
260
- ## Local Environment Information
261
-
262
- Prints debugging information concerning the local environment
263
-
264
- ```sh
265
- npx codeceptjs info
266
- ```
@@ -1,58 +0,0 @@
1
- ---
2
- permalink: /community-helpers
3
- title: Community Helpers
4
- editLink: false
5
- ---
6
-
7
- # Community Helpers
8
- > Share your helpers at our [Wiki Page](https://github.com/codeceptjs/CodeceptJS/wiki/Community-Helpers)
9
-
10
- Here is the list of helpers created by our community.
11
- Please **add your own** by editing this page.
12
- ## Webhooks
13
-
14
- * [codeceptjs-webhook-helper](https://github.com/onemolegames/codeceptjs-webhook-helper) - to check webhook calls during the tests.
15
-
16
- ## Email Checking
17
-
18
- * [MailCatcher](https://gist.github.com/schmkr/026732dfa1627b927ff3a08dc31ee884) - to check emails via Mailcatcher locally.
19
- * [codeceptjs-mailhog-helper](https://github.com/tsuemura/codeceptjs-mailhog-helper) - to check emails via Mailhog locally.
20
- * [codeceptjs-testmailapp-helper](https://github.com/pavkam/codeceptjs-testmailapp-helper) - to check emails via Testmail.app service.
21
- * [codeceptjs-mailosaurhelper](https://github.com/yurkovychv/codeceptjs-mailosaur) - to check emails via [Mailosaur](https://mailosaur.com/) service.
22
-
23
- ## Data Sources
24
-
25
- * [codeceptjs-httpmock](https://github.com/testphony/codeceptjs-httpMock) - a helper which wraps mockttp library to manage http mock in tests.
26
- * [codeceptjs-http](https://github.com/testphony/codeceptjs-http) - a helper which wraps then-request library to process HTTP requests. It's alternative helper that provides more flexible request management.
27
- * [codeceptjs-dbhelper](https://github.com/thiagodp/codeceptjs-dbhelper) - allows you to execute queries or commands to databases using database-js.
28
-
29
- ## Cloud Providers
30
- * [codeceptjs-saucehelper](https://github.com/puneet0191/codeceptjs-saucehelper/) - a helper which updates `Test Names` & `Test Results` on Saucelabs
31
- * [codeceptjs-bshelper](https://github.com/PeterNgTr/codeceptjs-bshelper) - a helper which updates `Test Names` & `Test Results` on Browserstack
32
- * [codeceptjs-tbhelper](https://github.com/testingbot/codeceptjs-tbhelper) - a helper which updates `Test Names` & `Test Results` on TestingBot
33
-
34
- ## Integrations
35
- * [codeceptjs-testrail](https://github.com/PeterNgTr/codeceptjs-testrail) - a plugin to integrate with [Testrail](https://www.gurock.com/testrail)
36
-
37
- ## Visual-Testing
38
- * [codeceptjs-resemblehelper](https://github.com/puneet0191/codeceptjs-resemblehelper) - a helper which helps with visual testing using resemble.js.
39
- * [codeceptjs-applitoolshelper](https://www.npmjs.com/package/codeceptjs-applitoolshelper) - a helper which helps interaction with [Applitools](https://applitools.com)
40
- * [codeceptjs-pixelmatchhelper](https://github.com/stracker-phil/codeceptjs-pixelmatchhelper) - a helper that integrates pixelmatch for visual testing.
41
-
42
- ## Reporters
43
- * [codeceptjs-rphelper](https://github.com/reportportal/agent-js-codecept) is a CodeceptJS helper which can publish tests results on ReportPortal after execution.
44
- * [codeceptjs-xray-helper](https://www.npmjs.com/package/codeceptjs-xray-helper) is a CodeceptJS helper which can publish tests results on [XRAY](https://confluence.xpand-it.com/display/XRAYCLOUD/Import+Execution+Results+-+REST).
45
- * [codeceptjs-slack-reporter](https://www.npmjs.com/package/codeceptjs-slack-reporter) Get a Slack notification when one or more scenarios fail.
46
- * [codeceptjs-browserlogs-plugin](https://github.com/pavkam/codeceptjs-browserlogs-plugin) Record the browser logs for failed tests.
47
-
48
- ## Browser request control
49
- * [codeceptjs-resources-check](https://github.com/luarmr/codeceptjs-resources-check) Load a URL with Puppeteer and listen to the requests while the page is loading. Enabling count the number or check the sizes of the requests.
50
-
51
- ## Assertion & Validations
52
- * [codeceptjs-chai](https://www.npmjs.com/package/codeceptjs-chai) is a CodeceptJS helper which wraps
53
- [chai](https://www.chaijs.com/) library to complete chai assertion steps with CodeceptJS logging.
54
-
55
- ## Other
56
-
57
- * [codeceptjs-cmdhelper](https://github.com/thiagodp/codeceptjs-cmdhelper) allows you to run commands in the terminal/console
58
- * [eslint-plugin-codeceptjs](https://www.npmjs.com/package/eslint-plugin-codeceptjs) Eslint rules for CodeceptJS.
@@ -1,157 +0,0 @@
1
- ---
2
- permalink: /configuration
3
- title: Configuration
4
- ---
5
-
6
- # Configuration
7
-
8
- CodeceptJS configuration is set in `codecept.conf.js` file.
9
-
10
- After running `codeceptjs init` it should be saved in test root.
11
-
12
- | Name | Type | Description |
13
- | :------ | :------ | :------ |
14
- | `bootstrap?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code before](https://codecept.io/bootstrap/) tests are run. Can be either JS module file or async function: ```bootstrap: async () => server.launch(), ``` or ```bootstrap: 'bootstrap.js', ``` |
15
- | `bootstrapAll?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
16
- | `gherkin?` | { `features`: `string` \| `string`[] ; `steps`: `string`[] } | Enable [BDD features](https://codecept.io/bdd/#configuration). Sample configuration: ```gherkin: { features: "./features/*.feature", steps: ["./step_definitions/steps.js"] } ``` |
17
- | `gherkin.features` | `string` \| `string`[] | load feature files by pattern. Multiple patterns can be specified as array |
18
- | `gherkin.steps` | `string`[] | load step definitions from JS files |
19
- | `grep?` | `string` | Pattern to filter tests by name. This option is useful if you plan to use multiple configs for different environments. To execute only tests with @firefox tag use ```grep: '@firefox' ``` |
20
- | `helpers?` | {} | Enable and configure helpers: ```helpers: { Playwright: { url: 'https://mysite.com', browser: 'firefox' } } ``` |
21
- | `include?` | `any` | Include page objects to access them via dependency injection ```I: "./custom_steps.js", loginPage: "./pages/Login.js", User: "./pages/User.js", ``` Configured modules can be injected by name in a Scenario: ```Scenario('test', { I, loginPage, User }) ``` |
22
- | `mocha?` | `any` | [Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here. Example: ```mocha: { "mocha-junit-reporter": { stdout: "./output/console.log", options: { mochaFile: "./output/result.xml", attachments: true //add screenshot for a failed test } } } ``` |
23
- | `noGlobals?` | `boolean` | Disable registering global functions (Before, Scenario, etc). Not recommended |
24
- | `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output' ``` |
25
- | `plugins?` | `any` | Enable CodeceptJS plugins. Example: ```plugins: { autoDelay: { enabled: true } } ``` |
26
- | `require?` | `string`[] | [Require additional JS modules](https://codecept.io/configuration/#require) Example: ``` require: ["should"] ``` |
27
- | `teardown?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code after tests](https://codecept.io/bootstrap/) finished. Can be either JS module file or async function: ```teardown: async () => server.stop(), ``` or ```teardown: 'teardown.js', ``` |
28
- | `teardownAll?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
29
- | `tests` | `string` | Pattern to locate CodeceptJS tests. Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names. For tests in JavaScript: ```tests: 'tests/**.test.js' ``` For tests in TypeScript: ```tests: 'tests/**.test.ts' ``` |
30
- | `timeout?` | `number` | Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```timeout: 20, ``` |
31
- | `translation?` | `string` | Enable [localized test commands](https://codecept.io/translation/) |
32
-
33
-
34
- ## Require
35
-
36
- Requires described module before run. This option is useful for assertion libraries, so you may `--require should` instead of manually invoking `require('should')` within each test file. It can be used with relative paths, e.g. `"require": ["/lib/somemodule"]`, and installed packages.
37
-
38
- You can register ts-node, so you can use Typescript in tests with ts-node package
39
- ```js
40
- exports.config = {
41
- tests: './*_test.js',
42
- timeout: 10000,
43
- output: '',
44
- helpers: {},
45
- include: {},
46
- bootstrap: false,
47
- mocha: {},
48
- // require modules
49
- require: ["ts-node/register", "should"]
50
- }
51
- ```
52
- For array of test pattern
53
- ```js
54
- exports.config = {
55
- tests: ['./*_test.js','./sampleTest.js'],
56
- timeout: 10000,
57
- output: '',
58
- helpers: {},
59
- include: {},
60
- bootstrap: false,
61
- mocha: {},
62
- // require modules
63
- require: ["ts-node/register", "should"]
64
- }
65
- ```
66
- ## Dynamic Configuration
67
-
68
- By default `codecept.json` is used for configuration. You can override its values in runtime by using `--override` or `-o` option in command line, passing valid JSON as a value:
69
-
70
- ```sh
71
- codeceptjs run -o '{ "helpers": {"WebDriver": {"browser": "firefox"}}}'
72
- ```
73
-
74
- You can also switch to JS configuration format for more dynamic options.
75
- Create `codecept.conf.js` file and make it export `config` property.
76
-
77
- See the config example:
78
-
79
- ```js
80
- exports.config = {
81
- helpers: {
82
- WebDriver: {
83
- // load variables from the environment and provide defaults
84
- url: process.env.CODECEPT_URL || 'http://localhost:3000',
85
-
86
- user: process.env.CLOUDSERVICE_USER,
87
- key: process.env.CLOUDSERVICE_KEY,
88
-
89
- coloredLogs: true,
90
- waitForTimeout: 10000
91
- }
92
- },
93
-
94
- // don't build monolithic configs
95
- mocha: require('./mocha.conf.js') || {},
96
- include: {
97
- I: './src/steps_file.js',
98
- loginPage: './src/pages/login_page',
99
- dashboardPage: new DashboardPage()
100
- }
101
-
102
- // here goes config as it was in codecept.conf.ts
103
- // ....
104
- };
105
- ```
106
-
107
- (Don't copy-paste this config, it's just demo)
108
-
109
- If you prefer to store your configuration files in a different location, or with a different name, you can do that with `--config` or `-c:
110
-
111
- ```sh
112
- codeceptjs run --config=./path/to/my/config.js
113
- ```
114
-
115
- ## Common Configuration Patterns
116
-
117
- > 📺 [Watch this material](https://www.youtube.com/watch?v=onBnfo_rJa4&t=4s) on YouTube
118
-
119
- [`@codeceptjs/configure` package](https://github.com/codeceptjs/configure) contains shared recipes for common configuration patterns. This allows to set meta-configuration, independent from a current helper enabled.
120
-
121
- Install it and enable to easily switch to headless/window mode, change window size, etc.
122
-
123
- ```js
124
- const { setHeadlessWhen, setWindowSize } = require('@codeceptjs/configure');
125
-
126
- setHeadlessWhen(process.env.CI);
127
- setWindowSize(1600, 1200);
128
-
129
- exports.config = {
130
- // ...
131
- }
132
- ```
133
-
134
- ## Profile
135
-
136
- Using `process.env.profile` you can change the config dynamically.
137
- It provides value of `--profile` option passed to runner.
138
- Use its value to change config value on the fly.
139
-
140
- For instance, with the config above we can change browser value using `profile` option
141
-
142
- ```sh
143
- codeceptjs run --profile firefox
144
- ```
145
-
146
- ```js
147
- exports.config = {
148
- helpers: {
149
- WebDriver: {
150
- url: 'http://localhost:3000',
151
- // load value from `profile`
152
- browser: process.env.profile || 'firefox'
153
-
154
- }
155
- }
156
- };
157
- ```
@@ -1,22 +0,0 @@
1
- ---
2
- permalink: /continuous-integration
3
- title: Continuous Integration
4
- ---
5
-
6
- <!-- this file is auto generated from CI category https://codecept.discourse.group/c/CodeceptJS-issues-in-general/ci/9 -->
7
-
8
- # Continuous Integration
9
-
10
- > Help us improve this article. [Write how did you set up CodeceptJS for CI](https://codecept.discourse.group/c/CodeceptJS-issues-in-general/ci/9) and see your post listed here!
11
-
12
- Continuous Integration services allows you to delegate the control of running tests to external system.
13
- CodeceptJS plays well with all types of CI even when there is no documentation on this topic, it is still easy to set up with any kind of hosted or cloud CI.
14
- Our community prepared some valuable recipes for setting up CI systems with CodeceptJS.
15
-
16
- ## Recipes
17
-
18
- * ### [CodeceptJS - Codefresh Integration](https://codecept.discourse.group/t/codeceptjs-codefresh-integration/)
19
- * ### [CodeceptJS GitLab Integration](https://codecept.discourse.group/t/codeceptjs-gitlab-integration/)
20
- * ### [CodeceptJS - Jenkins Integration](https://codecept.discourse.group/t/codeceptjs-jenkins-integration/)
21
- * ### [CodeceptJS Integration with TeamCity](https://codecept.discourse.group/t/codeceptjs-integration-with-teamcity/)
22
-