@axe-core/watcher 3.23.0-next.18d4dfe1 → 3.23.0-next.29fbaa6b
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 +0 -1
- package/dist/Controller.js +0 -7
- package/dist/Controller.js.map +1 -1
- package/dist/cypress/cypress.js +4 -11
- package/dist/cypress/cypress.js.map +1 -1
- package/dist/cypressCommandsDeprecated.d.ts +1 -0
- package/dist/cypressCommandsDeprecated.js +25 -0
- package/dist/cypressCommandsDeprecated.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/playwright/playwright.d.ts +8 -3
- package/dist/playwright/playwright.js.map +1 -1
- package/dist/playwright-test/playwrightTest.d.ts +4 -4
- package/dist/playwright-test/playwrightTest.js +2 -1
- package/dist/playwright-test/playwrightTest.js.map +1 -1
- package/dist/sendResultsToServer.js +12 -4
- package/dist/sendResultsToServer.js.map +1 -1
- package/dist/utils/initializeSession.js +6 -3
- package/dist/utils/initializeSession.js.map +1 -1
- package/dist/utils/shouldUseEnvProxy.d.ts +5 -0
- package/dist/utils/shouldUseEnvProxy.js +22 -0
- package/dist/utils/shouldUseEnvProxy.js.map +1 -0
- package/dist/utils/sync-fetch-worker.mjs +136 -43
- package/dist/utils/sync-fetch.d.ts +1 -1
- package/dist/utils/sync-fetch.js +52 -44
- package/dist/utils/sync-fetch.js.map +1 -1
- package/dist/utils/test-constants.d.ts +14 -0
- package/dist/utils/test-constants.js +12 -0
- package/dist/utils/test-constants.js.map +1 -0
- package/dist/utils/writeVariables.d.ts +5 -0
- package/dist/utils/writeVariables.js +2 -4
- package/dist/utils/writeVariables.js.map +1 -1
- package/extension/axe-versions/axe-core@4.11.0/axe.min.js +12 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/README.md +9 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/_template.json +1131 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/da.json +799 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/de.json +1127 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/el.json +1069 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/es.json +790 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/eu.json +789 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/fr.json +994 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/he.json +1017 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/it.json +1108 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/ja.json +1127 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/ko.json +1003 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/nl.json +48 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/no_NB.json +799 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/pl.json +1109 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/pt_BR.json +970 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/pt_PT.json +1123 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/ru.json +1127 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/zh_CN.json +1116 -0
- package/extension/axe-versions/axe-core@4.11.0/locales/zh_TW.json +1108 -0
- package/extension/axe-versions-mapper.js +2 -0
- package/extension/axe.js +1 -1
- package/extension/axe.js.LICENSE.txt +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +78 -8
- package/dist/shared/strings.d.ts +0 -1
- package/dist/shared/strings.js +0 -5
- package/dist/shared/strings.js.map +0 -1
|
@@ -6,72 +6,165 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { isMainThread, workerData } from 'node:worker_threads'
|
|
9
|
-
import { EnvHttpProxyAgent } from 'undici'
|
|
9
|
+
import { EnvHttpProxyAgent, getGlobalDispatcher } from 'undici'
|
|
10
10
|
|
|
11
11
|
if (isMainThread) {
|
|
12
12
|
throw new Error('This script should only be run as a worker thread')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The core Error type used when this worker fails.
|
|
17
|
+
* It is the only error to exit the message bus.
|
|
18
|
+
* Any other errors are causes of this one.
|
|
19
|
+
*/
|
|
20
|
+
class FetchWorkerError extends Error {
|
|
21
|
+
constructor(context) {
|
|
22
|
+
super('FetchWorkerError')
|
|
23
|
+
this.name = 'FetchWorkerError'
|
|
24
|
+
this.context = context
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A specific error used when we encounter an error that
|
|
30
|
+
* can not be serialized.
|
|
31
|
+
*/
|
|
32
|
+
class OverrideError extends Error {
|
|
33
|
+
constructor(message, sourceName) {
|
|
34
|
+
super(message)
|
|
35
|
+
this.name = 'OverrideError'
|
|
36
|
+
this.sourceName = sourceName
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Attempt to sanitize a URL by redacting sensitive information.
|
|
42
|
+
* If the URL cannot be parsed, it is returned as-is.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*
|
|
46
|
+
* @param {string} url - The URL to sanitize.
|
|
47
|
+
*
|
|
48
|
+
* @returns {string} The sanitized URL with sensitive information redacted.
|
|
49
|
+
*/
|
|
50
|
+
const sanitizeUrl = url => {
|
|
51
|
+
try {
|
|
52
|
+
const parsedUrl = new URL(url)
|
|
53
|
+
|
|
54
|
+
if (parsedUrl.username !== '') {
|
|
55
|
+
parsedUrl.username = 'REDACTED'
|
|
56
|
+
}
|
|
57
|
+
if (parsedUrl.password !== '') {
|
|
58
|
+
parsedUrl.password = 'REDACTED'
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return parsedUrl.toString()
|
|
62
|
+
} catch {
|
|
63
|
+
return url
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Tested source in ./shouldUseEnvProxy.ts
|
|
69
|
+
* This has to be duplicated since we can't import here and
|
|
70
|
+
* it is ran in a worker thread. Once Node 22+ is our
|
|
71
|
+
* minimum, we can convert this file to TS since that has
|
|
72
|
+
* erasable types.
|
|
73
|
+
*/
|
|
74
|
+
export const shouldUseEnvProxy = function () {
|
|
75
|
+
const envVars = [
|
|
76
|
+
'AXE_WATCHER_USE_ENV_PROXY',
|
|
77
|
+
'AXE_USE_ENV_PROXY',
|
|
78
|
+
'NODE_USE_ENV_PROXY'
|
|
79
|
+
]
|
|
17
80
|
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
81
|
+
for (const envVar of envVars) {
|
|
82
|
+
const value = (
|
|
83
|
+
process.env[envVar.toLowerCase()] ?? process.env[envVar]
|
|
84
|
+
)?.trim()
|
|
85
|
+
|
|
86
|
+
if (value === '0') {
|
|
87
|
+
return false
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (value === '1') {
|
|
91
|
+
return true
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return false
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @typedef {Object} WorkerData
|
|
100
|
+
* @property {string} url - The URL to fetch.
|
|
101
|
+
* @property {Object} options - The fetch options.
|
|
102
|
+
* @property {number} timeout - The timeout in milliseconds.
|
|
103
|
+
* @property {MessagePort} port - The message port for communication.
|
|
104
|
+
*/
|
|
105
|
+
const { url, options, timeout, port } = workerData
|
|
23
106
|
|
|
24
107
|
try {
|
|
108
|
+
let dispatcher = getGlobalDispatcher()
|
|
109
|
+
|
|
110
|
+
if (shouldUseEnvProxy()) {
|
|
111
|
+
dispatcher = new EnvHttpProxyAgent()
|
|
112
|
+
}
|
|
113
|
+
|
|
25
114
|
const response = await fetch(url, {
|
|
26
115
|
...options,
|
|
27
|
-
dispatcher
|
|
116
|
+
dispatcher,
|
|
28
117
|
signal: AbortSignal.timeout(timeout)
|
|
29
118
|
})
|
|
30
119
|
|
|
31
|
-
const
|
|
32
|
-
const
|
|
120
|
+
const contentType = response.headers.get('Content-Type')
|
|
121
|
+
const isResponseJson = contentType?.startsWith('application/json') ?? false
|
|
122
|
+
const body = isResponseJson ? await response.json() : await response.text()
|
|
123
|
+
|
|
124
|
+
const responseData = {
|
|
33
125
|
status: response.status,
|
|
34
126
|
statusText: response.statusText,
|
|
127
|
+
// Headers can't be serialized directly
|
|
35
128
|
headers: Object.fromEntries(response.headers.entries()),
|
|
36
129
|
body,
|
|
37
130
|
ok: response.ok
|
|
38
|
-
}
|
|
131
|
+
}
|
|
39
132
|
|
|
40
|
-
|
|
41
|
-
|
|
133
|
+
port.postMessage({
|
|
134
|
+
data: responseData
|
|
135
|
+
})
|
|
136
|
+
} catch (error) {
|
|
137
|
+
const HTTP_PROXY = process.env.http_proxy || process.env.HTTP_PROXY
|
|
138
|
+
const HTTPS_PROXY = process.env.https_proxy || process.env.HTTPS_PROXY
|
|
139
|
+
const NO_PROXY = process.env.no_proxy || process.env.NO_PROXY
|
|
42
140
|
|
|
43
|
-
|
|
44
|
-
|
|
141
|
+
const context = {
|
|
142
|
+
url: sanitizeUrl(url),
|
|
143
|
+
env: {
|
|
144
|
+
HTTP_PROXY: HTTP_PROXY ? sanitizeUrl(HTTP_PROXY) : undefined,
|
|
145
|
+
HTTPS_PROXY: HTTPS_PROXY ? sanitizeUrl(HTTPS_PROXY) : undefined,
|
|
146
|
+
NO_PROXY,
|
|
147
|
+
NODE_EXTRA_CA_CERTS: process.env.NODE_EXTRA_CA_CERTS,
|
|
148
|
+
NODE_TLS_REJECT_UNAUTHORIZED: process.env.NODE_TLS_REJECT_UNAUTHORIZED
|
|
149
|
+
}
|
|
45
150
|
}
|
|
46
151
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
BUFFER_LAYOUT.LENGTH_OFFSET,
|
|
50
|
-
BUFFER_LAYOUT.LENGTH_VIEW_SIZE
|
|
51
|
-
)
|
|
52
|
-
lengthView[0] = encoded.length
|
|
53
|
-
responseBuffer.set(encoded)
|
|
152
|
+
const err = new FetchWorkerError(context)
|
|
153
|
+
err.cause = error
|
|
54
154
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const encoded = encoder.encode(errorMessage)
|
|
64
|
-
|
|
65
|
-
if (encoded.length <= responseBuffer.length - 4) {
|
|
66
|
-
const lengthView = new Uint32Array(
|
|
67
|
-
sharedBuffer,
|
|
68
|
-
BUFFER_LAYOUT.LENGTH_OFFSET,
|
|
69
|
-
BUFFER_LAYOUT.LENGTH_VIEW_SIZE
|
|
70
|
-
)
|
|
71
|
-
lengthView[0] = encoded.length
|
|
72
|
-
responseBuffer.set(encoded)
|
|
155
|
+
if (error instanceof DOMException) {
|
|
156
|
+
if (error.name === 'TimeoutError') {
|
|
157
|
+
const timeoutError = new OverrideError(
|
|
158
|
+
`The operation was aborted due to timeout (${timeout}ms)`,
|
|
159
|
+
'TimeoutError'
|
|
160
|
+
)
|
|
161
|
+
err.cause = timeoutError
|
|
162
|
+
}
|
|
73
163
|
}
|
|
74
164
|
|
|
75
|
-
|
|
76
|
-
|
|
165
|
+
port.postMessage({
|
|
166
|
+
error: err
|
|
167
|
+
})
|
|
168
|
+
} finally {
|
|
169
|
+
port.close()
|
|
77
170
|
}
|
|
@@ -5,7 +5,7 @@ export interface SyncFetchResponse {
|
|
|
5
5
|
status: number;
|
|
6
6
|
statusText: string;
|
|
7
7
|
headers: Record<string, string>;
|
|
8
|
-
body:
|
|
8
|
+
body: unknown;
|
|
9
9
|
ok: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare function syncFetch(url: string, options?: RequestInit, customOptions?: SyncFetchCustomOptions): SyncFetchResponse;
|
package/dist/utils/sync-fetch.js
CHANGED
|
@@ -3,70 +3,78 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.syncFetch = syncFetch;
|
|
4
4
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
|
-
const WORKER_STATUS = {
|
|
7
|
-
PENDING: 0,
|
|
8
|
-
SUCCESS: 1,
|
|
9
|
-
ERROR: 2
|
|
10
|
-
};
|
|
11
|
-
const BUFFER_LAYOUT = {
|
|
12
|
-
STATUS_INDEX: 0,
|
|
13
|
-
LENGTH_OFFSET: 12,
|
|
14
|
-
RESPONSE_OFFSET: 16,
|
|
15
|
-
LENGTH_VIEW_SIZE: 1,
|
|
16
|
-
DEFAULT_BUFFER_SIZE: 1024 * 1024
|
|
17
|
-
};
|
|
18
6
|
function syncFetch(url, options = {}, customOptions = {
|
|
19
7
|
timeout: 30000
|
|
20
8
|
}) {
|
|
21
9
|
const timeout = customOptions.timeout || 30000;
|
|
22
10
|
const processingBuffer = 3000;
|
|
23
11
|
const mainThreadTimeout = timeout + processingBuffer;
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
12
|
+
const { port1, port2 } = new node_worker_threads_1.MessageChannel();
|
|
13
|
+
const sleepBuffer = new SharedArrayBuffer(4);
|
|
14
|
+
const sleepArray = new Int32Array(sleepBuffer);
|
|
27
15
|
const worker = new node_worker_threads_1.Worker((0, node_path_1.join)(__dirname, 'sync-fetch-worker.mjs'), {
|
|
28
16
|
name: 'sync-fetch',
|
|
29
17
|
eval: false,
|
|
30
18
|
workerData: {
|
|
31
19
|
url,
|
|
32
20
|
options,
|
|
33
|
-
sharedBuffer,
|
|
34
21
|
timeout,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
port: port2
|
|
23
|
+
},
|
|
24
|
+
transferList: [port2]
|
|
38
25
|
});
|
|
26
|
+
const { startTime } = performance.mark('axe-watcher:sync-fetch:start');
|
|
27
|
+
let message;
|
|
39
28
|
try {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
const status = Atomics.load(int32Array, BUFFER_LAYOUT.STATUS_INDEX);
|
|
45
|
-
if (status === WORKER_STATUS.ERROR) {
|
|
46
|
-
const lengthView = new Uint32Array(sharedBuffer, BUFFER_LAYOUT.LENGTH_OFFSET, BUFFER_LAYOUT.LENGTH_VIEW_SIZE);
|
|
47
|
-
const responseLength = lengthView[0];
|
|
48
|
-
const responseBuffer = new Uint8Array(sharedBuffer, BUFFER_LAYOUT.RESPONSE_OFFSET, responseLength);
|
|
49
|
-
const decoder = new TextDecoder();
|
|
50
|
-
const errorMessage = decoder.decode(responseBuffer);
|
|
51
|
-
throw new Error(`Fetch failed: ${errorMessage}`);
|
|
52
|
-
}
|
|
53
|
-
if (status === WORKER_STATUS.SUCCESS) {
|
|
54
|
-
const lengthView = new Uint32Array(sharedBuffer, BUFFER_LAYOUT.LENGTH_OFFSET, BUFFER_LAYOUT.LENGTH_VIEW_SIZE);
|
|
55
|
-
const responseLength = lengthView[0];
|
|
56
|
-
const responseBuffer = new Uint8Array(sharedBuffer, BUFFER_LAYOUT.RESPONSE_OFFSET, responseLength);
|
|
57
|
-
const decoder = new TextDecoder();
|
|
58
|
-
const responseText = decoder.decode(responseBuffer);
|
|
59
|
-
try {
|
|
60
|
-
return JSON.parse(responseText);
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
throw new Error('Failed to parse response data');
|
|
29
|
+
while (message === undefined) {
|
|
30
|
+
if (performance.now() - startTime > mainThreadTimeout) {
|
|
31
|
+
throw new Error(`Request timed out - worker thread did not respond within ${mainThreadTimeout}ms`);
|
|
64
32
|
}
|
|
33
|
+
Atomics.wait(sleepArray, 0, 0, 5);
|
|
34
|
+
message = (0, node_worker_threads_1.receiveMessageOnPort)(port1);
|
|
35
|
+
}
|
|
36
|
+
const { data, error } = message.message;
|
|
37
|
+
if (error) {
|
|
38
|
+
const syncErr = new Error('Sync Fetch Failed');
|
|
39
|
+
syncErr.cause = error;
|
|
40
|
+
throw syncErr;
|
|
65
41
|
}
|
|
66
|
-
|
|
42
|
+
return data;
|
|
67
43
|
}
|
|
68
44
|
finally {
|
|
45
|
+
performance.mark('axe-watcher:sync-fetch:end');
|
|
46
|
+
port1.close();
|
|
69
47
|
worker.terminate();
|
|
48
|
+
const clone = structuredClone(options);
|
|
49
|
+
clone.headers = sanitizeHeaders(clone.headers);
|
|
50
|
+
performance.measure('axe-watcher:sync-fetch', {
|
|
51
|
+
start: 'axe-watcher:sync-fetch:start',
|
|
52
|
+
end: 'axe-watcher:sync-fetch:end',
|
|
53
|
+
detail: {
|
|
54
|
+
url,
|
|
55
|
+
options: clone,
|
|
56
|
+
timeout,
|
|
57
|
+
status: message?.message.type || 'no-response',
|
|
58
|
+
response: {
|
|
59
|
+
status: message?.message.data?.status,
|
|
60
|
+
statusText: message?.message.data?.statusText
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function sanitizeHeaders(headers) {
|
|
67
|
+
if (!headers) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const sanitized = {};
|
|
71
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
72
|
+
if (key.toLowerCase() === 'x-api-key'.toLowerCase()) {
|
|
73
|
+
sanitized[key.toLowerCase()] = 'REDACTED';
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
sanitized[key.toLowerCase()] = value;
|
|
70
77
|
}
|
|
78
|
+
return sanitized;
|
|
71
79
|
}
|
|
72
80
|
//# sourceMappingURL=sync-fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-fetch.js","sourceRoot":"","sources":["../../src/utils/sync-fetch.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"sync-fetch.js","sourceRoot":"","sources":["../../src/utils/sync-fetch.ts"],"names":[],"mappings":";;AAmBA,8BAsFC;AAzGD,6DAI4B;AAC5B,yCAAgC;AAchC,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YACpD,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,UAAU,CAAA;YACzC,SAAQ;QACV,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAA;IACtC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session IDs to be shared throughout tests that need to
|
|
3
|
+
* simulate various behaviors of initializing a session.
|
|
4
|
+
* Independently exported so importing from other files
|
|
5
|
+
* doesn't create side effects.
|
|
6
|
+
*/
|
|
7
|
+
export declare const specialResponseSessionIds: {
|
|
8
|
+
readonly 'fail-server-error': "fail-server-error";
|
|
9
|
+
readonly 'fail-legacy-errors': "fail-legacy-errors";
|
|
10
|
+
readonly 'fail-timeout': "fail-timeout";
|
|
11
|
+
readonly 'success-project-id-included': "success-project-id-included";
|
|
12
|
+
readonly 'success-project-id-excluded': "success-project-id-excluded";
|
|
13
|
+
readonly 'mock-session-id': "mock-session-id";
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.specialResponseSessionIds = void 0;
|
|
4
|
+
exports.specialResponseSessionIds = {
|
|
5
|
+
'fail-server-error': 'fail-server-error',
|
|
6
|
+
'fail-legacy-errors': 'fail-legacy-errors',
|
|
7
|
+
'fail-timeout': 'fail-timeout',
|
|
8
|
+
'success-project-id-included': 'success-project-id-included',
|
|
9
|
+
'success-project-id-excluded': 'success-project-id-excluded',
|
|
10
|
+
'mock-session-id': 'mock-session-id'
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=test-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-constants.js","sourceRoot":"","sources":["../../src/utils/test-constants.ts"],"names":[],"mappings":";;;AAMa,QAAA,yBAAyB,GAAG;IAEvC,mBAAmB,EAAE,mBAAmB;IACxC,oBAAoB,EAAE,oBAAoB;IAC1C,cAAc,EAAE,cAAc;IAC9B,6BAA6B,EAAE,6BAA6B;IAC5D,6BAA6B,EAAE,6BAA6B;IAC5D,iBAAiB,EAAE,iBAAiB;CAC5B,CAAA"}
|
|
@@ -112,6 +112,11 @@ export interface CypressAxeConfiguration extends AxeConfiguration {
|
|
|
112
112
|
* Default: 'e2e'
|
|
113
113
|
*/
|
|
114
114
|
testingTypes?: CypressTestingType | CypressTestingType[];
|
|
115
|
+
/**
|
|
116
|
+
* Associates the test run with a specific project.
|
|
117
|
+
* Should be the UUID provided in your Axe account.
|
|
118
|
+
*/
|
|
119
|
+
projectId?: string;
|
|
115
120
|
}
|
|
116
121
|
export interface CypressConfiguration {
|
|
117
122
|
axe: CypressAxeConfiguration;
|
|
@@ -82,7 +82,6 @@ function writeVariables({ apiKey, autoAnalyze, configurationOverrides, cypress,
|
|
|
82
82
|
...(buildID !== undefined && { buildID }),
|
|
83
83
|
...(projectId !== undefined && { projectId })
|
|
84
84
|
});
|
|
85
|
-
const { AXE_WATCHER_PROJECT_ID } = process.env;
|
|
86
85
|
if (configurationOverrides && runOptions?.runOnly) {
|
|
87
86
|
throw new Error('You cannot use `configurationOverrides` and `runOptions.runOnly` together. These configuration options are mutually exclusive.');
|
|
88
87
|
}
|
|
@@ -139,12 +138,11 @@ function writeVariables({ apiKey, autoAnalyze, configurationOverrides, cypress,
|
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
if (isProjectIdFeatureFlagEnabled && !projectId) {
|
|
141
|
+
if (!projectId) {
|
|
144
142
|
console.warn('Warning: `projectId` within axe configuration will become a mandatory field in a future release. Please supply your `projectId` found on your projects page');
|
|
145
143
|
}
|
|
146
144
|
debugLogger('Initializing axe Watcher session');
|
|
147
|
-
const projectIdValue =
|
|
145
|
+
const projectIdValue = projectId || null;
|
|
148
146
|
const { axe_core_settings, session_id } = (0, initializeSession_1.default)({
|
|
149
147
|
apiKey,
|
|
150
148
|
projectId: projectIdValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeVariables.js","sourceRoot":"","sources":["../../src/utils/writeVariables.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4CAA6B;AAC7B,4CAAmB;AACnB,2CAAgD;AAChD,mDAGwB;AACxB,mEAAgF;AAChF,uEAA8C;AAC9C,4EAA6E;AAC7E,mEAA+D;AAC/D,oFAA2D;AAC3D,sFAAoD;AACpD,iCAA6B;AAE7B,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,uBAAuB,CAAC,CAAA;AAI3D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AA4BjD,MAAM,6BAA6B,GAA4B;IAC7D,KAAK;IACL,cAAc;IACd,aAAa;IACb,YAAY;IACZ,cAAc;IACd,aAAa;IACb,YAAY;IACZ,cAAc;IACd,aAAa;IACb,YAAY;IACZ,mBAAmB;IACnB,YAAY;CACb,CAAA;
|
|
1
|
+
{"version":3,"file":"writeVariables.js","sourceRoot":"","sources":["../../src/utils/writeVariables.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4CAA6B;AAC7B,4CAAmB;AACnB,2CAAgD;AAChD,mDAGwB;AACxB,mEAAgF;AAChF,uEAA8C;AAC9C,4EAA6E;AAC7E,mEAA+D;AAC/D,oFAA2D;AAC3D,sFAAoD;AACpD,iCAA6B;AAE7B,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,uBAAuB,CAAC,CAAA;AAI3D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AA4BjD,MAAM,6BAA6B,GAA4B;IAC7D,KAAK;IACL,cAAc;IACd,aAAa;IACb,YAAY;IACZ,cAAc;IACd,aAAa;IACb,YAAY;IACZ,c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