codeceptjs 3.2.0 → 3.2.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 +11 -2
- package/docs/build/Playwright.js +5 -10
- package/docs/build/Puppeteer.js +1 -1
- package/docs/changelog.md +11 -2
- package/docs/plugins.md +2 -2
- package/lib/helper/Playwright.js +5 -10
- package/lib/helper/Puppeteer.js +1 -1
- package/lib/plugin/retryFailedStep.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
## 3.2.1
|
|
2
|
+
|
|
3
|
+
> ♻️ This release fixes hanging of tests by reducing timeouts for automatic retries on failures.
|
|
4
|
+
|
|
5
|
+
* [retryFailedStep plugin] **New Defaults**: retries steps up to 3 times with factor of 1.5 (previously 5 with factor 2)
|
|
6
|
+
* [Playwright] - disabled retry on failed context actions (not needed anymore)
|
|
7
|
+
* [Puppeteer] - reduced retries on context failures to 3 times.
|
|
8
|
+
* [Playwright] Handling `crash` event to automatically close crashed pages.
|
|
9
|
+
|
|
1
10
|
## 3.2.0
|
|
2
11
|
|
|
3
12
|
🛩️ Features:
|
|
4
13
|
|
|
5
|
-
**Timeouts implemented**
|
|
14
|
+
**[Timeouts](https://codecept.io/advanced/#timeout) implemented**
|
|
6
15
|
* global timeouts (via `timeout` config option).
|
|
7
|
-
* _Breaking change:_ timeout option expects **timeout in seconds**, not in
|
|
16
|
+
* _Breaking change:_ timeout option expects **timeout in seconds**, not in milliseconds as it was previously.
|
|
8
17
|
* test timeouts (via `Scenario` and `Feature` options)
|
|
9
18
|
* _Breaking change:_ `Feature().timeout()` and `Scenario().timeout()` calls has no effect and are deprecated
|
|
10
19
|
|
package/docs/build/Playwright.js
CHANGED
|
@@ -355,16 +355,6 @@ class Playwright extends Helper {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
async _before() {
|
|
358
|
-
recorder.retry({
|
|
359
|
-
retries: 5,
|
|
360
|
-
when: err => {
|
|
361
|
-
if (!err || typeof (err.message) !== 'string') {
|
|
362
|
-
return false;
|
|
363
|
-
}
|
|
364
|
-
// ignore context errors
|
|
365
|
-
return err.message.includes('context');
|
|
366
|
-
},
|
|
367
|
-
});
|
|
368
358
|
if (this.options.restart && !this.options.manualStart) await this._startBrowser();
|
|
369
359
|
if (!this.isRunning && !this.options.manualStart) await this._startBrowser();
|
|
370
360
|
|
|
@@ -585,6 +575,11 @@ class Playwright extends Helper {
|
|
|
585
575
|
this.page = page;
|
|
586
576
|
if (!page) return;
|
|
587
577
|
page.setDefaultNavigationTimeout(this.options.getPageTimeout);
|
|
578
|
+
|
|
579
|
+
page.on('crash', async () => {
|
|
580
|
+
console.log('ERROR: Page has crashed, closing page!');
|
|
581
|
+
await page.close();
|
|
582
|
+
});
|
|
588
583
|
this.context = await this.page;
|
|
589
584
|
this.contextLocator = null;
|
|
590
585
|
if (this.options.browser === 'chrome') {
|
package/docs/build/Puppeteer.js
CHANGED
package/docs/changelog.md
CHANGED
|
@@ -7,13 +7,22 @@ layout: Section
|
|
|
7
7
|
|
|
8
8
|
# Releases
|
|
9
9
|
|
|
10
|
+
## 3.2.1
|
|
11
|
+
|
|
12
|
+
> ♻️ This release fixes hanging of tests by reducing timeouts for automatic retries on failures.
|
|
13
|
+
|
|
14
|
+
* [retryFailedStep plugin] **New Defaults**: retries steps up to 3 times with factor of 1.5 (previously 5 with factor 2)
|
|
15
|
+
* **[Playwright]** - disabled retry on failed context actions (not needed anymore)
|
|
16
|
+
* **[Puppeteer]** - reduced retries on context failures to 3 times.
|
|
17
|
+
* **[Playwright]** Handling `crash` event to automatically close crashed pages.
|
|
18
|
+
|
|
10
19
|
## 3.2.0
|
|
11
20
|
|
|
12
21
|
🛩️ Features:
|
|
13
22
|
|
|
14
|
-
**Timeouts implemented**
|
|
23
|
+
**[Timeouts](https://codecept.io/advanced/#timeout) implemented**
|
|
15
24
|
* global timeouts (via `timeout` config option).
|
|
16
|
-
* _Breaking change:_ timeout option expects **timeout in seconds**, not in
|
|
25
|
+
* _Breaking change:_ timeout option expects **timeout in seconds**, not in milliseconds as it was previously.
|
|
17
26
|
* test timeouts (via `Scenario` and `Feature` options)
|
|
18
27
|
* _Breaking change:_ `Feature().timeout()` and `Scenario().timeout()` calls has no effect and are deprecated
|
|
19
28
|
|
package/docs/plugins.md
CHANGED
|
@@ -579,9 +579,9 @@ Run tests with plugin enabled:
|
|
|
579
579
|
|
|
580
580
|
#### Configuration:
|
|
581
581
|
|
|
582
|
-
- `retries` - number of retries (by default
|
|
582
|
+
- `retries` - number of retries (by default 3),
|
|
583
583
|
- `when` - function, when to perform a retry (accepts error as parameter)
|
|
584
|
-
- `factor` - The exponential factor to use. Default is
|
|
584
|
+
- `factor` - The exponential factor to use. Default is 1.5.
|
|
585
585
|
- `minTimeout` - The number of milliseconds before starting the first retry. Default is 1000.
|
|
586
586
|
- `maxTimeout` - The maximum number of milliseconds between two retries. Default is Infinity.
|
|
587
587
|
- `randomize` - Randomizes the timeouts by multiplying with a factor between 1 to 2. Default is false.
|
package/lib/helper/Playwright.js
CHANGED
|
@@ -355,16 +355,6 @@ class Playwright extends Helper {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
async _before() {
|
|
358
|
-
recorder.retry({
|
|
359
|
-
retries: 5,
|
|
360
|
-
when: err => {
|
|
361
|
-
if (!err || typeof (err.message) !== 'string') {
|
|
362
|
-
return false;
|
|
363
|
-
}
|
|
364
|
-
// ignore context errors
|
|
365
|
-
return err.message.includes('context');
|
|
366
|
-
},
|
|
367
|
-
});
|
|
368
358
|
if (this.options.restart && !this.options.manualStart) await this._startBrowser();
|
|
369
359
|
if (!this.isRunning && !this.options.manualStart) await this._startBrowser();
|
|
370
360
|
|
|
@@ -578,6 +568,11 @@ class Playwright extends Helper {
|
|
|
578
568
|
this.page = page;
|
|
579
569
|
if (!page) return;
|
|
580
570
|
page.setDefaultNavigationTimeout(this.options.getPageTimeout);
|
|
571
|
+
|
|
572
|
+
page.on('crash', async () => {
|
|
573
|
+
console.log('ERROR: Page has crashed, closing page!');
|
|
574
|
+
await page.close();
|
|
575
|
+
});
|
|
581
576
|
this.context = await this.page;
|
|
582
577
|
this.contextLocator = null;
|
|
583
578
|
if (this.options.browser === 'chrome') {
|
package/lib/helper/Puppeteer.js
CHANGED
|
@@ -2,7 +2,7 @@ const event = require('../event');
|
|
|
2
2
|
const recorder = require('../recorder');
|
|
3
3
|
|
|
4
4
|
const defaultConfig = {
|
|
5
|
-
retries:
|
|
5
|
+
retries: 3,
|
|
6
6
|
defaultIgnoredSteps: [
|
|
7
7
|
'amOnPage',
|
|
8
8
|
'wait*',
|
|
@@ -11,6 +11,7 @@ const defaultConfig = {
|
|
|
11
11
|
'run*',
|
|
12
12
|
'have*',
|
|
13
13
|
],
|
|
14
|
+
factor: 1.5,
|
|
14
15
|
ignoredSteps: [],
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -36,9 +37,9 @@ const defaultConfig = {
|
|
|
36
37
|
*
|
|
37
38
|
* #### Configuration:
|
|
38
39
|
*
|
|
39
|
-
* * `retries` - number of retries (by default
|
|
40
|
+
* * `retries` - number of retries (by default 3),
|
|
40
41
|
* * `when` - function, when to perform a retry (accepts error as parameter)
|
|
41
|
-
* * `factor` - The exponential factor to use. Default is
|
|
42
|
+
* * `factor` - The exponential factor to use. Default is 1.5.
|
|
42
43
|
* * `minTimeout` - The number of milliseconds before starting the first retry. Default is 1000.
|
|
43
44
|
* * `maxTimeout` - The maximum number of milliseconds between two retries. Default is Infinity.
|
|
44
45
|
* * `randomize` - Randomizes the timeouts by multiplying with a factor between 1 to 2. Default is false.
|