codeceptjs 3.5.1 â 3.5.3
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 +51 -0
- package/README.md +4 -5
- package/docs/basics.md +1 -2
- package/docs/build/OpenAI.js +14 -10
- package/docs/build/Playwright.js +462 -1
- package/docs/changelog.md +51 -0
- package/docs/custom-helpers.md +2 -2
- package/docs/data.md +6 -2
- package/docs/docker.md +2 -3
- package/docs/helpers/Playwright.md +289 -150
- package/docs/helpers/Protractor.md +1709 -0
- package/docs/installation.md +1 -1
- package/docs/mobile.md +0 -2
- package/docs/plugins.md +0 -2
- package/docs/quickstart.md +0 -1
- package/docs/testcafe.md +1 -1
- package/docs/webdriver.md +0 -2
- package/lib/command/init.js +1 -1
- package/lib/helper/OpenAI.js +14 -10
- package/lib/helper/Playwright.js +462 -1
- package/lib/plugin/standardActingHelpers.js +0 -2
- package/lib/plugin/wdio.js +0 -1
- package/lib/recorder.js +2 -1
- package/package.json +8 -10
- package/typings/index.d.ts +0 -1
- package/typings/promiseBasedTypes.d.ts +127 -0
- package/typings/types.d.ts +127 -25
- package/docs/nightmare.md +0 -223
package/docs/changelog.md
CHANGED
|
@@ -7,6 +7,57 @@ layout: Section
|
|
|
7
7
|
|
|
8
8
|
# Releases
|
|
9
9
|
|
|
10
|
+
## 3.5.3
|
|
11
|
+
|
|
12
|
+
đŠī¸ Features
|
|
13
|
+
|
|
14
|
+
* **[Playwright]** Provide new steps to check network traffic [#3748](https://github.com/codeceptjs/CodeceptJS/issues/3748) - by **[ngraf](https://github.com/ngraf)** **[KobeNguyenT](https://github.com/KobeNguyenT)**
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
// recording traffics and verify the traffic
|
|
18
|
+
await I.startRecordingTraffic();
|
|
19
|
+
I.amOnPage('https://codecept.io/');
|
|
20
|
+
await I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
// block the traffic
|
|
25
|
+
I.blockTraffic('https://reqres.in/api/comments/*');
|
|
26
|
+
await I.amOnPage('/form/fetch_call');
|
|
27
|
+
await I.startRecordingTraffic();
|
|
28
|
+
await I.click('GET COMMENTS');
|
|
29
|
+
await I.see('Can not load data!');
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
// check the traffic with advanced params
|
|
34
|
+
I.amOnPage('https://openai.com/blog/chatgpt');
|
|
35
|
+
await I.startRecordingTraffic();
|
|
36
|
+
await I.seeTraffic({
|
|
37
|
+
name: 'sentry event',
|
|
38
|
+
url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
|
|
39
|
+
parameters: {
|
|
40
|
+
width: '1919',
|
|
41
|
+
height: '1138',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
đ Bugfix
|
|
47
|
+
|
|
48
|
+
* **[retryStepPlugin]** Fix retry step when using global retry [#3768](https://github.com/codeceptjs/CodeceptJS/issues/3768) - by **[KobeNguyenT](https://github.com/KobeNguyenT)**
|
|
49
|
+
|
|
50
|
+
đ Deprecated
|
|
51
|
+
|
|
52
|
+
* Nightmare and Protractor helpers have been deprecated
|
|
53
|
+
|
|
54
|
+
## 3.5.2
|
|
55
|
+
|
|
56
|
+
đ Bug Fixes
|
|
57
|
+
|
|
58
|
+
* **[Playwright]** reverted `clearField` to previous implementation
|
|
59
|
+
* **[OpenAI]** fixed running helper in pause mode. [#3755](https://github.com/codeceptjs/CodeceptJS/issues/3755) by **[KobeNguyenT](https://github.com/KobeNguyenT)**
|
|
60
|
+
|
|
10
61
|
## 3.5.1
|
|
11
62
|
|
|
12
63
|
đŠī¸ Features
|
package/docs/custom-helpers.md
CHANGED
|
@@ -102,7 +102,7 @@ This way, if your tests are written with TypeScript, your IDE will be able to le
|
|
|
102
102
|
|
|
103
103
|
## Accessing Elements
|
|
104
104
|
|
|
105
|
-
WebDriver, Puppeteer
|
|
105
|
+
WebDriver, Puppeteer and Playwright drivers provide API for web elements.
|
|
106
106
|
However, CodeceptJS do not expose them to tests by design, keeping test to be action focused.
|
|
107
107
|
If you need to get access to web elements, it is recommended to implement operations for web elements in a custom helper.
|
|
108
108
|
|
|
@@ -154,7 +154,7 @@ You can also pass additional config options to your helper from a config - **(pl
|
|
|
154
154
|
```js
|
|
155
155
|
helpers: {
|
|
156
156
|
// here goes standard helpers:
|
|
157
|
-
// WebDriver,
|
|
157
|
+
// WebDriver, Playwright, etc...
|
|
158
158
|
// and their configuration
|
|
159
159
|
MyHelper: {
|
|
160
160
|
require: "./my_helper.js", // path to module
|
package/docs/data.md
CHANGED
|
@@ -23,7 +23,7 @@ API is supposed to be a stable interface and it can be used by acceptance tests.
|
|
|
23
23
|
## REST
|
|
24
24
|
|
|
25
25
|
[REST helper](https://codecept.io/helpers/REST/) allows sending raw HTTP requests to application.
|
|
26
|
-
This is a tool to make shortcuts and create your data pragmatically via API. However, it doesn't provide tools for testing APIs, so it should be paired with
|
|
26
|
+
This is a tool to make shortcuts and create your data pragmatically via API. However, it doesn't provide tools for testing APIs, so it should be paired with Playwright or WebDriver helper for browser testing.
|
|
27
27
|
|
|
28
28
|
Enable REST helper in the config. It is recommended to set `endpoint`, a base URL for all API requests. If you need some authorization you can optionally set default headers too.
|
|
29
29
|
|
|
@@ -92,7 +92,11 @@ I.sendPostRequest('/update-status', {}, { http_x_requested_with: 'xmlhttprequest
|
|
|
92
92
|
## GraphQL
|
|
93
93
|
|
|
94
94
|
[GraphQL helper](https://codecept.io/helpers/GraphQL/) allows sending GraphQL queries and mutations to application, over Http.
|
|
95
|
-
|
|
95
|
+
<<<<<<< HEAD
|
|
96
|
+
This is a tool to make shortcuts and create your data pragmatically via GraphQL endpoint. However, it doesn't provide tools for testing the endpoint, so it should be paired with WebDriver helper for browser testing.
|
|
97
|
+
=======
|
|
98
|
+
This is a tool to make shortcuts and create your data pragmatically via GraphQL endpoint. However, it doesn't provide tools for testing the endpoint, so it should be paired with WebDriver helpers for browser testing.
|
|
99
|
+
>>>>>>> 3.x
|
|
96
100
|
|
|
97
101
|
Enable GraphQL helper in the config. It is recommended to set `endpoint`, the URL to which the requests go to. If you need some authorization you can optionally set default headers too.
|
|
98
102
|
|
package/docs/docker.md
CHANGED
|
@@ -13,7 +13,7 @@ CodeceptJS runner is available inside container as `codeceptjs`.
|
|
|
13
13
|
|
|
14
14
|
### Locally
|
|
15
15
|
|
|
16
|
-
You can execute CodeceptJS with Puppeteer
|
|
16
|
+
You can execute CodeceptJS with Puppeteer locally with no extra configuration.
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
19
|
docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs
|
|
@@ -56,7 +56,7 @@ services:
|
|
|
56
56
|
|
|
57
57
|
### Linking Containers
|
|
58
58
|
|
|
59
|
-
If using the
|
|
59
|
+
If using the WebDriver driver, link the container with a Selenium Standalone docker container with an alias of `selenium`. Additionally, make sure your `codeceptjs.conf.js` contains the following to allow CodeceptJS to identify where Selenium is running.
|
|
60
60
|
|
|
61
61
|
```javascript
|
|
62
62
|
...
|
|
@@ -80,7 +80,6 @@ $ docker run -it --rm -v /<path_to_codeceptjs_test_dir>/:/tests/ --link selenium
|
|
|
80
80
|
|
|
81
81
|
You may run use `-v $(pwd)/:tests/` if running this from the root of your CodeceptJS tests directory.
|
|
82
82
|
_Note: The output of your test run will appear in your local directory if your output path is `./output` in the CodeceptJS config_
|
|
83
|
-
_Note: If running with the Nightmare driver, it is not necessary to run a selenium docker container and link it. So `--link selenium-chrome:selenium` may be omitted_
|
|
84
83
|
|
|
85
84
|
### Build
|
|
86
85
|
|