codeceptjs 3.3.0-beta.2 → 3.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.3.0-beta.2",
3
+ "version": "3.3.0",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -53,12 +53,13 @@
53
53
  "dtslint": "dtslint typings --localTs './node_modules/typescript/lib'"
54
54
  },
55
55
  "dependencies": {
56
- "@codeceptjs/configure": "^0.6.2",
56
+ "@codeceptjs/configure": "^0.8.0",
57
57
  "@codeceptjs/helper": "^1.0.2",
58
58
  "acorn": "^7.4.1",
59
59
  "allure-js-commons": "^1.3.2",
60
60
  "arrify": "^2.0.1",
61
61
  "axios": "^0.21.4",
62
+ "chai": "^4.3.6",
62
63
  "chai-deep-match": "^1.2.1",
63
64
  "chalk": "^4.1.2",
64
65
  "commander": "^2.20.3",
@@ -99,7 +100,6 @@
99
100
  "@wdio/selenium-standalone-service": "^5.16.10",
100
101
  "@wdio/utils": "^5.23.0",
101
102
  "apollo-server-express": "^2.25.3",
102
- "chai": "^3.5.0",
103
103
  "chai-as-promised": "^5.2.0",
104
104
  "chai-subset": "^1.6.0",
105
105
  "contributor-faces": "^1.0.3",
@@ -2583,15 +2583,19 @@ declare namespace CodeceptJS {
2583
2583
  * * `url`: base url of website to be tested
2584
2584
  * * `browser`: a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
2585
2585
  * * `show`: (optional, default: false) - show browser window.
2586
- * * `restart`: (optional, default: true) - restart browser between tests.
2586
+ * * `restart`: (optional, default: false) - restart strategy between tests. Possible values:
2587
+ * * 'context' or **false** - restarts [browser context](https://playwright.dev/docs/api/class-browsercontext) but keeps running browser. Recommended by Playwright team to keep tests isolated.
2588
+ * * 'browser' or **true** - closes browser and opens it again between tests.
2589
+ * * 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
2590
+ * * `timeout`: (optional, default: 1000) - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
2587
2591
  * * `disableScreenshots`: (optional, default: false) - don't save screenshot on failure.
2588
2592
  * * `emulate`: (optional, default: {}) launch browser in device emulation mode.
2589
2593
  * * `video`: (optional, default: false) enables video recording for failed tests; videos are saved into `output/videos` folder
2590
2594
  * * `trace`: (optional, default: false) record [tracing information](https://playwright.dev/docs/trace-viewer) with screenshots and snapshots.
2591
2595
  * * `fullPageScreenshots` (optional, default: false) - make full page screenshots on failure.
2592
2596
  * * `uniqueScreenshotNames`: (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites.
2593
- * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
2594
- * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to false.
2597
+ * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to 'session'.
2598
+ * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to 'session'.
2595
2599
  * * `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
2596
2600
  * * `waitForNavigation`: (optional, default: 'load'). When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://github.com/microsoft/playwright/blob/main/docs/api.md#pagewaitfornavigationoptions).
2597
2601
  * * `pressKeyDelay`: (optional, default: '10'). Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
@@ -2896,6 +2900,16 @@ declare namespace CodeceptJS {
2896
2900
  * ```
2897
2901
  * @param srcElement - located by CSS|XPath|strict locator.
2898
2902
  * @param destElement - located by CSS|XPath|strict locator.
2903
+ *
2904
+ *
2905
+ * [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
2906
+ *
2907
+ * ```js
2908
+ * // specify coordinates for source position
2909
+ * I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
2910
+ * ```
2911
+ *
2912
+ * > By default option `force: true` is set
2899
2913
  */
2900
2914
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
2901
2915
  /**
@@ -3153,6 +3167,19 @@ declare namespace CodeceptJS {
3153
3167
  * ```
3154
3168
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3155
3169
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3170
+ *
3171
+ *
3172
+ * [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3173
+ *
3174
+ * Examples:
3175
+ *
3176
+ * ```js
3177
+ * // click on element at position
3178
+ * I.click('canvas', '.model', { position: { x: 20, y: 40 } })
3179
+ *
3180
+ * // make ctrl-click
3181
+ * I.click('.edit', null, { modifiers: ['Ctrl'] } )
3182
+ * ```
3156
3183
  */
3157
3184
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3158
3185
  /**
@@ -3230,6 +3257,16 @@ declare namespace CodeceptJS {
3230
3257
  * ```
3231
3258
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3232
3259
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3260
+ *
3261
+ * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3262
+ *
3263
+ * Examples:
3264
+ *
3265
+ * ```js
3266
+ * // click on element at position
3267
+ * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3268
+ * ```
3269
+ * > ⚠️ To avoid flakiness, option `force: true` is set by default
3233
3270
  */
3234
3271
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3235
3272
  /**
@@ -3245,6 +3282,16 @@ declare namespace CodeceptJS {
3245
3282
  * ```
3246
3283
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3247
3284
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3285
+ *
3286
+ * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3287
+ *
3288
+ * Examples:
3289
+ *
3290
+ * ```js
3291
+ * // click on element at position
3292
+ * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3293
+ * ```
3294
+ * > ⚠️ To avoid flakiness, option `force: true` is set by default
3248
3295
  */
3249
3296
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3250
3297
  /**