codeceptjs 3.5.4-beta.1 → 3.5.5

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 (68) hide show
  1. package/CHANGELOG.md +368 -0
  2. package/README.md +0 -2
  3. package/docs/build/Appium.js +48 -7
  4. package/docs/build/GraphQL.js +25 -0
  5. package/docs/build/Nightmare.js +15 -6
  6. package/docs/build/Playwright.js +436 -197
  7. package/docs/build/Protractor.js +17 -8
  8. package/docs/build/Puppeteer.js +37 -20
  9. package/docs/build/TestCafe.js +19 -10
  10. package/docs/build/WebDriver.js +45 -37
  11. package/docs/changelog.md +375 -0
  12. package/docs/community-helpers.md +8 -4
  13. package/docs/examples.md +8 -2
  14. package/docs/helpers/Appium.md +39 -2
  15. package/docs/helpers/GraphQL.md +21 -0
  16. package/docs/helpers/Nightmare.md +1260 -0
  17. package/docs/helpers/Playwright.md +223 -119
  18. package/docs/helpers/Protractor.md +1711 -0
  19. package/docs/helpers/Puppeteer.md +31 -29
  20. package/docs/helpers/TestCafe.md +18 -17
  21. package/docs/helpers/WebDriver.md +34 -32
  22. package/docs/playwright.md +24 -1
  23. package/docs/webapi/dontSeeInField.mustache +1 -1
  24. package/docs/webapi/executeAsyncScript.mustache +2 -0
  25. package/docs/webapi/executeScript.mustache +2 -0
  26. package/docs/webapi/seeInField.mustache +1 -1
  27. package/docs/wiki/Books-&-Posts.md +0 -0
  28. package/docs/wiki/Community-Helpers-&-Plugins.md +8 -4
  29. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +46 -14
  30. package/docs/wiki/Examples.md +8 -2
  31. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -0
  32. package/docs/wiki/Home.md +0 -0
  33. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +83 -0
  34. package/docs/wiki/Release-Process.md +0 -0
  35. package/docs/wiki/Roadmap.md +0 -0
  36. package/docs/wiki/Tests.md +0 -0
  37. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -0
  38. package/docs/wiki/Videos.md +0 -0
  39. package/lib/codecept.js +1 -0
  40. package/lib/command/definitions.js +2 -7
  41. package/lib/command/init.js +40 -4
  42. package/lib/command/run-multiple/collection.js +17 -5
  43. package/lib/command/run-workers.js +4 -0
  44. package/lib/command/run.js +6 -0
  45. package/lib/helper/Appium.js +46 -5
  46. package/lib/helper/GraphQL.js +25 -0
  47. package/lib/helper/Nightmare.js +1415 -0
  48. package/lib/helper/Playwright.js +336 -62
  49. package/lib/helper/Protractor.js +1837 -0
  50. package/lib/helper/Puppeteer.js +31 -18
  51. package/lib/helper/TestCafe.js +15 -8
  52. package/lib/helper/WebDriver.js +39 -35
  53. package/lib/helper/clientscripts/nightmare.js +213 -0
  54. package/lib/helper/errors/ElementNotFound.js +2 -1
  55. package/lib/helper/scripts/highlightElement.js +1 -1
  56. package/lib/interfaces/bdd.js +1 -1
  57. package/lib/mochaFactory.js +2 -1
  58. package/lib/pause.js +6 -4
  59. package/lib/plugin/heal.js +2 -3
  60. package/lib/plugin/selenoid.js +6 -1
  61. package/lib/step.js +27 -10
  62. package/lib/utils.js +4 -0
  63. package/lib/workers.js +3 -1
  64. package/package.json +87 -87
  65. package/typings/promiseBasedTypes.d.ts +163 -126
  66. package/typings/types.d.ts +183 -144
  67. package/docs/build/Polly.js +0 -42
  68. package/docs/build/SeleniumWebdriver.js +0 -76
package/docs/changelog.md CHANGED
@@ -7,6 +7,381 @@ layout: Section
7
7
 
8
8
  # Releases
9
9
 
10
+ ## 3.5.5
11
+
12
+ 🐛 Bug Fixes
13
+ * fix(browserstack): issue with vendor prefix ([#3845](https://github.com/codeceptjs/CodeceptJS/issues/3845)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
14
+ ```
15
+ export const caps = {
16
+ androidCaps: {
17
+ appiumV2: true,
18
+ host: "hub-cloud.browserstack.com",
19
+ port: 4444,
20
+ user: process.env.BROWSERSTACK_USER,
21
+ key: process.env.BROWSERSTACK_KEY,
22
+ 'app': `bs://c700ce60cf13ae8ed97705a55b8e022f1hjhkjh3c5827c`,
23
+ browser: '',
24
+ desiredCapabilities: {
25
+ 'appPackage': data.packageName,
26
+ 'deviceName': process.env.DEVICE || 'Google Pixel 3',
27
+ 'platformName': process.env.PLATFORM || 'android',
28
+ 'platformVersion': process.env.OS_VERSION || '10.0',
29
+ 'automationName': process.env.ENGINE || 'UIAutomator2',
30
+ 'newCommandTimeout': 300000,
31
+ 'androidDeviceReadyTimeout': 300000,
32
+ 'androidInstallTimeout': 90000,
33
+ 'appWaitDuration': 300000,
34
+ 'autoGrantPermissions': true,
35
+ 'gpsEnabled': true,
36
+ 'isHeadless': false,
37
+ 'noReset': false,
38
+ 'noSign': true,
39
+ 'bstack:options' : {
40
+ "appiumVersion" : "2.0.1",
41
+ },
42
+ }
43
+ },
44
+ }
45
+ ```
46
+
47
+ * switchTo/within now supports strict locator ([#3847](https://github.com/codeceptjs/CodeceptJS/issues/3847)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
48
+
49
+ ```
50
+ I.switchTo({ css: 'iframe[id^=number-frame]' }) // support the strict locator
51
+
52
+ I.amOnPage('/iframe');
53
+ within({
54
+ frame: { css: '#number-frame-1234' }, // support the strict locator
55
+ }, () => {
56
+ I.fillField('user[login]', 'User');
57
+ I.fillField('user[email]', 'user@user.com');
58
+ I.fillField('user[password]', 'user@user.com');
59
+ I.click('button');
60
+ });
61
+ ```
62
+
63
+ * Improve the IntelliSense when using other languages ([#3848](https://github.com/codeceptjs/CodeceptJS/issues/3848)) - by **[andonary](https://github.com/andonary)**
64
+ ```
65
+ include: {
66
+ Je: './steps_file.js'
67
+ }
68
+ ```
69
+
70
+ * bypassCSP support for Playwright helper ([#3865](https://github.com/codeceptjs/CodeceptJS/issues/3865)) - by **[sammeel](https://github.com/sammeel)**
71
+ ```
72
+ helpers: {
73
+ Playwright: {
74
+ bypassCSP: true
75
+ }
76
+ ```
77
+ * fix: missing requests when recording network ([#3834](https://github.com/codeceptjs/CodeceptJS/issues/3834)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
78
+
79
+ 🛩️ Features and Improvements
80
+ * Show environment info in verbose mode ([#3858](https://github.com/codeceptjs/CodeceptJS/issues/3858)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
81
+
82
+ ```
83
+ Environment information:-
84
+
85
+ codeceptVersion: "3.5.4"
86
+ nodeInfo: 18.16.0
87
+ osInfo: macOS 13.5
88
+ cpuInfo: (8) arm64 Apple M1 Pro
89
+ chromeInfo: 116.0.5845.179
90
+ edgeInfo: 116.0.1938.69
91
+ firefoxInfo: Not Found
92
+ safariInfo: 16.6
93
+ helpers: {
94
+ "Playwright": {
95
+ "url": "https://github.com",
96
+ "show": false,
97
+ "browser": "chromium",
98
+ "waitForNavigation": "load",
99
+ "waitForTimeout": 30000,
100
+ "trace": false,
101
+ "keepTraceForPassedTests": true
102
+ },
103
+ "CDPHelper": {
104
+ "require": "./helpers/CDPHelper.ts"
105
+ },
106
+ "OpenAI": {
107
+ "chunkSize": 8000
108
+ },
109
+ "ExpectHelper": {
110
+ "require": "codeceptjs-expect"
111
+ },
112
+ "REST": {
113
+ "endpoint": "https://reqres.in",
114
+ "timeout": 20000
115
+ },
116
+ "AllureHelper": {
117
+ "require": "./helpers/AllureHelper.ts"
118
+ }
119
+ }
120
+ plugins: {
121
+ "screenshotOnFail": {
122
+ "enabled": true
123
+ },
124
+ "tryTo": {
125
+ "enabled": true
126
+ },
127
+ "retryFailedStep": {
128
+ "enabled": true
129
+ },
130
+ "retryTo": {
131
+ "enabled": true
132
+ },
133
+ "eachElement": {
134
+ "enabled": true
135
+ },
136
+ "pauseOnFail": {}
137
+ }
138
+ ***************************************
139
+ If you have questions ask them in our Slack: http://bit.ly/chat-codeceptjs
140
+ Or ask them on our discussion board: https://codecept.discourse.group/
141
+ Please copy environment info when you report issues on GitHub: https://github.com/Codeception/CodeceptJS/issues
142
+ ***************************************
143
+ CodeceptJS v3.5.4 #StandWithUkraine
144
+ ```
145
+
146
+ * some typings improvements ([#3855](https://github.com/codeceptjs/CodeceptJS/issues/3855)) - by **[nikzupancic](https://github.com/nikzupancic)**
147
+ * support the puppeteer 21.1.1 ([#3856](https://github.com/codeceptjs/CodeceptJS/issues/3856)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
148
+ * fix: support secret value for some methods ([#3837](https://github.com/codeceptjs/CodeceptJS/issues/3837)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
149
+
150
+ ```
151
+ await I.amOnPage('/form/field_values');
152
+ await I.dontSeeInField('checkbox[]', secret('not seen one'));
153
+ await I.seeInField('checkbox[]', secret('see test one'));
154
+ await I.dontSeeInField('checkbox[]', secret('not seen two'));
155
+ await I.seeInField('checkbox[]', secret('see test two'));
156
+ await I.dontSeeInField('checkbox[]', secret('not seen three'));
157
+ await I.seeInField('checkbox[]', secret('see test three'));
158
+ ```
159
+
160
+ 🛩️ **Several bugfixes and improvements for Codecept-UI**
161
+ * Mask the secret value in UI
162
+ * Improve UX/UI
163
+ * PageObjects are now showing in UI
164
+
165
+ ## 3.5.4
166
+
167
+ 🐛 Bug Fixes:
168
+ * **[Playwright]** When passing `userDataDir`, it throws error after test execution ([#3814](https://github.com/codeceptjs/CodeceptJS/issues/3814)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
169
+ * [CodeceptJS-CLI] Improve command to generate types ([#3788](https://github.com/codeceptjs/CodeceptJS/issues/3788)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
170
+ * Heal plugin fix ([#3820](https://github.com/codeceptjs/CodeceptJS/issues/3820)) - by **[davert](https://github.com/davert)**
171
+ * Fix for error in using `all` with `run-workers` ([#3805](https://github.com/codeceptjs/CodeceptJS/issues/3805)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
172
+ ```js
173
+ helpers: {
174
+ Playwright: {
175
+ url: 'https://github.com',
176
+ show: false,
177
+ browser: 'chromium',
178
+ waitForNavigation: 'load',
179
+ waitForTimeout: 30_000,
180
+ trace: true,
181
+ keepTraceForPassedTests: true
182
+ },
183
+ },
184
+ multiple: {
185
+ profile1: {
186
+ browsers: [
187
+ {
188
+ browser: "chromium",
189
+ }
190
+ ]
191
+ },
192
+ },
193
+ ```
194
+ * Highlight elements issues ([#3779](https://github.com/codeceptjs/CodeceptJS/issues/3779)) ([#3778](https://github.com/codeceptjs/CodeceptJS/issues/3778)) - by **[philkas](https://github.com/philkas)**
195
+ * Support `&nbsp` symbol in `I.see` method ([#3815](https://github.com/codeceptjs/CodeceptJS/issues/3815)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
196
+
197
+ ```js
198
+ // HTML code uses   instead of space
199
+ <div class="dJHe_" style="color: rgb(255, 255, 255);">My&nbsp;Text!</div>
200
+
201
+ I.see("My Text!") // this test would work with both &nbsp; and space
202
+ ```
203
+
204
+ 📖 Documentation
205
+ * Improve the configuration of electron testing when the app is build with electron-forge ([#3802](https://github.com/codeceptjs/CodeceptJS/issues/3802)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
206
+
207
+ ```js
208
+ const path = require("path");
209
+
210
+ exports.config = {
211
+ helpers: {
212
+ Playwright: {
213
+ browser: "electron",
214
+ electron: {
215
+ executablePath: require("electron"),
216
+ args: [path.join(__dirname, ".webpack/main/index.js")],
217
+ },
218
+ },
219
+ },
220
+ // rest of config
221
+ }
222
+ ```
223
+
224
+ 🛩️ Features
225
+
226
+ #### **[Playwright]** new features and improvements
227
+ * Parse the response in recording network steps ([#3771](https://github.com/codeceptjs/CodeceptJS/issues/3771)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
228
+
229
+ ```js
230
+ const traffics = await I.grabRecordedNetworkTraffics();
231
+ expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
232
+ expect(traffics[0].response.status).to.equal(200);
233
+ expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
234
+
235
+ expect(traffics[1].url).to.equal('https://reqres.in/api/comments/1');
236
+ expect(traffics[1].response.status).to.equal(200);
237
+ expect(traffics[1].response.body).to.contain({ name: 'this was another mocked' });
238
+ ```
239
+ * Grab metrics ([#3809](https://github.com/codeceptjs/CodeceptJS/issues/3809)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
240
+
241
+ ```js
242
+ const metrics = await I.grabMetrics();
243
+
244
+ // returned metrics
245
+
246
+ [
247
+ { name: 'Timestamp', value: 1584904.203473 },
248
+ { name: 'AudioHandlers', value: 0 },
249
+ { name: 'AudioWorkletProcessors', value: 0 },
250
+ { name: 'Documents', value: 22 },
251
+ { name: 'Frames', value: 10 },
252
+ { name: 'JSEventListeners', value: 366 },
253
+ { name: 'LayoutObjects', value: 1240 },
254
+ { name: 'MediaKeySessions', value: 0 },
255
+ { name: 'MediaKeys', value: 0 },
256
+ { name: 'Nodes', value: 4505 },
257
+ { name: 'Resources', value: 141 },
258
+ { name: 'ContextLifecycleStateObservers', value: 34 },
259
+ { name: 'V8PerContextDatas', value: 4 },
260
+ { name: 'WorkerGlobalScopes', value: 0 },
261
+ { name: 'UACSSResources', value: 0 },
262
+ { name: 'RTCPeerConnections', value: 0 },
263
+ { name: 'ResourceFetchers', value: 22 },
264
+ { name: 'AdSubframes', value: 0 },
265
+ { name: 'DetachedScriptStates', value: 2 },
266
+ { name: 'ArrayBufferContents', value: 1 },
267
+ { name: 'LayoutCount', value: 0 },
268
+ { name: 'RecalcStyleCount', value: 0 },
269
+ { name: 'LayoutDuration', value: 0 },
270
+ { name: 'RecalcStyleDuration', value: 0 },
271
+ { name: 'DevToolsCommandDuration', value: 0.000013 },
272
+ { name: 'ScriptDuration', value: 0 },
273
+ { name: 'V8CompileDuration', value: 0 },
274
+ { name: 'TaskDuration', value: 0.000014 },
275
+ { name: 'TaskOtherDuration', value: 0.000001 },
276
+ { name: 'ThreadTime', value: 0.000046 },
277
+ { name: 'ProcessTime', value: 0.616852 },
278
+ { name: 'JSHeapUsedSize', value: 19004908 },
279
+ { name: 'JSHeapTotalSize', value: 26820608 },
280
+ { name: 'FirstMeaningfulPaint', value: 0 },
281
+ { name: 'DomContentLoaded', value: 1584903.690491 },
282
+ { name: 'NavigationStart', value: 1584902.841845 }
283
+ ]
284
+ ```
285
+
286
+ * Grab WebSocket (WS) messages ([#3789](https://github.com/codeceptjs/CodeceptJS/issues/3789)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
287
+ * `flushWebSocketMessages`
288
+ * `grabWebSocketMessages`
289
+ * `startRecordingWebSocketMessages`
290
+ * `stopRecordingWebSocketMessages`
291
+
292
+ ```js
293
+ await I.startRecordingWebSocketMessages();
294
+ I.amOnPage('https://websocketstest.com/');
295
+ I.waitForText('Work for You!');
296
+ I.flushNetworkTraffics();
297
+ const wsMessages = I.grabWebSocketMessages();
298
+ expect(wsMessages.length).to.equal(0);
299
+ ```
300
+
301
+ ```js
302
+ await I.startRecordingWebSocketMessages();
303
+ await I.amOnPage('https://websocketstest.com/');
304
+ I.waitForText('Work for You!');
305
+ const wsMessages = I.grabWebSocketMessages();
306
+ expect(wsMessages.length).to.greaterThan(0);
307
+ ```
308
+
309
+ ```js
310
+ await I.startRecordingWebSocketMessages();
311
+ await I.amOnPage('https://websocketstest.com/');
312
+ I.waitForText('Work for You!');
313
+ const wsMessages = I.grabWebSocketMessages();
314
+ await I.stopRecordingWebSocketMessages();
315
+ await I.amOnPage('https://websocketstest.com/');
316
+ I.waitForText('Work for You!');
317
+ const afterWsMessages = I.grabWebSocketMessages();
318
+ expect(wsMessages.length).to.equal(afterWsMessages.length);
319
+ ```
320
+
321
+ * Move from `ElementHandle` to `Locator`. This change is quite major, but it happened under hood, so should not affect your code. ([#3738](https://github.com/codeceptjs/CodeceptJS/issues/3738)) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
322
+
323
+ ## 3.5.3
324
+
325
+ 🛩️ Features
326
+
327
+ * **[Playwright]** Added commands to check network traffic [#3748](https://github.com/codeceptjs/CodeceptJS/issues/3748) - by **[ngraf](https://github.com/ngraf)** **[KobeNguyenT](https://github.com/KobeNguyenT)**
328
+ * `startRecordingTraffic`
329
+ * `grabRecordedNetworkTraffics`
330
+ * `blockTraffic`
331
+ * `mockTraffic`
332
+ * `flushNetworkTraffics`
333
+ * `stopRecordingTraffic`
334
+ * `seeTraffic`
335
+ * `grabTrafficUrl`
336
+ * `dontSeeTraffic`
337
+
338
+ Examples:
339
+
340
+ ```js
341
+ // recording traffics and verify the traffic
342
+ await I.startRecordingTraffic();
343
+ I.amOnPage('https://codecept.io/');
344
+ await I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
345
+ ```
346
+
347
+ ```js
348
+ // block the traffic
349
+ I.blockTraffic('https://reqres.in/api/comments/*');
350
+ await I.amOnPage('/form/fetch_call');
351
+ await I.startRecordingTraffic();
352
+ await I.click('GET COMMENTS');
353
+ await I.see('Can not load data!');
354
+ ```
355
+
356
+ ```js
357
+ // check the traffic with advanced params
358
+ I.amOnPage('https://openai.com/blog/chatgpt');
359
+ await I.startRecordingTraffic();
360
+ await I.seeTraffic({
361
+ name: 'sentry event',
362
+ url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
363
+ parameters: {
364
+ width: '1919',
365
+ height: '1138',
366
+ },
367
+ });
368
+ ```
369
+
370
+ 🐛 Bugfix
371
+
372
+ * **[retryStepPlugin]** Fix retry step when using global retry [#3768](https://github.com/codeceptjs/CodeceptJS/issues/3768) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
373
+
374
+ 🗑 Deprecated
375
+
376
+ * Nightmare and Protractor helpers have been deprecated
377
+
378
+ ## 3.5.2
379
+
380
+ 🐛 Bug Fixes
381
+
382
+ * **[Playwright]** reverted `clearField` to previous implementation
383
+ * **[OpenAI]** fixed running helper in pause mode. [#3755](https://github.com/codeceptjs/CodeceptJS/issues/3755) by **[KobeNguyenT](https://github.com/KobeNguyenT)**
384
+
10
385
  ## 3.5.1
11
386
 
12
387
  🛩️ Features
@@ -31,9 +31,6 @@ Please **add your own** by editing this page.
31
31
  * [codeceptjs-bshelper](https://github.com/PeterNgTr/codeceptjs-bshelper) - a helper which updates `Test Names` & `Test Results` on Browserstack
32
32
  * [codeceptjs-tbhelper](https://github.com/testingbot/codeceptjs-tbhelper) - a helper which updates `Test Names` & `Test Results` on TestingBot
33
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
34
  ## Visual-Testing
38
35
  * [codeceptjs-resemblehelper](https://github.com/puneet0191/codeceptjs-resemblehelper) - a helper which helps with visual testing using resemble.js.
39
36
  * [codeceptjs-applitoolshelper](https://www.npmjs.com/package/codeceptjs-applitoolshelper) - a helper which helps interaction with [Applitools](https://applitools.com)
@@ -42,8 +39,10 @@ Please **add your own** by editing this page.
42
39
  ## Reporters
43
40
  * [codeceptjs-rphelper](https://github.com/reportportal/agent-js-codecept) is a CodeceptJS helper which can publish tests results on ReportPortal after execution.
44
41
  * [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).
42
+ * [codeceptjs-xray-cloud-helper](https://www.npmjs.com/package/codeceptjs-xray-cloud-helper) is a helper that automatically retrieves the result of CodeceptJS tests and sends them to XRAY/JIRA(cloud version) via [XRAY Cloud API](https://docs.getxray.app/display/XRAYCLOUD/Import+Execution+Results+-+REST+v2#ImportExecutionResultsRESTv2-XrayJSONresults).
45
43
  * [codeceptjs-slack-reporter](https://www.npmjs.com/package/codeceptjs-slack-reporter) Get a Slack notification when one or more scenarios fail.
46
44
  * [codeceptjs-browserlogs-plugin](https://github.com/pavkam/codeceptjs-browserlogs-plugin) Record the browser logs for failed tests.
45
+ * [codeceptjs-testrail](https://github.com/PeterNgTr/codeceptjs-testrail) - a plugin to integrate with [Testrail](https://www.gurock.com/testrail)
47
46
 
48
47
  ## Browser request control
49
48
  * [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.
@@ -55,4 +54,9 @@ Please **add your own** by editing this page.
55
54
  ## Other
56
55
 
57
56
  * [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.
57
+ * [eslint-plugin-codeceptjs](https://www.npmjs.com/package/eslint-plugin-codeceptjs) Eslint rules for CodeceptJS.
58
+ * [codeceptjs-datalayer-helper](https://github.com/kobenguyent/codeceptjs-datalayer-helper) CodeceptJS DataLayer helper helps you to get the datalayer JavaScript array that is used to store information and send this data to the tag manager.
59
+ * [codeceptjs-a11y-helper](https://github.com/kobenguyent/codeceptjs-a11y-helper) accessibility tests integrated with CodeceptJS - Playwright-axe
60
+ * [codeceptjs-lighthouse-helper](https://github.com/kobenguyent/codeceptjs-lighthouse-helper) lighthouse audit integrated with CodeceptJS - Playwright
61
+ * [Snowplow Data analytics](https://www.npmjs.com/package/@viasat/codeceptjs-snowplow-helper) - Test your Snowplow events implementations with CodeceptJS and Snowplow Micro.
62
+ * [codeceptjs-failure-logger](https://github.com/kobenguyent/codeceptjs-failure-logger) - Log failed CodeceptJS tests to file
package/docs/examples.md CHANGED
@@ -16,6 +16,7 @@ Playground repository where you can run tests in different helpers on a basic si
16
16
 
17
17
  Tests repository demonstrate usage of
18
18
 
19
+ * Playwright helper
19
20
  * Puppeteer helper
20
21
  * WebDriver helper
21
22
  * TestCafe plugin
@@ -28,7 +29,6 @@ Tests repository demonstrate usage of
28
29
  CodeceptJS repo contains basic tests (both failing and passing) just to show how it works.
29
30
  Our team uses it to test new features and run simple scenarios.
30
31
 
31
-
32
32
  ## [CodeceptJS Cucumber E2E Framework](https://github.com/gkushang/codeceptjs-e2e)
33
33
 
34
34
  This repository contains complete E2E framework for CodeceptJS with Cucumber and SauceLabs Integration
@@ -146,4 +146,10 @@ This is necessary if all integrations with TMS and CI/CD are already configured,
146
146
  * HTTP request client with session support and unit tests
147
147
  * Exemplary code control
148
148
  * Ready to launch in a CI/CD system as is
149
- * OOP, Test data models and builders, endpoint decorators
149
+ * OOP, Test data models and builders, endpoint decorators
150
+
151
+ ## [Playwright fun with CodeceptJS](https://github.com/PeterNgTr/codeceptjs-playwright-fun)
152
+ * Tests are written in TS
153
+ * CI/CD with Github Actions
154
+ * Page Object Model is applied
155
+ * ReportPortal Integration
@@ -99,6 +99,43 @@ helpers: {
99
99
  }
100
100
  ```
101
101
 
102
+ Example Android App using Appiumv2 on BrowserStack:
103
+
104
+ ```js
105
+ {
106
+ helpers: {
107
+ Appium: {
108
+ appiumV2: true,
109
+ host: "hub-cloud.browserstack.com",
110
+ port: 4444,
111
+ user: process.env.BROWSERSTACK_USER,
112
+ key: process.env.BROWSERSTACK_KEY,
113
+ app: `bs://c700ce60cf1gjhgjh3ae8ed9770ghjg5a55b8e022f13c5827cg`,
114
+ browser: '',
115
+ desiredCapabilities: {
116
+ 'appPackage': data.packageName,
117
+ 'deviceName': process.env.DEVICE || 'Google Pixel 3',
118
+ 'platformName': process.env.PLATFORM || 'android',
119
+ 'platformVersion': process.env.OS_VERSION || '10.0',
120
+ 'automationName': process.env.ENGINE || 'UIAutomator2',
121
+ 'newCommandTimeout': 300000,
122
+ 'androidDeviceReadyTimeout': 300000,
123
+ 'androidInstallTimeout': 90000,
124
+ 'appWaitDuration': 300000,
125
+ 'autoGrantPermissions': true,
126
+ 'gpsEnabled': true,
127
+ 'isHeadless': false,
128
+ 'noReset': false,
129
+ 'noSign': true,
130
+ 'bstack:options' : {
131
+ "appiumVersion" : "2.0.1",
132
+ },
133
+ }
134
+ }
135
+ }
136
+ }
137
+ ```
138
+
102
139
  Additional configuration params can be used from [https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md][4]
103
140
 
104
141
  ## Access From Helpers
@@ -941,7 +978,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
941
978
  #### Parameters
942
979
 
943
980
  - `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
944
- - `value` **[string][5]** value to check.
981
+ - `value` **([string][5] \| [object][10])** value to check.
945
982
  ⚠️ returns a _promise_ which is synchronized internally by recorder
946
983
 
947
984
  ### dontSee
@@ -1171,7 +1208,7 @@ I.seeInField('#searchform input','Search');
1171
1208
  #### Parameters
1172
1209
 
1173
1210
  - `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
1174
- - `value` **[string][5]** value to check.
1211
+ - `value` **([string][5] \| [object][10])** value to check.
1175
1212
  ⚠️ returns a _promise_ which is synchronized internally by recorder
1176
1213
 
1177
1214
  ### see
@@ -68,6 +68,27 @@ Prepares request for axios call
68
68
 
69
69
  Returns **[object][2]** graphQLRequest
70
70
 
71
+ ### amBearerAuthenticated
72
+
73
+ Adds a header for Bearer authentication
74
+
75
+ ```js
76
+ // we use secret function to hide token from logs
77
+ I.amBearerAuthenticated(secret('heregoestoken'))
78
+ ```
79
+
80
+ #### Parameters
81
+
82
+ - `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token
83
+
84
+ ### haveRequestHeaders
85
+
86
+ Sets request headers for all requests of this test
87
+
88
+ #### Parameters
89
+
90
+ - `headers` **[object][2]** headers list
91
+
71
92
  ### sendMutation
72
93
 
73
94
  Send query to GraphQL endpoint over http