@axe-core/watcher 3.16.1-next.c20cf4bb → 3.16.1-next.c21d6032
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/dist/Controller.d.ts +9 -4
- package/dist/Controller.js +147 -86
- package/dist/Controller.js.map +1 -1
- package/dist/cypress.d.ts +1 -0
- package/dist/cypress.js +8 -3
- package/dist/cypress.js.map +1 -1
- package/dist/cypressCommands.d.ts +7 -4
- package/dist/cypressCommands.js +112 -50
- package/dist/cypressCommands.js.map +1 -1
- package/dist/playwright.js +5 -5
- package/dist/playwright.js.map +1 -1
- package/dist/playwrightTest.js +13 -0
- package/dist/playwrightTest.js.map +1 -1
- package/dist/utils/newHeadlessPlaywrightNotSupportedError.d.ts +5 -0
- package/dist/utils/newHeadlessPlaywrightNotSupportedError.js +19 -0
- package/dist/utils/newHeadlessPlaywrightNotSupportedError.js.map +1 -0
- package/dist/utils/validateHeadlessPlaywright.d.ts +7 -0
- package/dist/utils/validateHeadlessPlaywright.js +36 -0
- package/dist/utils/validateHeadlessPlaywright.js.map +1 -0
- package/dist/utils/writeVariables.d.ts +13 -1
- package/dist/utils/writeVariables.js +12 -2
- package/dist/utils/writeVariables.js.map +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +2 -2
package/dist/Controller.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { Debugger } from 'debug';
|
2
|
+
import { type Variables } from './utils/writeVariables';
|
2
3
|
interface ControllerParams {
|
3
4
|
/** The namespace for the debug logger. */
|
4
5
|
debugLoggerName: string;
|
@@ -7,17 +8,21 @@ interface ControllerParams {
|
|
7
8
|
/** Configuration function name. Use for variables assertion */
|
8
9
|
configurationFunction?: string;
|
9
10
|
}
|
11
|
+
interface ControllerActionOptions {
|
12
|
+
timeout?: number;
|
13
|
+
}
|
10
14
|
declare abstract class Controller {
|
11
15
|
protected abstract executeScript<A = unknown, T = void>(fn: string | ((...args: A[]) => Promise<T>), ...args: unknown[]): Promise<T>;
|
12
16
|
protected isStopped: boolean;
|
13
17
|
protected debugLogger: Debugger;
|
18
|
+
protected timeout: Variables['timeout'];
|
14
19
|
constructor({ debugLoggerName, integrationName, configurationFunction }: ControllerParams);
|
15
|
-
start(): Promise<void>;
|
16
|
-
stop(): Promise<void>;
|
20
|
+
start({ timeout }?: ControllerActionOptions): Promise<void>;
|
21
|
+
stop({ timeout }?: ControllerActionOptions): Promise<void>;
|
17
22
|
analyze({ __Method, __UserRequestedAnalyze }?: {
|
18
23
|
__Method?: string;
|
19
24
|
__UserRequestedAnalyze?: boolean;
|
20
|
-
}): Promise<void>;
|
21
|
-
flush(): Promise<void>;
|
25
|
+
}, { timeout }?: ControllerActionOptions): Promise<void>;
|
26
|
+
flush({ timeout }?: ControllerActionOptions): Promise<void>;
|
22
27
|
}
|
23
28
|
export default Controller;
|
package/dist/Controller.js
CHANGED
@@ -12,52 +12,83 @@ class Controller {
|
|
12
12
|
(0, assertVariablesWereWritten_1.assertVariablesWereWritten)(integrationName, configurationFunction);
|
13
13
|
const variables = (0, readVariables_1.default)();
|
14
14
|
this.isStopped = !(variables === null || variables === void 0 ? void 0 : variables.auto_analyze);
|
15
|
+
this.timeout = variables.timeout;
|
15
16
|
this.debugLogger = (0, createDebugger_1.default)(debugLoggerName);
|
16
17
|
}
|
17
|
-
async start() {
|
18
|
+
async start({ timeout } = {}) {
|
18
19
|
this.debugLogger(`Start: Invoked`);
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
20
|
+
let timer = null;
|
21
|
+
await Promise.race([
|
22
|
+
this.executeScript(() => {
|
23
|
+
return new Promise(resolve => {
|
24
|
+
if (!['http:', 'https:', 'file:'].includes(window.location.protocol)) {
|
25
|
+
resolve({ message: 'Clean skipped - invalid protocol' });
|
26
|
+
}
|
27
|
+
const fn = (event) => {
|
28
|
+
window.removeEventListener('axe:manual-mode-clean-done', fn);
|
29
|
+
resolve({ message: event.detail.message });
|
30
|
+
};
|
31
|
+
window.addEventListener('axe:manual-mode-clean-done', fn);
|
32
|
+
const event = new CustomEvent('axe:manual-mode-clean');
|
33
|
+
window.dispatchEvent(event);
|
34
|
+
});
|
35
|
+
}),
|
36
|
+
new Promise((_, reject) => {
|
37
|
+
timer = setTimeout(() => {
|
38
|
+
reject(new Error('Watcher could not start automatic mode. To resolve this problem, adjust your `timeoutStart` property within your configuration or see <DOCS_LINK> for more troubleshooting.'));
|
39
|
+
}, timeout || this.timeout.start);
|
40
|
+
})
|
41
|
+
])
|
42
|
+
.then(result => {
|
43
|
+
this.debugLogger(`Start: ${result.message}`);
|
44
|
+
})
|
45
|
+
.finally(() => {
|
46
|
+
if (timer) {
|
47
|
+
clearTimeout(timer);
|
48
|
+
}
|
49
|
+
this.isStopped = false;
|
32
50
|
});
|
33
|
-
this.debugLogger(`Start: ${result.message}`);
|
34
|
-
this.isStopped = false;
|
35
51
|
}
|
36
|
-
async stop() {
|
52
|
+
async stop({ timeout } = {}) {
|
37
53
|
this.debugLogger(`Stop: Invoked (${this.isStopped ? 'not analyzing' : 'may analyze implicitly'})`);
|
38
54
|
if (this.isStopped) {
|
39
55
|
return Promise.resolve();
|
40
56
|
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
57
|
+
let timer = null;
|
58
|
+
await Promise.race([
|
59
|
+
this.executeScript(() => {
|
60
|
+
if (!['http:', 'https:', 'file:'].includes(window.location.protocol)) {
|
61
|
+
return Promise.resolve({ message: 'Skipped - Invalid protocol' });
|
62
|
+
}
|
63
|
+
return new Promise(resolve => {
|
64
|
+
const fn = (event) => {
|
65
|
+
window.removeEventListener('axe:manual-mode-analyze-done', fn);
|
66
|
+
resolve(event.detail);
|
67
|
+
};
|
68
|
+
window.addEventListener('axe:manual-mode-analyze-done', fn);
|
69
|
+
const event = new CustomEvent('axe:manual-mode-analyze', {
|
70
|
+
detail: { userRequestedAnalyze: false }
|
71
|
+
});
|
72
|
+
window.dispatchEvent(event);
|
53
73
|
});
|
54
|
-
|
55
|
-
|
74
|
+
}),
|
75
|
+
new Promise((_, reject) => {
|
76
|
+
timer = setTimeout(() => {
|
77
|
+
reject(new Error('Watcher could not stop automatic mode. To resolve this problem, adjust your `timeoutStop` property within your configuration or see <DOCS_LINK> for more troubleshooting.'));
|
78
|
+
}, timeout || this.timeout.stop);
|
79
|
+
})
|
80
|
+
])
|
81
|
+
.then(result => {
|
82
|
+
this.debugLogger(`Stop: ${result.message}`);
|
83
|
+
})
|
84
|
+
.finally(() => {
|
85
|
+
if (timer) {
|
86
|
+
clearTimeout(timer);
|
87
|
+
}
|
88
|
+
this.isStopped = true;
|
56
89
|
});
|
57
|
-
this.debugLogger(`Stop: ${result.message}`);
|
58
|
-
this.isStopped = true;
|
59
90
|
}
|
60
|
-
async analyze({ __Method, __UserRequestedAnalyze = true } = {}) {
|
91
|
+
async analyze({ __Method, __UserRequestedAnalyze = true } = {}, { timeout } = {}) {
|
61
92
|
this.debugLogger(`Analyze: Invoked${__Method ? ` - ${__Method}` : ''}`, {
|
62
93
|
isStopped: this.isStopped,
|
63
94
|
userRequestedAnalyze: __UserRequestedAnalyze
|
@@ -69,66 +100,96 @@ class Controller {
|
|
69
100
|
});
|
70
101
|
return;
|
71
102
|
}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
103
|
+
let timer = null;
|
104
|
+
await Promise.race([
|
105
|
+
this.executeScript(({ userRequestedAnalyze, isStopped }) => {
|
106
|
+
if (!['http:', 'https:', 'file:'].includes(window.location.protocol)) {
|
107
|
+
if (userRequestedAnalyze) {
|
108
|
+
return Promise.resolve({
|
109
|
+
message: `Cannot perform analysis - invalid protocol: ${window.location.protocol}`,
|
110
|
+
error: true
|
111
|
+
});
|
112
|
+
}
|
113
|
+
return Promise.resolve({ message: 'Skipped - Invalid protocol' });
|
79
114
|
}
|
80
|
-
return Promise
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
115
|
+
return new Promise(resolve => {
|
116
|
+
const fn = (event) => {
|
117
|
+
window.removeEventListener('axe:manual-mode-analyze-done', fn);
|
118
|
+
resolve(event.detail);
|
119
|
+
};
|
120
|
+
window.addEventListener('axe:manual-mode-analyze-done', fn);
|
121
|
+
const event = new CustomEvent('axe:manual-mode-analyze', {
|
122
|
+
detail: { userRequestedAnalyze, isStopped }
|
123
|
+
});
|
124
|
+
window.dispatchEvent(event);
|
90
125
|
});
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
126
|
+
}, {
|
127
|
+
userRequestedAnalyze: __UserRequestedAnalyze,
|
128
|
+
isStopped: this.isStopped
|
129
|
+
}),
|
130
|
+
new Promise((_, reject) => {
|
131
|
+
timer = setTimeout(() => {
|
132
|
+
reject(new Error('Watcher could not analyze the page state. To resolve this problem, adjust your `timeoutAnalyze` property within your configuration or see <DOCS_LINK> for more troubleshooting.'));
|
133
|
+
}, timeout || this.timeout.analyze);
|
134
|
+
})
|
135
|
+
])
|
136
|
+
.then(result => {
|
137
|
+
this.debugLogger(`Analyze: ${result.message}`);
|
138
|
+
if (result.error) {
|
139
|
+
throw new Error(result.message);
|
140
|
+
}
|
141
|
+
})
|
142
|
+
.finally(() => {
|
143
|
+
if (timer) {
|
144
|
+
clearTimeout(timer);
|
145
|
+
}
|
96
146
|
});
|
97
|
-
this.debugLogger(`Analyze: ${result.message}`);
|
98
|
-
if (result.error) {
|
99
|
-
throw new Error(result.message);
|
100
|
-
}
|
101
147
|
}
|
102
|
-
async flush() {
|
148
|
+
async flush({ timeout } = {}) {
|
103
149
|
this.debugLogger(`Flush: Invoked (${this.isStopped ? 'auto-analysis stopped' : 'may analyze implicitly'})`);
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
150
|
+
let timer = null;
|
151
|
+
await Promise.race([
|
152
|
+
this.executeScript((isStopped) => {
|
153
|
+
if (!['http:', 'https:', 'file:'].includes(window.location.protocol)) {
|
154
|
+
return Promise.resolve([]);
|
155
|
+
}
|
156
|
+
return new Promise(resolve => {
|
157
|
+
const receivedResults = [];
|
158
|
+
const onFlushEnd = () => {
|
159
|
+
window.removeEventListener('axe:flush-end', onFlushEnd);
|
160
|
+
window.removeEventListener('axe:result', onAxeResult);
|
161
|
+
resolve(receivedResults);
|
162
|
+
};
|
163
|
+
const onAxeResult = (e) => {
|
164
|
+
receivedResults.push(...e.detail);
|
165
|
+
};
|
166
|
+
window.addEventListener('axe:result', onAxeResult);
|
167
|
+
window.addEventListener('axe:flush-end', onFlushEnd);
|
168
|
+
const event = new CustomEvent('axe:flush-start', {
|
169
|
+
detail: { isStopped }
|
170
|
+
});
|
171
|
+
window.dispatchEvent(event);
|
122
172
|
});
|
123
|
-
|
173
|
+
}, this.isStopped),
|
174
|
+
new Promise((_, reject) => {
|
175
|
+
timer = setTimeout(() => {
|
176
|
+
reject(new Error('Watcher could not send results to the server. To resolve this problem, adjust your `timeoutFlush` property within your configuration or see <DOCS_LINK> for more troubleshooting.'));
|
177
|
+
}, timeout || this.timeout.flush);
|
178
|
+
})
|
179
|
+
])
|
180
|
+
.then(async (results) => {
|
181
|
+
this.debugLogger(`Flush: Received ${results.length} results`);
|
182
|
+
await (0, sendResultsToServer_1.default)({
|
183
|
+
results,
|
184
|
+
debugLogger: this.debugLogger
|
124
185
|
});
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
186
|
+
this.debugLogger('Flush: Complete');
|
187
|
+
})
|
188
|
+
.finally(() => {
|
189
|
+
if (timer) {
|
190
|
+
clearTimeout(timer);
|
191
|
+
}
|
130
192
|
});
|
131
|
-
this.debugLogger('Flush: Complete');
|
132
193
|
}
|
133
194
|
}
|
134
195
|
exports.default = Controller;
|
package/dist/Controller.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Controller.js","sourceRoot":"","sources":["../src/Controller.ts"],"names":[],"mappings":";;;;;AAAA,0EAAiD;AACjD,gFAAwE;AACxE,sEAA6C;AAE7C,mFAA+E;
|
1
|
+
{"version":3,"file":"Controller.js","sourceRoot":"","sources":["../src/Controller.ts"],"names":[],"mappings":";;;;;AAAA,0EAAiD;AACjD,gFAAwE;AACxE,sEAA6C;AAE7C,mFAA+E;AAgB/E,MAAe,UAAU;IAUvB,YAAY,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,EACJ;QACjB,IAAA,uDAA0B,EAAC,eAAe,EAAE,qBAAqB,CAAC,CAAA;QAClE,MAAM,SAAS,GAAG,IAAA,uBAAa,GAAE,CAAA;QACjC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,CAAA,CAAA;QACzC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAA;QAChC,IAAI,CAAC,WAAW,GAAG,IAAA,wBAAc,EAAC,eAAe,CAAC,CAAA;IACpD,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,KAA8B,EAAE;QAC1D,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAA;QAClC,IAAI,KAAK,GAA0B,IAAI,CAAA;QAEvC,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;gBACtB,OAAO,IAAI,OAAO,CAAsB,OAAO,CAAC,EAAE;oBAChD,IACE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,C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declare const configTimeout = "__AXE_WATCHER_TIMEOUT_CONFIG";
|
2
3
|
export declare const cypressConfigRunFlag = "__AXE_WATCHER_CYPRESS_CONFIG_RUN";
|
3
4
|
export declare const cypressConfigAutoAnalyzeFlag = "__AXE_WATCHER_AUTO_ANALYZE";
|
4
5
|
/**
|
package/dist/cypress.js
CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.cypressConfig = exports.cypressConfigAutoAnalyzeFlag = exports.cypressConfigRunFlag = void 0;
|
6
|
+
exports.cypressConfig = exports.cypressConfigAutoAnalyzeFlag = exports.cypressConfigRunFlag = exports.configTimeout = void 0;
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
8
8
|
const crypto_1 = require("crypto");
|
9
9
|
const constants_1 = require("./utils/constants");
|
@@ -14,8 +14,10 @@ const writeExtensionManifest_1 = __importDefault(require("./utils/writeExtension
|
|
14
14
|
const headlessNotSupportedError_1 = require("./utils/headlessNotSupportedError");
|
15
15
|
const mergeChromeArgs_1 = __importDefault(require("./utils/mergeChromeArgs"));
|
16
16
|
const createDebugger_1 = __importDefault(require("./createDebugger"));
|
17
|
+
const readVariables_1 = __importDefault(require("./utils/readVariables"));
|
17
18
|
const checkUserArgs_1 = require("./utils/checkUserArgs");
|
18
19
|
const debugLogger = (0, createDebugger_1.default)('CypressController');
|
20
|
+
exports.configTimeout = '__AXE_WATCHER_TIMEOUT_CONFIG';
|
19
21
|
exports.cypressConfigRunFlag = '__AXE_WATCHER_CYPRESS_CONFIG_RUN';
|
20
22
|
exports.cypressConfigAutoAnalyzeFlag = '__AXE_WATCHER_AUTO_ANALYZE';
|
21
23
|
const cypressConfig = (config) => {
|
@@ -38,14 +40,17 @@ const cypressConfig = (config) => {
|
|
38
40
|
'*/__cypress/iframes/*'
|
39
41
|
]
|
40
42
|
});
|
43
|
+
const variables = (0, readVariables_1.default)();
|
41
44
|
if ((_a = userConfig.e2e) === null || _a === void 0 ? void 0 : _a.env) {
|
42
45
|
userConfig.e2e.env = Object.assign({}, userConfig.e2e.env, {
|
43
|
-
[exports.cypressConfigRunFlag]: true
|
46
|
+
[exports.cypressConfigRunFlag]: true,
|
47
|
+
[exports.configTimeout]: variables.timeout
|
44
48
|
});
|
45
49
|
}
|
46
50
|
else {
|
47
51
|
userConfig.env = Object.assign({}, userConfig.env, {
|
48
|
-
[exports.cypressConfigRunFlag]: true
|
52
|
+
[exports.cypressConfigRunFlag]: true,
|
53
|
+
[exports.configTimeout]: variables.timeout
|
49
54
|
});
|
50
55
|
}
|
51
56
|
if (hasWatcherDebug) {
|
package/dist/cypress.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;AACA,4CAAmB;AACnB,mCAAmC;AACnC,iDAAwD;AACxD,gFAAuD;AACvD,sEAA6C;AAC7C,4EAA2E;AAC3E,4FAA0D;AAC1D,iFAA6E;AAC7E,8EAAqD;AACrD,sEAA6C;AAC7C,yDAAqD;AAErD,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,mBAAmB,CAAC,CAAA;AAE1C,QAAA,oBAAoB,GAAG,kCAAkC,CAAA;AACzD,QAAA,4BAA4B,GAAG,4BAA4B,CAAA;AAQjE,MAAM,aAAa,GAAG,CAC3B,MAA6C,EACtB,EAAE;;IACzB,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,MAAM,CAAA;IACrC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,GAAG,CAAA;IAC7B,MAAM,eAAe,GAAG,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;IAE9D,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,IA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;wBACpB,OAAO,IAAI,CAAA;oBACb,CAAC;iBACF,CAAC,CAAA;gBAEF,EAAE,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE;oBAGrD,IACE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;wBAClC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EACnC,CAAC;wBACD,MAAM,IAAI,KAAK,CACb,0GAA0G,OAAO,CAAC,IAAI,mIAAmI,CAC1P,CAAA;oBACH,CAAC;oBAED,IAAI,OAAO,CAAC,UAAU,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;wBACpE,MAAM,IAAI,qDAAyB,CACjC,sPAAsP,CACvP,CAAA;oBACH,CAAC;oBAGD,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAA;oBACvC,IAAA,6BAAa,EAAC,YAAY,CAAC,CAAA;oBAC3B,aAAa,CAAC,IAAI,GAAG,IAAA,yBAAe,EAAC,YAAY,EAAE;wBACjD,sBAAsB,EAAE,KAAK;qBAC9B,CAAC,CAAA;oBAEF,OAAO,aAAa,CAAA;gBACtB,CAAC,CAAC,CAAA;gBAMF,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBAEjC,OAAO,mBAAmB,CAAA;YAC5B,CAAC;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAhKY,QAAA,aAAa,iBAgKzB"}
|
@@ -2,7 +2,7 @@ declare global {
|
|
2
2
|
namespace Cypress {
|
3
3
|
interface Chainable {
|
4
4
|
/** Flush the axe-core result queue by sending results to the server. */
|
5
|
-
axeWatcherFlush(): Chainable<void>;
|
5
|
+
axeWatcherFlush(props?: ActionProps): Chainable<void>;
|
6
6
|
/**
|
7
7
|
* Flush the axe-core result queue by sending results to the server.
|
8
8
|
*
|
@@ -13,7 +13,7 @@ declare global {
|
|
13
13
|
axeWatcherAnalyze(params?: {
|
14
14
|
__Method?: string;
|
15
15
|
__UserRequestedAnalyze?: boolean;
|
16
|
-
}): Chainable<void>;
|
16
|
+
}, props?: ActionProps): Chainable<void>;
|
17
17
|
/**
|
18
18
|
* Perform an axe-core analysis.
|
19
19
|
*
|
@@ -26,7 +26,7 @@ declare global {
|
|
26
26
|
/**
|
27
27
|
* Start automatic analysis mode.
|
28
28
|
*/
|
29
|
-
axeWatcherStart(): Chainable<void>;
|
29
|
+
axeWatcherStart(props?: ActionProps): Chainable<void>;
|
30
30
|
/**
|
31
31
|
* Start automatic analysis mode.
|
32
32
|
*
|
@@ -36,7 +36,7 @@ declare global {
|
|
36
36
|
/**
|
37
37
|
* Stop automatic analysis mode.
|
38
38
|
*/
|
39
|
-
axeWatcherStop(): Chainable<void>;
|
39
|
+
axeWatcherStop(props?: ActionProps): Chainable<void>;
|
40
40
|
/**
|
41
41
|
* Stop automatic analysis mode.
|
42
42
|
*
|
@@ -49,4 +49,7 @@ declare global {
|
|
49
49
|
type CypressMethod = keyof Cypress.Chainable;
|
50
50
|
/** Commands we wrap to help us identify new page states. */
|
51
51
|
export declare const WRAPPED_COMMANDS: ReadonlyArray<CypressMethod>;
|
52
|
+
interface ActionProps {
|
53
|
+
timeout?: number;
|
54
|
+
}
|
52
55
|
export {};
|