@axe-core/watcher 3.14.2 → 3.14.3-next.3d4614ec
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Controller.js +0 -1
- package/dist/Controller.js.map +1 -1
- package/dist/EventForwarder.js +0 -7
- package/dist/EventForwarder.js.map +1 -1
- package/dist/createDebugger.js +0 -15
- package/dist/createDebugger.js.map +1 -1
- package/dist/cypress.d.ts +0 -1
- package/dist/cypress.js +5 -50
- package/dist/cypress.js.map +1 -1
- package/dist/cypressCommands.js +4 -70
- package/dist/cypressCommands.js.map +1 -1
- package/dist/git.js +0 -16
- package/dist/git.js.map +1 -1
- package/dist/playwright.js +1 -13
- package/dist/playwright.js.map +1 -1
- package/dist/playwrightTest.js +0 -15
- package/dist/playwrightTest.js.map +1 -1
- package/dist/playwrightWrapping.js +0 -11
- package/dist/playwrightWrapping.js.map +1 -1
- package/dist/puppeteer.js +1 -13
- package/dist/puppeteer.js.map +1 -1
- package/dist/puppeteerWrapping.js +2 -13
- package/dist/puppeteerWrapping.js.map +1 -1
- package/dist/sendResultsToServer.js +0 -15
- package/dist/sendResultsToServer.js.map +1 -1
- package/dist/utils/constants.js +0 -3
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/initializeSession.js +0 -7
- package/dist/utils/initializeSession.js.map +1 -1
- package/dist/utils/initializeSession.test.js +0 -6
- package/dist/utils/initializeSession.test.js.map +1 -1
- package/dist/utils/mergeChromeArgs.js +0 -40
- package/dist/utils/mergeChromeArgs.js.map +1 -1
- package/dist/utils/mergeChromeArgs.test.js +0 -3
- package/dist/utils/mergeChromeArgs.test.js.map +1 -1
- package/dist/utils/proxyHandlers.js +0 -19
- package/dist/utils/proxyHandlers.js.map +1 -1
- package/dist/utils/proxyHandlers.test.js +0 -1
- package/dist/utils/proxyHandlers.test.js.map +1 -1
- package/dist/utils/readVariables.js +0 -4
- package/dist/utils/readVariables.js.map +1 -1
- package/dist/utils/updateAutoAnalyze.js +0 -5
- package/dist/utils/updateAutoAnalyze.js.map +1 -1
- package/dist/utils/validateAxeRunContext.js +0 -16
- package/dist/utils/validateAxeRunContext.js.map +1 -1
- package/dist/utils/validateAxeRunContext.test.js +0 -3
- package/dist/utils/validateAxeRunContext.test.js.map +1 -1
- package/dist/utils/validateAxeRunOptions.js +0 -51
- package/dist/utils/validateAxeRunOptions.js.map +1 -1
- package/dist/utils/validateAxeRunOptions.test.js +0 -15
- package/dist/utils/validateAxeRunOptions.test.js.map +1 -1
- package/dist/utils/writeExtensionManifest.js +0 -1
- package/dist/utils/writeExtensionManifest.js.map +1 -1
- package/dist/utils/writeVariables.js +1 -14
- package/dist/utils/writeVariables.js.map +1 -1
- package/dist/utils/writeVariables.test.js +0 -1
- package/dist/utils/writeVariables.test.js.map +1 -1
- package/dist/wdio.d.ts +5 -3
- package/dist/wdio.js +0 -20
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.js +1 -12
- package/dist/webdriver.js.map +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +5 -5
package/dist/Controller.js
CHANGED
@@ -49,7 +49,6 @@ class Controller {
|
|
49
49
|
}
|
50
50
|
async analyze({ __Method, __UserRequestedAnalyze = true } = {}) {
|
51
51
|
this.debugLogger(`Analyze: Invoked${__Method ? ` - ${__Method}` : ''}`);
|
52
|
-
// If the user didn't request an analyze, and we're in manual mode, don't do anything.
|
53
52
|
if (this.isStopped && !__UserRequestedAnalyze) {
|
54
53
|
this.debugLogger('Analyze: Skipped', {
|
55
54
|
isStopped: this.isStopped,
|
package/dist/Controller.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Controller.js","sourceRoot":"","sources":["../src/Controller.ts"],"names":[],"mappings":";;;;;AAAA,kFAAyD;AACzD,gFAAwE;AACxE,sEAA6C;AAQ7C,MAAe,UAAU;IASvB,YAAY,EAAE,eAAe,EAAoB;QAHvC,cAAS,GAAG,KAAK,CAAA;QAIzB,IAAI,CAAC,WAAW,GAAG,IAAA,wBAAc,EAAC,eAAe,CAAC,CAAA;IAC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,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAA;QACF,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAA;IACrC,CAAC;CACF;AAED,kBAAe,UAAU,CAAA"}
|
package/dist/EventForwarder.js
CHANGED
@@ -17,17 +17,11 @@ class EventForwarder {
|
|
17
17
|
}
|
18
18
|
};
|
19
19
|
}
|
20
|
-
/**
|
21
|
-
* Forwards all the events registered so far to cypress
|
22
|
-
*/
|
23
20
|
forward(on) {
|
24
21
|
if (Object.keys(this.tasks).length > 0) {
|
25
22
|
on('task', this.tasks);
|
26
23
|
}
|
27
24
|
for (const event of this.emitter.eventNames()) {
|
28
|
-
// We handle `before:browser:launch` event differently than others because
|
29
|
-
// this handler is expected to return launchOptions while other handlers
|
30
|
-
// do not return value.
|
31
25
|
if (event === 'before:browser:launch') {
|
32
26
|
on('before:browser:launch', (browser, launchOptions) => this.emitter
|
33
27
|
.listeners(event)
|
@@ -35,7 +29,6 @@ class EventForwarder {
|
|
35
29
|
}
|
36
30
|
else {
|
37
31
|
for (const listener of this.emitter.listeners(event)) {
|
38
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
39
32
|
on(event, listener);
|
40
33
|
}
|
41
34
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EventForwarder.js","sourceRoot":"","sources":["../src/EventForwarder.ts"],"names":[],"mappings":";;;;;AAYA,kEAAwC;AAExC,MAAM,cAAc;IAKlB;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,uBAAY,EAAE,CAAA;QACjC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,EAAQ,EAAE;YAC7B,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YAC/B,CAAC;iBAAM,CAAC;gBACN,IAA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M,CAAC;gBACN,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;oBAErD,EAAE,CAAC,KAAY,EAAE,QAAQ,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,kBAAe,cAAc,CAAA"}
|
package/dist/createDebugger.js
CHANGED
@@ -4,22 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const debug_1 = __importDefault(require("debug"));
|
7
|
-
/**
|
8
|
-
* The prefix for the debug logger allows users to filter logs by the prefix
|
9
|
-
* using the debug package.
|
10
|
-
*
|
11
|
-
* @example
|
12
|
-
* ```bash
|
13
|
-
* DEBUG=axe-watcher:* yarn test
|
14
|
-
* ```
|
15
|
-
*/
|
16
7
|
const NAMESPACE_PREFIX = 'axe-watcher';
|
17
|
-
/**
|
18
|
-
* Creates a debug logger with the given namespace
|
19
|
-
*
|
20
|
-
* @param namespace The namespace for the debug logger for example: `PlaywrightController` or `PlaywrightWrapping`.
|
21
|
-
* @returns debug instance
|
22
|
-
*/
|
23
8
|
function createDebugger(namespace) {
|
24
9
|
return (0, debug_1.default)(`${NAMESPACE_PREFIX}:${namespace}`);
|
25
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createDebugger.js","sourceRoot":"","sources":["../src/createDebugger.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;
|
1
|
+
{"version":3,"file":"createDebugger.js","sourceRoot":"","sources":["../src/createDebugger.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAWzB,MAAM,gBAAgB,GAAG,aAAa,CAAA;AAStC,SAAS,cAAc,CAAC,SAAiB;IACvC,OAAO,IAAA,eAAK,EAAC,GAAG,gBAAgB,IAAI,SAAS,EAAE,CAAC,CAAA;AAClD,CAAC;AAED,kBAAe,cAAc,CAAA"}
|
package/dist/cypress.d.ts
CHANGED
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 =
|
6
|
+
exports.cypressConfig = void 0;
|
7
7
|
const sendResultsToServer_1 = __importDefault(require("./sendResultsToServer"));
|
8
8
|
const EventForwarder_1 = __importDefault(require("./EventForwarder"));
|
9
9
|
const writeVariables_1 = __importDefault(require("./utils/writeVariables"));
|
@@ -12,12 +12,7 @@ const headlessNotSupportedError_1 = require("./utils/headlessNotSupportedError")
|
|
12
12
|
const mergeChromeArgs_1 = __importDefault(require("./utils/mergeChromeArgs"));
|
13
13
|
const createDebugger_1 = __importDefault(require("./createDebugger"));
|
14
14
|
const debugLogger = (0, createDebugger_1.default)('CypressController');
|
15
|
-
|
16
|
-
/**
|
17
|
-
* Create a Cypress config that uses the axe Watcher extension.
|
18
|
-
*
|
19
|
-
* @param config Cypress config to extend
|
20
|
-
*/
|
15
|
+
const cypressConfigRunFlag = '__AXE_WATCHER_CYPRESS_CONFIG_RUN';
|
21
16
|
const cypressConfig = (config) => {
|
22
17
|
var _a;
|
23
18
|
const { axe, ...userConfig } = config;
|
@@ -25,29 +20,25 @@ const cypressConfig = (config) => {
|
|
25
20
|
const hasWatcherDebug = DEBUG && DEBUG.includes('axe-watcher');
|
26
21
|
(0, writeVariables_1.default)({
|
27
22
|
...axe,
|
28
|
-
// Let the extension know to check for Cypress frames.
|
29
23
|
cypress: true
|
30
24
|
});
|
31
25
|
(0, writeExtensionManifest_1.default)({
|
32
26
|
all_frames: true,
|
33
27
|
exclude_globs: [
|
34
|
-
// Top-level Cypress page.
|
35
28
|
'*/__/#/specs/runner?file=*',
|
36
|
-
// Cypress-specific iframes.
|
37
29
|
'*/__cypress/iframes/*'
|
38
30
|
]
|
39
31
|
});
|
40
32
|
if ((_a = userConfig.e2e) === null || _a === void 0 ? void 0 : _a.env) {
|
41
33
|
userConfig.e2e.env = Object.assign({}, userConfig.e2e.env, {
|
42
|
-
[
|
34
|
+
[cypressConfigRunFlag]: true
|
43
35
|
});
|
44
36
|
}
|
45
37
|
else {
|
46
38
|
userConfig.env = Object.assign({}, userConfig.env, {
|
47
|
-
[
|
39
|
+
[cypressConfigRunFlag]: true
|
48
40
|
});
|
49
41
|
}
|
50
|
-
// TODO: ensure that __AXE_WATCHER_DEBUG is being set in each scenario, including in the e2e.env. See https://github.com/dequelabs/jazzband/pull/1290
|
51
42
|
if (hasWatcherDebug) {
|
52
43
|
userConfig.env = Object.assign({}, userConfig.env, {
|
53
44
|
__AXE_WATCHER_DEBUG: hasWatcherDebug
|
@@ -59,46 +50,17 @@ const cypressConfig = (config) => {
|
|
59
50
|
...userConfig.e2e,
|
60
51
|
async setupNodeEvents(cypressOn, ...args) {
|
61
52
|
var _a, _b;
|
62
|
-
/**
|
63
|
-
* If the user supplies `setupNodeEvents` config and registers events using `on` handler
|
64
|
-
* provided by cypress, the users' custom events are overridden by ours.
|
65
|
-
* @see https://github.com/dequelabs/jazzband/issues/668
|
66
|
-
*
|
67
|
-
* Here instead of registering the same event multiple times either by user or us,
|
68
|
-
* we accumulate the events registered using `EventForwarder` which is proposed by David Sveningsson.
|
69
|
-
* @see https://github.com/cypress-io/cypress/issues/5240#issuecomment-1462214696
|
70
|
-
*
|
71
|
-
* Afterwards, we forward the accumulated events to cypress `on` handler.
|
72
|
-
*/
|
73
53
|
const eventForwarder = new EventForwarder_1.default();
|
74
54
|
const on = eventForwarder.on;
|
75
|
-
/**
|
76
|
-
* If the user supplies their own `setupNodeEvents` config we need to:
|
77
|
-
*
|
78
|
-
* 1. Call the user's `setupNodeEvents` config so that they can register their own events and tasks (if supplied)
|
79
|
-
* 2. Forward the accumulated events to the user's `on` handler.
|
80
|
-
* 3. Store the return value of the user's `setupNodeEvents` config
|
81
|
-
* This is __important__ because the user may have mounted a Cypress plugin that sets
|
82
|
-
* specific `cypress.env` variables that we need to propagate after merging our own events.
|
83
|
-
*
|
84
|
-
* Note: The user __can__ make `setupNodeEvents` async,
|
85
|
-
* ensure we wait for the user's `setupNodeEvents` to resolve.
|
86
|
-
*/
|
87
55
|
const userNodeEventConfig = await ((_b = (_a = userConfig.e2e) === null || _a === void 0 ? void 0 : _a.setupNodeEvents) === null || _b === void 0 ? void 0 : _b.call(_a, on, ...args));
|
88
56
|
if (userNodeEventConfig) {
|
89
|
-
/*
|
90
|
-
The user-provided `setupNodeEvents` returned a new config, which will override the env we set above,
|
91
|
-
so we set it again
|
92
|
-
*/
|
93
57
|
userNodeEventConfig.env = Object.assign({}, userNodeEventConfig.env, {
|
94
|
-
[
|
58
|
+
[cypressConfigRunFlag]: true
|
95
59
|
});
|
96
60
|
}
|
97
61
|
on('task', {
|
98
62
|
__uploadAxeWatcherResults: async ({ results, skipped_url }) => {
|
99
63
|
if (!(results === null || results === void 0 ? void 0 : results.length) && !skipped_url) {
|
100
|
-
// Indicates to Cypress that the event has been handled.
|
101
|
-
// @see https://docs.cypress.io/api/commands/task#Usage
|
102
64
|
return null;
|
103
65
|
}
|
104
66
|
await (0, sendResultsToServer_1.default)({
|
@@ -114,8 +76,6 @@ const cypressConfig = (config) => {
|
|
114
76
|
}
|
115
77
|
});
|
116
78
|
on('before:browser:launch', (browser, launchOptions) => {
|
117
|
-
// We only officially support Chrome, but for backcompat we are permissive and accept other
|
118
|
-
// Chromium-based browsers (eg, "chromium", "chrome:beta", "edge").
|
119
79
|
if (browser.name.startsWith('firefox') ||
|
120
80
|
browser.name.startsWith('electron')) {
|
121
81
|
throw new Error(`The @axe-core/watcher package only supports running in Chrome, but Cypress is configured with browser "${browser.name}". Please refer to our System Requirements for more information: https://docs.deque.com/developer-hub/2/en/dh-system-requirements`);
|
@@ -123,17 +83,12 @@ const cypressConfig = (config) => {
|
|
123
83
|
if (browser.isHeadless && launchOptions.args.includes('--headless')) {
|
124
84
|
throw new headlessNotSupportedError_1.HeadlessNotSupportedError('In Cypress, "--headless=new" became the default headless mode in Cypress version 12.15.0. Ensure your Cypress version is up to date and that you are not using a "before:browser:launch" configuration that adds "--headless" to launchOptions.args.');
|
125
85
|
}
|
126
|
-
// Load the extension. Merge extension args if provided by the user
|
127
86
|
const existingArgs = launchOptions.args;
|
128
87
|
launchOptions.args = (0, mergeChromeArgs_1.default)(existingArgs, {
|
129
88
|
disableOtherExtensions: false
|
130
89
|
});
|
131
90
|
return launchOptions;
|
132
91
|
});
|
133
|
-
/**
|
134
|
-
* Forward the accumulated events to cypress.
|
135
|
-
* For more information, see comment on #44
|
136
|
-
*/
|
137
92
|
eventForwarder.forward(cypressOn);
|
138
93
|
return userNodeEventConfig;
|
139
94
|
}
|
package/dist/cypress.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;AACA,gFAAuD;AACvD,sEAA6C;AAC7C,4EAA2E;AAC3E,4FAA0D;AAC1D,iFAA6E;AAC7E,8EAAqD;AACrD,sEAA6C;AAE7C,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,mBAAmB,CAAC,CAAA;
|
1
|
+
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;AACA,gFAAuD;AACvD,sEAA6C;AAC7C,4EAA2E;AAC3E,4FAA0D;AAC1D,iFAA6E;AAC7E,8EAAqD;AACrD,sEAA6C;AAE7C,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,mBAAmB,CAAC,CAAA;AAEvD,MAAM,oBAAoB,GAAG,kCAAkC,CAAA;AAQxD,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,C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CAAA;oBACvC,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;AAjJY,QAAA,aAAa,iBAiJzB"}
|
package/dist/cypressCommands.js
CHANGED
@@ -1,17 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.WRAPPED_COMMANDS = void 0;
|
4
|
-
const
|
5
|
-
/**
|
6
|
-
* Has the user stopped automatic mode.
|
7
|
-
*
|
8
|
-
* This code runs in the Cypress browser, so we're unable to
|
9
|
-
* read `variables.json` like we do with other integrations.
|
10
|
-
* As result, we need this top-level state for managing
|
11
|
-
* analyze calls created by "wrapped" methods.
|
12
|
-
*/
|
4
|
+
const cypressConfigRunFlag = '__AXE_WATCHER_CYPRESS_CONFIG_RUN';
|
13
5
|
let isStopped = false;
|
14
|
-
/** Commands we wrap to help us identify new page states. */
|
15
6
|
exports.WRAPPED_COMMANDS = [
|
16
7
|
'blur',
|
17
8
|
'check',
|
@@ -31,80 +22,38 @@ exports.WRAPPED_COMMANDS = [
|
|
31
22
|
'visit',
|
32
23
|
'wait'
|
33
24
|
];
|
34
|
-
/** Helper function to log debug messages */
|
35
25
|
const logDebugAxeWatcher = ({ message }) => {
|
36
|
-
// perf: we only want to log debug messages if the env has been set
|
37
|
-
// so it doesn't enqueue a Cypress command
|
38
26
|
if (Cypress.env('__AXE_WATCHER_DEBUG')) {
|
39
27
|
cy.task('__debugAxeWatcher', message, { log: false });
|
40
28
|
}
|
41
29
|
};
|
42
30
|
const shouldAnalyzeLocation = (location) => ['http:', 'https:', 'file:'].includes(location.protocol);
|
43
|
-
|
44
|
-
if (!Cypress.env(cypress_1.cypressConfigRunFlag)) {
|
31
|
+
if (!Cypress.env(cypressConfigRunFlag)) {
|
45
32
|
throw new Error(`Cypress is not configured for axe watcher. Please ensure that axe watcher's cypressConfig() is invoked within Cypress' defineConfig() in your ${Cypress.config('configFile')}. All tests will fail with this error.`);
|
46
33
|
}
|
47
|
-
/**
|
48
|
-
* Wrapped commands queue an axe run before calling the original method. This can seem
|
49
|
-
* a little counter-intuitive, but the reason we do this is so that we make sure we wait
|
50
|
-
* for the existing page state to be analyzed before performing our action.
|
51
|
-
*
|
52
|
-
* We rely on future commands to detect any new page state created by the current command.
|
53
|
-
* The last command that runs relies on the flush to catch the last page state.
|
54
|
-
*/
|
55
34
|
exports.WRAPPED_COMMANDS.forEach(method => Cypress.Commands.overwrite(method, (originalFn, ...args) => {
|
56
35
|
var _a, _b, _c, _d, _e;
|
57
36
|
const currentCommand = cy.state('current');
|
58
37
|
const currentCommandName = currentCommand === null || currentCommand === void 0 ? void 0 : currentCommand.get('name');
|
59
38
|
const currentCommandType = currentCommand === null || currentCommand === void 0 ? void 0 : currentCommand.get('type');
|
60
|
-
// TODO: Remove the feature flag once #1109 is fully resolved.
|
61
39
|
const tryRequerySubject = !!Cypress.env('__AXE_WATCHER_CYPRESS_REQUERY_SUBJECT_AFTER_ANALYZE') &&
|
62
40
|
'getSubjectFromChain' in cy;
|
63
|
-
// Some commands, like "type" call other commands internally, like "click".
|
64
|
-
// We don't want to enqueue a run in these scenarios because it can cause
|
65
|
-
// promises to be returned from commands, which Cypress does not allow.
|
66
|
-
// See: https://github.com/cypress-io/cypress/issues/19086
|
67
41
|
if (currentCommandName && currentCommandName !== method) {
|
68
42
|
return originalFn(...args);
|
69
43
|
}
|
70
|
-
// axeWatcherAnalyze is slow; it's possible for the Cypress subject to become invalidated
|
71
|
-
// while it's running (eg, if the subject is in some sort of remount-loop). To account for
|
72
|
-
// this, we ask Cypress to requery the subject object from the subjectChain before returning
|
73
|
-
// control to the original function.
|
74
|
-
// Note that we don't always have access to an original subjectChain to restore; the API is
|
75
|
-
// only available in Cypress 12+, and even then we might be wrapping a command that doesn't
|
76
|
-
// necessarily operate on a subject.
|
77
|
-
// The "Subject Chain" represents the chain of Cypress selection operations that lead up
|
78
|
-
// to finding the "Subject". cy.getSubjectFromChain() requeries those operations to retrieve
|
79
|
-
// a fresh "Subject" handle.
|
80
44
|
const originalSubject = (_b = (_a = cy).subject) === null || _b === void 0 ? void 0 : _b.call(_a);
|
81
45
|
const originalSubjectChain = (_d = (_c = cy).subjectChain) === null || _d === void 0 ? void 0 : _d.call(_c);
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
83
46
|
let commandChain = cy.window().axeWatcherAnalyze({
|
84
47
|
__Method: method,
|
85
48
|
__UserRequestedAnalyze: false
|
86
49
|
});
|
87
|
-
// This version has issues if the subject is remounting continuously because Cypress
|
88
|
-
// considers the ".then" to be an action (not a query) and so isn't willing to re-run
|
89
|
-
// it if necessary for actionability checks
|
90
|
-
//
|
91
|
-
// commandChain = commandChain.then(() => (cy as CyInternal).getSubjectFromChain!(originalSubjectChain))
|
92
|
-
//
|
93
50
|
if (tryRequerySubject) {
|
94
51
|
const timeout = (_e = args.find(arg => arg === null || arg === void 0 ? void 0 : arg.timeout)) === null || _e === void 0 ? void 0 : _e.timeout;
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
96
52
|
commandChain = commandChain.__axeRestoreSubject(originalSubjectChain, timeout);
|
97
|
-
|
98
|
-
// Setting our own very long timeout here both maintains the original timeout
|
99
|
-
// and correctly attributes an error thrown because of it to the originalFn timing out,
|
100
|
-
// rather than to our wrapper.
|
101
|
-
commandChain.then({ timeout: 999999 }, refreshedSubject => originalFn(
|
102
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
103
|
-
...updateSubject(args, currentCommandType, refreshedSubject)));
|
53
|
+
commandChain.then({ timeout: 999999 }, refreshedSubject => originalFn(...updateSubject(args, currentCommandType, refreshedSubject)));
|
104
54
|
}
|
105
55
|
else {
|
106
56
|
commandChain
|
107
|
-
// Set the subject back to the previous subject
|
108
57
|
.then(() => originalSubject)
|
109
58
|
.then(() => originalFn(...args));
|
110
59
|
}
|
@@ -117,15 +66,8 @@ function updateSubject(args, commandType, refreshedSubject) {
|
|
117
66
|
return [refreshedSubject, ...args.slice(1)];
|
118
67
|
}
|
119
68
|
}
|
120
|
-
Cypress.Commands.addQuery(
|
121
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
122
|
-
'__axeRestoreSubject',
|
123
|
-
// This must be a regular function because timeouts rely on `this`
|
124
|
-
// https://docs.cypress.io/api/cypress-api/custom-queries#Arguments
|
125
|
-
function (subjectChain, timeout) {
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
69
|
+
Cypress.Commands.addQuery('__axeRestoreSubject', function (subjectChain, timeout) {
|
127
70
|
this.set('timeout', timeout);
|
128
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
129
71
|
this.set('onFail', (err) => {
|
130
72
|
const runner = cy.state('runnable');
|
131
73
|
err.codeFrame = runner.invocationDetails;
|
@@ -159,7 +101,6 @@ function axeWatcherFlushCommand() {
|
|
159
101
|
});
|
160
102
|
}
|
161
103
|
const doesCypressCommandExist = (commandName) => {
|
162
|
-
//@ts-expect-error - Property 'cy' does not exist on type 'Cypress & CyEventEmitter'.ts(2339)
|
163
104
|
return !!Cypress.cy[commandName];
|
164
105
|
};
|
165
106
|
function axeWatcherAnalyzeCommand({ __Method, __UserRequestedAnalyze = true } = {}) {
|
@@ -171,7 +112,6 @@ function axeWatcherAnalyzeCommand({ __Method, __UserRequestedAnalyze = true } =
|
|
171
112
|
if (!shouldAnalyzeLocation(win.location)) {
|
172
113
|
return Promise.resolve({ message: `Skipped - Invalid protocol` });
|
173
114
|
}
|
174
|
-
// If the user didn't request an analyze, and we're in manual mode, don't do anything.
|
175
115
|
if (isStopped && !userRequestedAnalyze) {
|
176
116
|
return Promise.resolve({ message: `Skipped (Manual mode)` });
|
177
117
|
}
|
@@ -226,17 +166,11 @@ function axeWatcherStopCommand() {
|
|
226
166
|
});
|
227
167
|
});
|
228
168
|
}
|
229
|
-
// Deprecated name; conflicts with @axe-devtools/cypress, should only be
|
230
|
-
// added if we don't see the other one already. Cypress uses the last-registered
|
231
|
-
// command, so this means that devtools will "win" the conflict.
|
232
169
|
if (!doesCypressCommandExist('axeAnalyze')) {
|
233
170
|
Cypress.Commands.add('axeAnalyze', axeWatcherAnalyzeCommand);
|
234
171
|
}
|
235
|
-
/** Deprecated: Replaced with `axeWatcherFlush` */
|
236
172
|
Cypress.Commands.add('axeFlush', axeWatcherFlushCommand);
|
237
|
-
/** Deprecated: Replaced with `axeWatcherStop` */
|
238
173
|
Cypress.Commands.add('axeStop', axeWatcherStopCommand);
|
239
|
-
/** Deprecated: Replaced with `axeWatcherStart` */
|
240
174
|
Cypress.Commands.add('axeStart', axeWatcherStartCommand);
|
241
175
|
Cypress.Commands.add('axeWatcherAnalyze', axeWatcherAnalyzeCommand);
|
242
176
|
Cypress.Commands.add('axeWatcherStart', axeWatcherStartCommand);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cypressCommands.js","sourceRoot":"","sources":["../src/cypressCommands.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"cypressCommands.js","sourceRoot":"","sources":["../src/cypressCommands.ts"],"names":[],"mappings":";;;AAYA,MAAM,oBAAoB,GAAG,kCAAkC,CAAA;AAyG/D,IAAI,SAAS,GAAG,KAAK,CAAA;AAKR,QAAA,gBAAgB,GAAiC;IAC5D,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,gBAAgB;IAChB,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;CACP,CAAA;AAQD,MAAM,kBAAkB,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BAAmB,EAAE,wBAAwB,CAAC,CAAA;AACnE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAA;AAC/D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAA;AAC7D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAA"}
|
package/dist/git.js
CHANGED
@@ -2,12 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getTag = exports.isDirty = exports.getCommitInfo = exports.getRemoteURL = exports.parseDefaultFromShowRemoteOutput = exports.getDefaultBranchName = exports.getBranchName = exports.isRepository = void 0;
|
4
4
|
const child_process_1 = require("child_process");
|
5
|
-
/** Check if the given `dir` is contained by a Git repository. */
|
6
5
|
const isRepository = (dir = process.cwd()) => {
|
7
6
|
try {
|
8
7
|
(0, child_process_1.execSync)('git rev-parse --is-inside-work-tree', {
|
9
8
|
cwd: dir,
|
10
|
-
// Prevent printing "fatal: not a git repository".
|
11
9
|
stdio: 'ignore'
|
12
10
|
});
|
13
11
|
return true;
|
@@ -17,12 +15,10 @@ const isRepository = (dir = process.cwd()) => {
|
|
17
15
|
}
|
18
16
|
};
|
19
17
|
exports.isRepository = isRepository;
|
20
|
-
/** Get the current branch name. */
|
21
18
|
const getBranchName = (dir = process.cwd()) => {
|
22
19
|
try {
|
23
20
|
return (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', {
|
24
21
|
cwd: dir,
|
25
|
-
// Ignore stderr to prevent printing "fatal: not a git repository" in tests.
|
26
22
|
stdio: ['ignore', 'pipe', 'ignore']
|
27
23
|
})
|
28
24
|
.toString()
|
@@ -33,7 +29,6 @@ const getBranchName = (dir = process.cwd()) => {
|
|
33
29
|
}
|
34
30
|
};
|
35
31
|
exports.getBranchName = getBranchName;
|
36
|
-
/** Get the default branch name. */
|
37
32
|
const getDefaultBranchName = (dir = process.cwd()) => {
|
38
33
|
try {
|
39
34
|
const stdout = (0, child_process_1.execSync)('git symbolic-ref --short refs/remotes/origin/HEAD', {
|
@@ -47,17 +42,11 @@ const getDefaultBranchName = (dir = process.cwd()) => {
|
|
47
42
|
}
|
48
43
|
};
|
49
44
|
exports.getDefaultBranchName = getDefaultBranchName;
|
50
|
-
/**
|
51
|
-
* Parse the default branch name from the output of `git symbolic-ref --short refs/remotes/origin/HEAD`.
|
52
|
-
* @param output The output of the command. e.g. 'origin/develop'.
|
53
|
-
* @private Exported only for testing.
|
54
|
-
*/
|
55
45
|
const parseDefaultFromShowRemoteOutput = (output) => {
|
56
46
|
const match = output.match(/origin\/(.+)/);
|
57
47
|
return match ? match[1] : null;
|
58
48
|
};
|
59
49
|
exports.parseDefaultFromShowRemoteOutput = parseDefaultFromShowRemoteOutput;
|
60
|
-
/** Get the repository's remote URL. */
|
61
50
|
const getRemoteURL = (dir = process.cwd()) => {
|
62
51
|
try {
|
63
52
|
return (0, child_process_1.execSync)('git config --get remote.origin.url', {
|
@@ -72,11 +61,8 @@ const getRemoteURL = (dir = process.cwd()) => {
|
|
72
61
|
}
|
73
62
|
};
|
74
63
|
exports.getRemoteURL = getRemoteURL;
|
75
|
-
/** Get info on the most recent commit. */
|
76
64
|
const getCommitInfo = (dir = process.cwd()) => {
|
77
65
|
try {
|
78
|
-
// %s=subject (message), %H=hash, %an=author name, %ae=author email, %n=newline
|
79
|
-
// See https://git-scm.com/docs/git-show#_pretty_formats
|
80
66
|
const stdout = (0, child_process_1.execSync)('git show --no-patch --format="%s%n%H%n%an%n%ae"', {
|
81
67
|
cwd: dir,
|
82
68
|
stdio: ['ignore', 'pipe', 'ignore']
|
@@ -89,7 +75,6 @@ const getCommitInfo = (dir = process.cwd()) => {
|
|
89
75
|
}
|
90
76
|
};
|
91
77
|
exports.getCommitInfo = getCommitInfo;
|
92
|
-
/** Check if the repository contains unstaged changes. */
|
93
78
|
const isDirty = (dir = process.cwd()) => {
|
94
79
|
try {
|
95
80
|
const stdout = (0, child_process_1.execSync)('git status --short', {
|
@@ -103,7 +88,6 @@ const isDirty = (dir = process.cwd()) => {
|
|
103
88
|
}
|
104
89
|
};
|
105
90
|
exports.isDirty = isDirty;
|
106
|
-
/** Get the tag name. */
|
107
91
|
const getTag = (dir = process.cwd()) => {
|
108
92
|
try {
|
109
93
|
return (0, child_process_1.execSync)('git describe --tags --exact', {
|
package/dist/git.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;AAGjC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAW,EAAE;IAC3D,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,qCAAqC,EAAE;YAC9C,GAAG,EAAE,GAAG;YAER,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAXY,QAAA,YAAY,gBAWxB;AAGM,MAAM,aAAa,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAiB,EAAE;IAClE,IAAI,CAAC;QACH,OAAO,IAAA,wBAAQ,EAAC,iCAAiC,EAAE;YACjD,GAAG,EAAE,GAAG;YAER,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;SACpC,CAAC;aACC,QAAQ,EAAE;aACV,IAAI,EAAE,CAAA;IACX,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAZY,QAAA,aAAa,iBAYzB;AAGM,MAAM,oBAAoB,GAAG,CAAC,GAA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,11 +9,6 @@ const Controller_1 = __importDefault(require("./Controller"));
|
|
9
9
|
const headlessNotSupportedError_1 = require("./utils/headlessNotSupportedError");
|
10
10
|
const mergeChromeArgs_1 = __importDefault(require("./utils/mergeChromeArgs"));
|
11
11
|
const writeVariables_1 = __importDefault(require("./utils/writeVariables"));
|
12
|
-
/**
|
13
|
-
* Creates a Playwright config that uses axe extension
|
14
|
-
*
|
15
|
-
* @param opts Playwright config to extend
|
16
|
-
*/
|
17
12
|
function playwrightConfig(opts) {
|
18
13
|
const { axe, ...config } = opts;
|
19
14
|
let { args = [] } = config;
|
@@ -41,14 +36,7 @@ class PlaywrightController extends Controller_1.default {
|
|
41
36
|
}
|
42
37
|
}
|
43
38
|
exports.PlaywrightController = PlaywrightController;
|
44
|
-
|
45
|
-
* @deprecated `wrapPlaywright` is deprecated and may not work as intended. Please use `wrapPlaywrightPage` instead.
|
46
|
-
*/
|
47
|
-
const wrapPlaywright = (
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
49
|
-
browserContext,
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
51
|
-
playwrightController) => {
|
39
|
+
const wrapPlaywright = (browserContext, playwrightController) => {
|
52
40
|
throw new Error(`
|
53
41
|
\`wrapPlaywright\` is deprecated and may not work as intended. Please use \`wrapPlaywrightPage\` instead. Example:\n
|
54
42
|
let page = await browserContext.newPage()
|
package/dist/playwright.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;AAeA,4CAoBC;AAlCD,8DAAqC;AACrC,iFAA6E;AAC7E,8EAAqD;AACrD,4EAA2E;
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;AAeA,4CAoBC;AAlCD,8DAAqC;AACrC,iFAA6E;AAC7E,8EAAqD;AACrD,4EAA2E;AAW3E,SAAgB,gBA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value: true });
|
|
6
6
|
const playwright_1 = require("./playwright");
|
7
7
|
const mergeChromeArgs_1 = __importDefault(require("./utils/mergeChromeArgs"));
|
8
8
|
const writeVariables_1 = __importDefault(require("./utils/writeVariables"));
|
9
|
-
/**
|
10
|
-
* Configure `@playwright/test` for usage with axe Watcher and return wrapped `test` and `expect` functions.
|
11
|
-
*
|
12
|
-
* @param options Options for configuring Playwright and @axe-core/watcher
|
13
|
-
* @see https://playwright.dev/docs/api/class-test#test-call
|
14
|
-
* @see https://playwright.dev/docs/api/class-test#test-expect
|
15
|
-
*/
|
16
9
|
const playwrightTest = (options) => {
|
17
10
|
let controller = null;
|
18
11
|
const { axe, ...config } = options;
|
19
|
-
// We must lazily require the `@playwright/test` package, as
|
20
|
-
// users of other platforms won't have it installed.
|
21
12
|
let base;
|
22
13
|
let chromium;
|
23
14
|
try {
|
24
|
-
// eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports
|
25
15
|
;
|
26
16
|
({ test: base, chromium } = require('@playwright/test'));
|
27
17
|
}
|
@@ -30,11 +20,6 @@ const playwrightTest = (options) => {
|
|
30
20
|
}
|
31
21
|
(0, writeVariables_1.default)(axe);
|
32
22
|
const test = base.extend({
|
33
|
-
// Playwright requires destructing the context object. Removing it yields:
|
34
|
-
//
|
35
|
-
// Error: First argument must use the object destructuring pattern:
|
36
|
-
//
|
37
|
-
// eslint-disable-next-line no-empty-pattern
|
38
23
|
context: async ({}, use) => {
|
39
24
|
const context = await chromium.launchPersistentContext('', {
|
40
25
|
...config,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"playwrightTest.js","sourceRoot":"","sources":["../src/playwrightTest.ts"],"names":[],"mappings":";;;;;AAUA,6CAIqB;AACrB,8EAAqD;AACrD,4EAAmD;
|
1
|
+
{"version":3,"file":"playwrightTest.js","sourceRoot":"","sources":["../src/playwrightTest.ts"],"names":[],"mappings":";;;;;AAUA,6CAIqB;AACrB,8EAAqD;AACrD,4EAAmD;AAoB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