codeceptjs 3.7.0-beta.1 → 3.7.0-beta.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.
|
@@ -3,6 +3,7 @@ const output = require('../output')
|
|
|
3
3
|
const recorder = require('../recorder')
|
|
4
4
|
const Config = require('../config')
|
|
5
5
|
const { timeouts } = require('../store')
|
|
6
|
+
const debug = require('debug')('codeceptjs:timeout')
|
|
6
7
|
const TIMEOUT_ORDER = require('../step').TIMEOUT_ORDER
|
|
7
8
|
|
|
8
9
|
module.exports = function () {
|
|
@@ -20,6 +21,8 @@ module.exports = function () {
|
|
|
20
21
|
suiteTimeout = []
|
|
21
22
|
let timeoutConfig = Config.get('timeout')
|
|
22
23
|
|
|
24
|
+
debug('config:', timeoutConfig || 'none')
|
|
25
|
+
|
|
23
26
|
if (timeoutConfig) {
|
|
24
27
|
if (!Number.isNaN(+timeoutConfig)) {
|
|
25
28
|
checkForSeconds(timeoutConfig)
|
|
@@ -38,8 +41,10 @@ module.exports = function () {
|
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
|
|
44
|
+
debug('current suite timeout:', suite.totalTimeout || 'none');
|
|
41
45
|
if (suite.totalTimeout) suiteTimeout.push(suite.totalTimeout)
|
|
42
46
|
output.log(`Timeouts: ${suiteTimeout}`)
|
|
47
|
+
debug('active timeouts', suiteTimeout)
|
|
43
48
|
})
|
|
44
49
|
|
|
45
50
|
event.dispatcher.on(event.test.before, test => {
|
|
@@ -81,8 +86,10 @@ module.exports = function () {
|
|
|
81
86
|
if (typeof timeout !== 'number') return
|
|
82
87
|
|
|
83
88
|
if (timeout < 0) {
|
|
89
|
+
debug('Previous steps timed out, setting timeout to 0.01s');
|
|
84
90
|
step.setTimeout(0.01, TIMEOUT_ORDER.testOrSuite)
|
|
85
91
|
} else {
|
|
92
|
+
debug(`Setting timeout ${timeout}ms for step ${step.toCode().trim()}`);
|
|
86
93
|
step.setTimeout(timeout, TIMEOUT_ORDER.testOrSuite)
|
|
87
94
|
}
|
|
88
95
|
})
|
|
@@ -91,7 +98,9 @@ module.exports = function () {
|
|
|
91
98
|
if (typeof timeout === 'number' && !Number.isNaN(timeout)) timeout -= step.duration
|
|
92
99
|
|
|
93
100
|
if (typeof timeout === 'number' && timeout <= 0 && recorder.isRunning()) {
|
|
101
|
+
debug(`step ${step.toCode().trim()} timed out`);
|
|
94
102
|
if (currentTest && currentTest.callback) {
|
|
103
|
+
debug(`Failing test ${currentTest.title} with timeout ${currentTimeout}s`);
|
|
95
104
|
recorder.reset()
|
|
96
105
|
// replace mocha timeout with custom timeout
|
|
97
106
|
currentTest.timeout(0)
|
package/package.json
CHANGED
|
@@ -1772,6 +1772,14 @@ declare namespace CodeceptJS {
|
|
|
1772
1772
|
// @ts-ignore
|
|
1773
1773
|
// @ts-ignore
|
|
1774
1774
|
// @ts-ignore
|
|
1775
|
+
// @ts-ignore
|
|
1776
|
+
// @ts-ignore
|
|
1777
|
+
// @ts-ignore
|
|
1778
|
+
// @ts-ignore
|
|
1779
|
+
// @ts-ignore
|
|
1780
|
+
// @ts-ignore
|
|
1781
|
+
// @ts-ignore
|
|
1782
|
+
// @ts-ignore
|
|
1775
1783
|
type MockServerConfig = {
|
|
1776
1784
|
port?: number;
|
|
1777
1785
|
host?: string;
|
|
@@ -1903,6 +1911,14 @@ declare namespace CodeceptJS {
|
|
|
1903
1911
|
// @ts-ignore
|
|
1904
1912
|
// @ts-ignore
|
|
1905
1913
|
// @ts-ignore
|
|
1914
|
+
// @ts-ignore
|
|
1915
|
+
// @ts-ignore
|
|
1916
|
+
// @ts-ignore
|
|
1917
|
+
// @ts-ignore
|
|
1918
|
+
// @ts-ignore
|
|
1919
|
+
// @ts-ignore
|
|
1920
|
+
// @ts-ignore
|
|
1921
|
+
// @ts-ignore
|
|
1906
1922
|
class MockServer {
|
|
1907
1923
|
/**
|
|
1908
1924
|
* Start the mock server
|
|
@@ -2943,6 +2959,14 @@ declare namespace CodeceptJS {
|
|
|
2943
2959
|
// @ts-ignore
|
|
2944
2960
|
// @ts-ignore
|
|
2945
2961
|
// @ts-ignore
|
|
2962
|
+
// @ts-ignore
|
|
2963
|
+
// @ts-ignore
|
|
2964
|
+
// @ts-ignore
|
|
2965
|
+
// @ts-ignore
|
|
2966
|
+
// @ts-ignore
|
|
2967
|
+
// @ts-ignore
|
|
2968
|
+
// @ts-ignore
|
|
2969
|
+
// @ts-ignore
|
|
2946
2970
|
type PlaywrightConfig = {
|
|
2947
2971
|
url?: string;
|
|
2948
2972
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6326,6 +6350,14 @@ declare namespace CodeceptJS {
|
|
|
6326
6350
|
// @ts-ignore
|
|
6327
6351
|
// @ts-ignore
|
|
6328
6352
|
// @ts-ignore
|
|
6353
|
+
// @ts-ignore
|
|
6354
|
+
// @ts-ignore
|
|
6355
|
+
// @ts-ignore
|
|
6356
|
+
// @ts-ignore
|
|
6357
|
+
// @ts-ignore
|
|
6358
|
+
// @ts-ignore
|
|
6359
|
+
// @ts-ignore
|
|
6360
|
+
// @ts-ignore
|
|
6329
6361
|
type PuppeteerConfig = {
|
|
6330
6362
|
url: string;
|
|
6331
6363
|
basicAuth?: any;
|
|
@@ -8139,6 +8171,14 @@ declare namespace CodeceptJS {
|
|
|
8139
8171
|
// @ts-ignore
|
|
8140
8172
|
// @ts-ignore
|
|
8141
8173
|
// @ts-ignore
|
|
8174
|
+
// @ts-ignore
|
|
8175
|
+
// @ts-ignore
|
|
8176
|
+
// @ts-ignore
|
|
8177
|
+
// @ts-ignore
|
|
8178
|
+
// @ts-ignore
|
|
8179
|
+
// @ts-ignore
|
|
8180
|
+
// @ts-ignore
|
|
8181
|
+
// @ts-ignore
|
|
8142
8182
|
type RESTConfig = {
|
|
8143
8183
|
endpoint?: string;
|
|
8144
8184
|
prettyPrintJson?: boolean;
|
|
@@ -9290,6 +9330,14 @@ declare namespace CodeceptJS {
|
|
|
9290
9330
|
// @ts-ignore
|
|
9291
9331
|
// @ts-ignore
|
|
9292
9332
|
// @ts-ignore
|
|
9333
|
+
// @ts-ignore
|
|
9334
|
+
// @ts-ignore
|
|
9335
|
+
// @ts-ignore
|
|
9336
|
+
// @ts-ignore
|
|
9337
|
+
// @ts-ignore
|
|
9338
|
+
// @ts-ignore
|
|
9339
|
+
// @ts-ignore
|
|
9340
|
+
// @ts-ignore
|
|
9293
9341
|
type WebDriverConfig = {
|
|
9294
9342
|
url: string;
|
|
9295
9343
|
browser: string;
|
package/typings/types.d.ts
CHANGED
|
@@ -1799,6 +1799,14 @@ declare namespace CodeceptJS {
|
|
|
1799
1799
|
// @ts-ignore
|
|
1800
1800
|
// @ts-ignore
|
|
1801
1801
|
// @ts-ignore
|
|
1802
|
+
// @ts-ignore
|
|
1803
|
+
// @ts-ignore
|
|
1804
|
+
// @ts-ignore
|
|
1805
|
+
// @ts-ignore
|
|
1806
|
+
// @ts-ignore
|
|
1807
|
+
// @ts-ignore
|
|
1808
|
+
// @ts-ignore
|
|
1809
|
+
// @ts-ignore
|
|
1802
1810
|
type MockServerConfig = {
|
|
1803
1811
|
port?: number;
|
|
1804
1812
|
host?: string;
|
|
@@ -1930,6 +1938,14 @@ declare namespace CodeceptJS {
|
|
|
1930
1938
|
// @ts-ignore
|
|
1931
1939
|
// @ts-ignore
|
|
1932
1940
|
// @ts-ignore
|
|
1941
|
+
// @ts-ignore
|
|
1942
|
+
// @ts-ignore
|
|
1943
|
+
// @ts-ignore
|
|
1944
|
+
// @ts-ignore
|
|
1945
|
+
// @ts-ignore
|
|
1946
|
+
// @ts-ignore
|
|
1947
|
+
// @ts-ignore
|
|
1948
|
+
// @ts-ignore
|
|
1933
1949
|
class MockServer {
|
|
1934
1950
|
/**
|
|
1935
1951
|
* Start the mock server
|
|
@@ -3036,6 +3052,14 @@ declare namespace CodeceptJS {
|
|
|
3036
3052
|
// @ts-ignore
|
|
3037
3053
|
// @ts-ignore
|
|
3038
3054
|
// @ts-ignore
|
|
3055
|
+
// @ts-ignore
|
|
3056
|
+
// @ts-ignore
|
|
3057
|
+
// @ts-ignore
|
|
3058
|
+
// @ts-ignore
|
|
3059
|
+
// @ts-ignore
|
|
3060
|
+
// @ts-ignore
|
|
3061
|
+
// @ts-ignore
|
|
3062
|
+
// @ts-ignore
|
|
3039
3063
|
type PlaywrightConfig = {
|
|
3040
3064
|
url?: string;
|
|
3041
3065
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6570,6 +6594,14 @@ declare namespace CodeceptJS {
|
|
|
6570
6594
|
// @ts-ignore
|
|
6571
6595
|
// @ts-ignore
|
|
6572
6596
|
// @ts-ignore
|
|
6597
|
+
// @ts-ignore
|
|
6598
|
+
// @ts-ignore
|
|
6599
|
+
// @ts-ignore
|
|
6600
|
+
// @ts-ignore
|
|
6601
|
+
// @ts-ignore
|
|
6602
|
+
// @ts-ignore
|
|
6603
|
+
// @ts-ignore
|
|
6604
|
+
// @ts-ignore
|
|
6573
6605
|
type PuppeteerConfig = {
|
|
6574
6606
|
url: string;
|
|
6575
6607
|
basicAuth?: any;
|
|
@@ -8519,6 +8551,14 @@ declare namespace CodeceptJS {
|
|
|
8519
8551
|
// @ts-ignore
|
|
8520
8552
|
// @ts-ignore
|
|
8521
8553
|
// @ts-ignore
|
|
8554
|
+
// @ts-ignore
|
|
8555
|
+
// @ts-ignore
|
|
8556
|
+
// @ts-ignore
|
|
8557
|
+
// @ts-ignore
|
|
8558
|
+
// @ts-ignore
|
|
8559
|
+
// @ts-ignore
|
|
8560
|
+
// @ts-ignore
|
|
8561
|
+
// @ts-ignore
|
|
8522
8562
|
type RESTConfig = {
|
|
8523
8563
|
endpoint?: string;
|
|
8524
8564
|
prettyPrintJson?: boolean;
|
|
@@ -9730,6 +9770,14 @@ declare namespace CodeceptJS {
|
|
|
9730
9770
|
// @ts-ignore
|
|
9731
9771
|
// @ts-ignore
|
|
9732
9772
|
// @ts-ignore
|
|
9773
|
+
// @ts-ignore
|
|
9774
|
+
// @ts-ignore
|
|
9775
|
+
// @ts-ignore
|
|
9776
|
+
// @ts-ignore
|
|
9777
|
+
// @ts-ignore
|
|
9778
|
+
// @ts-ignore
|
|
9779
|
+
// @ts-ignore
|
|
9780
|
+
// @ts-ignore
|
|
9733
9781
|
type WebDriverConfig = {
|
|
9734
9782
|
url: string;
|
|
9735
9783
|
browser: string;
|