@axe-core/watcher 3.16.0-next.ffc99c11 → 3.16.0-rc.ceaeb8da
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cypress.d.ts +0 -2
- package/dist/cypress.js +5 -9
- package/dist/cypress.js.map +1 -1
- package/dist/cypressCommands.js +40 -62
- package/dist/cypressCommands.js.map +1 -1
- package/dist/playwright.js +0 -2
- package/dist/playwright.js.map +1 -1
- package/dist/playwrightWrapping.d.ts +0 -1
- package/dist/playwrightWrapping.js +7 -15
- package/dist/playwrightWrapping.js.map +1 -1
- package/dist/puppeteer.js +0 -2
- package/dist/puppeteer.js.map +1 -1
- package/dist/utils/headlessNotSupportedError.test.d.ts +1 -0
- package/dist/utils/headlessNotSupportedError.test.js +21 -0
- package/dist/utils/headlessNotSupportedError.test.js.map +1 -0
- package/dist/utils/initializeSession.test.d.ts +1 -0
- package/dist/utils/initializeSession.test.js +177 -0
- package/dist/utils/initializeSession.test.js.map +1 -0
- package/dist/utils/isValidExcludePattern.test.d.ts +1 -0
- package/dist/utils/isValidExcludePattern.test.js +17 -0
- package/dist/utils/isValidExcludePattern.test.js.map +1 -0
- package/dist/utils/mergeChromeArgs.test.d.ts +1 -0
- package/dist/utils/mergeChromeArgs.test.js +257 -0
- package/dist/utils/mergeChromeArgs.test.js.map +1 -0
- package/dist/utils/proxyHandlers.d.ts +0 -2
- package/dist/utils/proxyHandlers.js +1 -14
- package/dist/utils/proxyHandlers.js.map +1 -1
- package/dist/utils/proxyHandlers.test.d.ts +1 -0
- package/dist/utils/proxyHandlers.test.js +27 -0
- package/dist/utils/proxyHandlers.test.js.map +1 -0
- package/dist/utils/validateAxeRunContext.test.d.ts +1 -0
- package/dist/utils/validateAxeRunContext.test.js +97 -0
- package/dist/utils/validateAxeRunContext.test.js.map +1 -0
- package/dist/utils/validateAxeRunOptions.test.d.ts +1 -0
- package/dist/utils/validateAxeRunOptions.test.js +215 -0
- package/dist/utils/validateAxeRunOptions.test.js.map +1 -0
- package/dist/utils/writeVariables.test.d.ts +1 -0
- package/dist/utils/writeVariables.test.js +200 -0
- package/dist/utils/writeVariables.test.js.map +1 -0
- package/dist/wdio.js +0 -2
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.js +0 -2
- package/dist/webdriver.js.map +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +4 -4
- package/dist/utils/assertVariablesWereWritten.d.ts +0 -1
- package/dist/utils/assertVariablesWereWritten.js +0 -15
- package/dist/utils/assertVariablesWereWritten.js.map +0 -1
@@ -0,0 +1,177 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
require("mocha");
|
7
|
+
const chai_1 = require("chai");
|
8
|
+
const sinon_1 = __importDefault(require("sinon"));
|
9
|
+
const proxyquire_1 = __importDefault(require("proxyquire"));
|
10
|
+
const initializeSession_1 = __importDefault(require("./initializeSession"));
|
11
|
+
describe('initializeSession', () => {
|
12
|
+
afterEach(sinon_1.default.restore);
|
13
|
+
const defaultParams = {
|
14
|
+
apiKey: 'abc',
|
15
|
+
serverURL: 'http://localhost:3000',
|
16
|
+
watcherVersion: '1.0.0',
|
17
|
+
sessionID: null,
|
18
|
+
buildID: null,
|
19
|
+
gitCommitSha: null
|
20
|
+
};
|
21
|
+
describe('validating input', () => {
|
22
|
+
describe('when the API key is missing', () => {
|
23
|
+
it('throws an error', () => {
|
24
|
+
chai_1.assert.throws(() => {
|
25
|
+
(0, initializeSession_1.default)({});
|
26
|
+
}, 'API key is required');
|
27
|
+
});
|
28
|
+
});
|
29
|
+
describe('when the server URL is missing', () => {
|
30
|
+
it('throws an error', () => {
|
31
|
+
chai_1.assert.throws(() => {
|
32
|
+
(0, initializeSession_1.default)({ apiKey: 'abc' });
|
33
|
+
}, 'Server URL is required');
|
34
|
+
});
|
35
|
+
});
|
36
|
+
describe('when the watcher version is missing', () => {
|
37
|
+
it('throws an error', () => {
|
38
|
+
chai_1.assert.throws(() => {
|
39
|
+
(0, initializeSession_1.default)({
|
40
|
+
apiKey: 'abc',
|
41
|
+
serverURL: 'http://localhost:3000'
|
42
|
+
});
|
43
|
+
}, 'Watcher version is required');
|
44
|
+
});
|
45
|
+
});
|
46
|
+
describe('when the session ID is not a string', () => {
|
47
|
+
it('throws an error', () => {
|
48
|
+
chai_1.assert.throws(() => {
|
49
|
+
(0, initializeSession_1.default)({
|
50
|
+
...defaultParams,
|
51
|
+
sessionID: 123
|
52
|
+
});
|
53
|
+
}, 'Session ID must be a string');
|
54
|
+
});
|
55
|
+
});
|
56
|
+
describe('when the build ID is not a string', () => {
|
57
|
+
it('throws an error', () => {
|
58
|
+
chai_1.assert.throws(() => {
|
59
|
+
(0, initializeSession_1.default)({
|
60
|
+
...defaultParams,
|
61
|
+
buildID: 123
|
62
|
+
});
|
63
|
+
}, 'Build ID must be a string');
|
64
|
+
});
|
65
|
+
});
|
66
|
+
describe('when both session ID and build ID are provided', () => {
|
67
|
+
it('throws an error', () => {
|
68
|
+
chai_1.assert.throws(() => {
|
69
|
+
(0, initializeSession_1.default)({
|
70
|
+
...defaultParams,
|
71
|
+
sessionID: 'abc',
|
72
|
+
buildID: '123'
|
73
|
+
});
|
74
|
+
}, 'Session ID and Build ID are mutually exclusive. `sessionId` is deprecated, please use `buildID` instead');
|
75
|
+
});
|
76
|
+
});
|
77
|
+
describe('when the git commit SHA is not a string', () => {
|
78
|
+
it('throws an error', () => {
|
79
|
+
chai_1.assert.throws(() => {
|
80
|
+
(0, initializeSession_1.default)({
|
81
|
+
...defaultParams,
|
82
|
+
gitCommitSha: 123
|
83
|
+
});
|
84
|
+
}, 'Git commit SHA must be a string');
|
85
|
+
});
|
86
|
+
});
|
87
|
+
});
|
88
|
+
describe('when the server returns a non-200 response', () => {
|
89
|
+
afterEach(sinon_1.default.restore);
|
90
|
+
it('throws an error', () => {
|
91
|
+
const requestStub = sinon_1.default
|
92
|
+
.stub()
|
93
|
+
.returns({ statusCode: 500, getBody: () => '{"errors":["boom"]}' });
|
94
|
+
const fn = (0, proxyquire_1.default)('./initializeSession', {
|
95
|
+
'sync-request': requestStub
|
96
|
+
}).default;
|
97
|
+
chai_1.assert.throws(() => {
|
98
|
+
fn(defaultParams);
|
99
|
+
}, 'boom');
|
100
|
+
});
|
101
|
+
});
|
102
|
+
describe('when the server returns a 200 response', () => {
|
103
|
+
it('does not throw an error', () => {
|
104
|
+
const expectedBody = {
|
105
|
+
errors: [],
|
106
|
+
warnings: [],
|
107
|
+
session_id: 'abc'
|
108
|
+
};
|
109
|
+
const requestStub = sinon_1.default.stub().returns({
|
110
|
+
statusCode: 200,
|
111
|
+
getBody: () => JSON.stringify(expectedBody)
|
112
|
+
});
|
113
|
+
const fn = (0, proxyquire_1.default)('./initializeSession', {
|
114
|
+
'sync-request': requestStub
|
115
|
+
}).default;
|
116
|
+
const invoke = fn(defaultParams);
|
117
|
+
chai_1.assert.doesNotThrow(() => invoke);
|
118
|
+
chai_1.assert.deepEqual(invoke, expectedBody.session_id);
|
119
|
+
});
|
120
|
+
describe('and no session_id is returned', () => {
|
121
|
+
const expectedBody = {
|
122
|
+
errors: [],
|
123
|
+
warnings: []
|
124
|
+
};
|
125
|
+
const sessionID = 'xyz';
|
126
|
+
describe('and a sessionID is provided', () => {
|
127
|
+
it('uses the sessionID', () => {
|
128
|
+
const requestStub = sinon_1.default.stub().returns({
|
129
|
+
statusCode: 200,
|
130
|
+
getBody: () => JSON.stringify(expectedBody)
|
131
|
+
});
|
132
|
+
const fn = (0, proxyquire_1.default)('./initializeSession', {
|
133
|
+
'sync-request': requestStub
|
134
|
+
}).default;
|
135
|
+
const invoke = fn({
|
136
|
+
...defaultParams,
|
137
|
+
...{ sessionID }
|
138
|
+
});
|
139
|
+
chai_1.assert.deepEqual(invoke, sessionID);
|
140
|
+
});
|
141
|
+
});
|
142
|
+
describe('and a buildID is provided', () => {
|
143
|
+
it('throws', () => {
|
144
|
+
const requestStub = sinon_1.default.stub().returns({
|
145
|
+
statusCode: 200,
|
146
|
+
getBody: () => JSON.stringify(expectedBody)
|
147
|
+
});
|
148
|
+
const fn = (0, proxyquire_1.default)('./initializeSession', {
|
149
|
+
'sync-request': requestStub
|
150
|
+
}).default;
|
151
|
+
const buildID = 'def';
|
152
|
+
chai_1.assert.throws(() => fn({
|
153
|
+
...defaultParams,
|
154
|
+
...{ buildID }
|
155
|
+
}), 'Failed to initialize session based on build_id. Try again later.');
|
156
|
+
});
|
157
|
+
});
|
158
|
+
describe('and neither a sessionID nor a buildID are provided', () => {
|
159
|
+
it('uses a generated UUID', () => {
|
160
|
+
const requestStub = sinon_1.default.stub().returns({
|
161
|
+
statusCode: 200,
|
162
|
+
getBody: () => JSON.stringify(expectedBody)
|
163
|
+
});
|
164
|
+
const generatedID = 'ghi';
|
165
|
+
const uuidStub = sinon_1.default.stub().returns(generatedID);
|
166
|
+
const fn = (0, proxyquire_1.default)('./initializeSession', {
|
167
|
+
'sync-request': requestStub,
|
168
|
+
uuid: { v4: uuidStub }
|
169
|
+
}).default;
|
170
|
+
const invoke = fn(defaultParams);
|
171
|
+
chai_1.assert.deepEqual(invoke, generatedID);
|
172
|
+
});
|
173
|
+
});
|
174
|
+
});
|
175
|
+
});
|
176
|
+
});
|
177
|
+
//# sourceMappingURL=initializeSession.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"initializeSession.test.js","sourceRoot":"","sources":["../../src/utils/initializeSession.test.ts"],"names":[],"mappings":";;;;;AAAA,iBAAc;AACd,+BAA6B;AAC7B,kDAAyB;AACzB,4DAAmC;AACnC,4EAE4B;AAE5B,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,SAAS,CAAC,eAAK,CAAC,OAAO,CAAC,CAAA;IAExB,MAAM,aAAa,GAA4B;QAC7C,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,uBAAuB;QAClC,cAAc,EAAE,OA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AO,EAAE;qBACf,CAAC,EACJ,kEAAkE,CACnE,CAAA;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;YAEF,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;gBAClE,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;oBAC/B,MAAM,WAAW,GAAG,eAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC;wBACvC,UAAU,EAAE,GAAG;wBACf,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;qBAC5C,CAAC,CAAA;oBACF,MAAM,WAAW,GAAG,KAAK,CAAA;oBACzB,MAAM,QAAQ,GAAG,eAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;oBAClD,MAAM,EAAE,GAAG,IAAA,oBAAU,EAAC,qBAAqB,EAAE;wBAC3C,cAAc,EAAE,WAAW;wBAC3B,IAAI,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE;qBACvB,CAAC,CAAC,OAAmC,CAAA;oBAEtC,MAAM,MAAM,GAAG,EAAE,CAAC,aAAa,CAAC,CAAA;oBAEhC,aAAM,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;gBACvC,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'mocha';
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
require("mocha");
|
7
|
+
const chai_1 = require("chai");
|
8
|
+
const isValidExcludePattern_1 = __importDefault(require("./isValidExcludePattern"));
|
9
|
+
describe('isValidExcludePattern', () => {
|
10
|
+
it('returns true for valid exclude patterns', () => {
|
11
|
+
chai_1.assert.doesNotThrow(() => (0, isValidExcludePattern_1.default)(['foo', 'bar']));
|
12
|
+
});
|
13
|
+
it('returns false for invalid exclude patterns', () => {
|
14
|
+
chai_1.assert.throws(() => (0, isValidExcludePattern_1.default)(['foo', 'bar', 1]));
|
15
|
+
});
|
16
|
+
});
|
17
|
+
//# sourceMappingURL=isValidExcludePattern.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"isValidExcludePattern.test.js","sourceRoot":"","sources":["../../src/utils/isValidExcludePattern.test.ts"],"names":[],"mappings":";;;;;AAAA,iBAAc;AACd,+BAA6B;AAC7B,oFAA2D;AAE3D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,aAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAA,+BAAqB,EAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;IAClE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,aAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,+BAAqB,EAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'mocha';
|
@@ -0,0 +1,257 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
require("mocha");
|
7
|
+
const chai_1 = require("chai");
|
8
|
+
const constants_1 = require("./constants");
|
9
|
+
const mergeChromeArgs_1 = __importDefault(require("./mergeChromeArgs"));
|
10
|
+
describe('mergeChromeArgs', () => {
|
11
|
+
describe('given the user has not provided any args', () => {
|
12
|
+
describe('when `disableOtherExtensions` is true', () => {
|
13
|
+
it('returns the `--load-extension` when `--disable-extensions-except` flags', () => {
|
14
|
+
const args = (0, mergeChromeArgs_1.default)([], {
|
15
|
+
disableOtherExtensions: true
|
16
|
+
});
|
17
|
+
const [loadExtension, disableExtensionsExcept] = args;
|
18
|
+
chai_1.assert.lengthOf(args, 2);
|
19
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
20
|
+
chai_1.assert.equal(disableExtensionsExcept, `--disable-extensions-except=${constants_1.PATH_TO_EXTENSION}`);
|
21
|
+
});
|
22
|
+
});
|
23
|
+
describe('and `disableOtherExtensions` is false', () => {
|
24
|
+
it('only returns the `--load-extension` flag', () => {
|
25
|
+
const args = (0, mergeChromeArgs_1.default)([], {
|
26
|
+
disableOtherExtensions: false
|
27
|
+
});
|
28
|
+
const [loadExtension] = args;
|
29
|
+
chai_1.assert.lengthOf(args, 1);
|
30
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
31
|
+
});
|
32
|
+
});
|
33
|
+
});
|
34
|
+
describe('given the user has provided args', () => {
|
35
|
+
describe('when the user has not provided extension flags', () => {
|
36
|
+
describe('when `disableOtherExtensions` is true', () => {
|
37
|
+
describe('and the user args and not prefixed with `--`', () => {
|
38
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
39
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'baz=qux,quz', 'quux'], {
|
40
|
+
disableOtherExtensions: true
|
41
|
+
});
|
42
|
+
const [foo, baz, quux, loadExtension, disableExtensionsExcept] = args;
|
43
|
+
chai_1.assert.lengthOf(args, 5);
|
44
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
45
|
+
chai_1.assert.equal(baz, 'baz=qux,quz');
|
46
|
+
chai_1.assert.equal(quux, 'quux');
|
47
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
48
|
+
chai_1.assert.equal(disableExtensionsExcept, `--disable-extensions-except=${constants_1.PATH_TO_EXTENSION}`);
|
49
|
+
});
|
50
|
+
describe('and the user adds multiple instances of the same flag', () => {
|
51
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
52
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'foo=baz'], {
|
53
|
+
disableOtherExtensions: true
|
54
|
+
});
|
55
|
+
const [foo1, foo2, loadExtension, disableExtensionsExcept] = args;
|
56
|
+
chai_1.assert.lengthOf(args, 4);
|
57
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
58
|
+
chai_1.assert.equal(foo2, 'foo=baz');
|
59
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
60
|
+
chai_1.assert.equal(disableExtensionsExcept, `--disable-extensions-except=${constants_1.PATH_TO_EXTENSION}`);
|
61
|
+
});
|
62
|
+
describe('and some values are comma-separated', () => {
|
63
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
64
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'foo=baz,qux'], {
|
65
|
+
disableOtherExtensions: true
|
66
|
+
});
|
67
|
+
const [foo1, foo2, loadExtension, disableExtensionsExcept] = args;
|
68
|
+
chai_1.assert.lengthOf(args, 4);
|
69
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
70
|
+
chai_1.assert.equal(foo2, 'foo=baz,qux');
|
71
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
72
|
+
chai_1.assert.equal(disableExtensionsExcept, `--disable-extensions-except=${constants_1.PATH_TO_EXTENSION}`);
|
73
|
+
});
|
74
|
+
});
|
75
|
+
});
|
76
|
+
});
|
77
|
+
});
|
78
|
+
describe('and `disableOtherExtensions` is false', () => {
|
79
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
80
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'baz=qux,quz', 'quux'], {
|
81
|
+
disableOtherExtensions: false
|
82
|
+
});
|
83
|
+
const [foo, baz, quux, loadExtension] = args;
|
84
|
+
chai_1.assert.lengthOf(args, 4);
|
85
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
86
|
+
chai_1.assert.equal(baz, 'baz=qux,quz');
|
87
|
+
chai_1.assert.equal(quux, 'quux');
|
88
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
89
|
+
});
|
90
|
+
describe('and the user adds multiple instances of the same flag', () => {
|
91
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
92
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'foo=baz'], {
|
93
|
+
disableOtherExtensions: false
|
94
|
+
});
|
95
|
+
chai_1.assert.lengthOf(args, 3);
|
96
|
+
const [foo1, foo2, loadExtension] = args;
|
97
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
98
|
+
chai_1.assert.equal(foo2, 'foo=baz');
|
99
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
100
|
+
});
|
101
|
+
describe('and some values are comma-separated', () => {
|
102
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
103
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'foo=baz,qux'], {
|
104
|
+
disableOtherExtensions: false
|
105
|
+
});
|
106
|
+
chai_1.assert.lengthOf(args, 3);
|
107
|
+
const [foo1, foo2, loadExtension] = args;
|
108
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
109
|
+
chai_1.assert.equal(foo2, 'foo=baz,qux');
|
110
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
111
|
+
});
|
112
|
+
});
|
113
|
+
});
|
114
|
+
});
|
115
|
+
});
|
116
|
+
describe('when the user has provided extension flags', () => {
|
117
|
+
describe('when `disableOtherExtensions` is true', () => {
|
118
|
+
describe('and the user extension flags are not prefixed with `--`', () => {
|
119
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
120
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'baz=qux,quz', 'quux', 'load-extension=foo'], {
|
121
|
+
disableOtherExtensions: true
|
122
|
+
});
|
123
|
+
const [foo, baz, quux, loadExtension, disableExtensionsExcept] = args;
|
124
|
+
chai_1.assert.lengthOf(args, 5);
|
125
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
126
|
+
chai_1.assert.equal(baz, 'baz=qux,quz');
|
127
|
+
chai_1.assert.equal(quux, 'quux');
|
128
|
+
chai_1.assert.equal(loadExtension, `load-extension=foo,${constants_1.PATH_TO_EXTENSION}`);
|
129
|
+
chai_1.assert.equal(disableExtensionsExcept, `--disable-extensions-except=${constants_1.PATH_TO_EXTENSION}`);
|
130
|
+
});
|
131
|
+
describe('and the user adds multiple instances of the same flag', () => {
|
132
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
133
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'load-extension=baz', 'load-extension=qux'], {
|
134
|
+
disableOtherExtensions: true
|
135
|
+
});
|
136
|
+
const [foo, loadExtension1, loadExtension2, disableExtensionsExcept] = args;
|
137
|
+
chai_1.assert.lengthOf(args, 4);
|
138
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
139
|
+
chai_1.assert.equal(loadExtension1, 'load-extension=baz');
|
140
|
+
chai_1.assert.equal(loadExtension2, `load-extension=qux,${constants_1.PATH_TO_EXTENSION}`);
|
141
|
+
chai_1.assert.equal(disableExtensionsExcept, `--disable-extensions-except=${constants_1.PATH_TO_EXTENSION}`);
|
142
|
+
});
|
143
|
+
describe('and some values are comma-separated', () => {
|
144
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
145
|
+
const args = (0, mergeChromeArgs_1.default)([
|
146
|
+
'foo=bar',
|
147
|
+
'foo=baz,qux',
|
148
|
+
'load-extension=foo',
|
149
|
+
'disable-extensions-except=quz,quux'
|
150
|
+
], {
|
151
|
+
disableOtherExtensions: true
|
152
|
+
});
|
153
|
+
const [foo1, foo2, loadExtension, disableExtensionsExcept] = args;
|
154
|
+
chai_1.assert.lengthOf(args, 4);
|
155
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
156
|
+
chai_1.assert.equal(foo2, 'foo=baz,qux');
|
157
|
+
chai_1.assert.equal(loadExtension, `load-extension=foo,${constants_1.PATH_TO_EXTENSION}`);
|
158
|
+
chai_1.assert.equal(disableExtensionsExcept, `disable-extensions-except=quz,quux,${constants_1.PATH_TO_EXTENSION}`);
|
159
|
+
});
|
160
|
+
});
|
161
|
+
});
|
162
|
+
});
|
163
|
+
});
|
164
|
+
describe('and `disableOtherExtensions` is false', () => {
|
165
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
166
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'baz=qux,quz', 'quux', 'load-extension=foo'], {
|
167
|
+
disableOtherExtensions: false
|
168
|
+
});
|
169
|
+
const [foo, baz, quux, loadExtension] = args;
|
170
|
+
chai_1.assert.lengthOf(args, 4);
|
171
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
172
|
+
chai_1.assert.equal(baz, 'baz=qux,quz');
|
173
|
+
chai_1.assert.equal(quux, 'quux');
|
174
|
+
chai_1.assert.equal(loadExtension, `load-extension=foo,${constants_1.PATH_TO_EXTENSION}`);
|
175
|
+
});
|
176
|
+
describe('and the user adds multiple instances of the same flag', () => {
|
177
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
178
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'load-extension=baz', 'load-extension=qux'], {
|
179
|
+
disableOtherExtensions: false
|
180
|
+
});
|
181
|
+
const [foo, loadExtension1, loadExtension2] = args;
|
182
|
+
chai_1.assert.lengthOf(args, 3);
|
183
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
184
|
+
chai_1.assert.equal(loadExtension1, 'load-extension=baz');
|
185
|
+
chai_1.assert.equal(loadExtension2, `load-extension=qux,${constants_1.PATH_TO_EXTENSION}`);
|
186
|
+
});
|
187
|
+
describe('and some values are comma-separated', () => {
|
188
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
189
|
+
const args = (0, mergeChromeArgs_1.default)(['foo=bar', 'foo=baz,qux', 'load-extension=foo,quz,quux'], {
|
190
|
+
disableOtherExtensions: false
|
191
|
+
});
|
192
|
+
const [foo1, foo2, loadExtension] = args;
|
193
|
+
chai_1.assert.lengthOf(args, 3);
|
194
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
195
|
+
chai_1.assert.equal(foo2, 'foo=baz,qux');
|
196
|
+
chai_1.assert.equal(loadExtension, `load-extension=foo,quz,quux,${constants_1.PATH_TO_EXTENSION}`);
|
197
|
+
});
|
198
|
+
});
|
199
|
+
});
|
200
|
+
describe('and the user explicity sets the `--disable-extensions-except` flag', () => {
|
201
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
202
|
+
const args = (0, mergeChromeArgs_1.default)([
|
203
|
+
'foo=bar',
|
204
|
+
'baz=qux,quz',
|
205
|
+
'quux',
|
206
|
+
'disable-extensions-except=foo'
|
207
|
+
], {
|
208
|
+
disableOtherExtensions: false
|
209
|
+
});
|
210
|
+
const [foo, baz, quux, disableExtensionsExcept, loadExtension] = args;
|
211
|
+
chai_1.assert.lengthOf(args, 5);
|
212
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
213
|
+
chai_1.assert.equal(baz, 'baz=qux,quz');
|
214
|
+
chai_1.assert.equal(quux, 'quux');
|
215
|
+
chai_1.assert.equal(disableExtensionsExcept, `disable-extensions-except=foo,${constants_1.PATH_TO_EXTENSION}`);
|
216
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
217
|
+
});
|
218
|
+
describe('and the user adds multiple instances of the same flag', () => {
|
219
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
220
|
+
const args = (0, mergeChromeArgs_1.default)([
|
221
|
+
'foo=bar',
|
222
|
+
'disable-extensions-except=baz',
|
223
|
+
'--disable-extensions-except=qux'
|
224
|
+
], {
|
225
|
+
disableOtherExtensions: false
|
226
|
+
});
|
227
|
+
const [foo, disableExtensionsExcept1, disableExtensionsExcept2, loadExtension] = args;
|
228
|
+
chai_1.assert.lengthOf(args, 4);
|
229
|
+
chai_1.assert.equal(foo, 'foo=bar');
|
230
|
+
chai_1.assert.equal(disableExtensionsExcept1, 'disable-extensions-except=baz');
|
231
|
+
chai_1.assert.equal(disableExtensionsExcept2, `--disable-extensions-except=qux,${constants_1.PATH_TO_EXTENSION}`);
|
232
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
233
|
+
});
|
234
|
+
describe('and some values are comma-separated', () => {
|
235
|
+
it('does not modify the user provided args and appends the extension flags', () => {
|
236
|
+
const args = (0, mergeChromeArgs_1.default)([
|
237
|
+
'foo=bar',
|
238
|
+
'foo=baz,qux',
|
239
|
+
'disable-extensions-except=foo,quz,quux'
|
240
|
+
], {
|
241
|
+
disableOtherExtensions: false
|
242
|
+
});
|
243
|
+
const [foo1, foo2, disableExtensionsExcept, loadExtension] = args;
|
244
|
+
chai_1.assert.lengthOf(args, 4);
|
245
|
+
chai_1.assert.equal(foo1, 'foo=bar');
|
246
|
+
chai_1.assert.equal(foo2, 'foo=baz,qux');
|
247
|
+
chai_1.assert.equal(disableExtensionsExcept, `disable-extensions-except=foo,quz,quux,${constants_1.PATH_TO_EXTENSION}`);
|
248
|
+
chai_1.assert.equal(loadExtension, `--load-extension=${constants_1.PATH_TO_EXTENSION}`);
|
249
|
+
});
|
250
|
+
});
|
251
|
+
});
|
252
|
+
});
|
253
|
+
});
|
254
|
+
});
|
255
|
+
});
|
256
|
+
});
|
257
|
+
//# sourceMappingURL=mergeChromeArgs.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"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AChC,CAAA;4BAED,aAAM,CAAC,KAAK,CACV,wBAAwB,EACxB,mCAAmC,6BAAiB,EAAE,CACvD,CAAA;4BACD,aAAM,CAAC,KAAK,CACV,aAAa,EACb,oBAAoB,6BAAiB,EAAE,CACxC,CAAA;wBACH,CAAC,CAAC,CAAA;wBAEF,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;4BACnD,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;gCAChF,MAAM,IAAI,GAAG,IAAA,yBAAe,EAC1B;oCACE,SAAS;oCACT,aAAa;oCACb,wCAAwC;iCACzC,EACD;oCACE,sBAAsB,EAAE,KAAK;iCAC9B,CACF,CAAA;gCAED,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,uBAAuB,EAAE,aAAa,CAAC,GACxD,IAAI,CAAA;gCAEN,aAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gCACxB,aAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;gCAC7B,aAAM,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;gCACjC,aAAM,CAAC,KAAK,CACV,uBAAuB,EACvB,0CAA0C,6BAAiB,EAAE,CAC9D,CAAA;gCACD,aAAM,CAAC,KAAK,CACV,aAAa,EACb,oBAAoB,6BAAiB,EAAE,CACxC,CAAA;4BACH,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAA;gBACJ,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import type Controller from '../Controller';
|
2
|
-
import { type PlaywrightController } from '../playwright';
|
3
2
|
declare const kWrapped: unique symbol;
|
4
3
|
export type PossiblyWrapped<T> = T & {
|
5
4
|
[kWrapped]?: boolean;
|
@@ -9,6 +8,5 @@ export declare const isWrapped: <T>(o: PossiblyWrapped<T> | null) => boolean;
|
|
9
8
|
/** Mark the given object as wrapped. */
|
10
9
|
export declare const markAsWrapped: (o: unknown) => void;
|
11
10
|
export declare const proxiedGetFuncWithAnalyze: <T>(target: T, prop: keyof T, controller: Controller) => (...args: unknown[]) => Promise<unknown>;
|
12
|
-
export declare const proxiedGetFuncWithAnalyzeWrapped: <T>(target: T, prop: keyof T, controller: PlaywrightController) => (...args: unknown[]) => Promise<unknown>;
|
13
11
|
export declare const proxiedGetWithoutAnalyze: <T>(target: T, prop: keyof T) => unknown;
|
14
12
|
export {};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.proxiedGetWithoutAnalyze = exports.
|
4
|
-
const playwrightWrapping_1 = require("../playwrightWrapping");
|
3
|
+
exports.proxiedGetWithoutAnalyze = exports.proxiedGetFuncWithAnalyze = exports.markAsWrapped = exports.isWrapped = void 0;
|
5
4
|
const kWrapped = Symbol('axe watcher wrapped');
|
6
5
|
const isWrapped = (o) => {
|
7
6
|
if (!o) {
|
@@ -27,18 +26,6 @@ const proxiedGetFuncWithAnalyze = (target, prop, controller) => async (...args)
|
|
27
26
|
return result;
|
28
27
|
};
|
29
28
|
exports.proxiedGetFuncWithAnalyze = proxiedGetFuncWithAnalyze;
|
30
|
-
const proxiedGetFuncWithAnalyzeWrapped = (target, prop, controller) => async (...args) => {
|
31
|
-
await controller.analyze({
|
32
|
-
__Method: prop,
|
33
|
-
__UserRequestedAnalyze: false
|
34
|
-
});
|
35
|
-
const result = await target[prop].call(target, ...args);
|
36
|
-
if (!result) {
|
37
|
-
return null;
|
38
|
-
}
|
39
|
-
return (0, playwrightWrapping_1.wrapElementHandle)(result, controller);
|
40
|
-
};
|
41
|
-
exports.proxiedGetFuncWithAnalyzeWrapped = proxiedGetFuncWithAnalyzeWrapped;
|
42
29
|
const proxiedGetWithoutAnalyze = (target, prop) => {
|
43
30
|
const original = target[prop];
|
44
31
|
if (typeof original === 'function') {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"proxyHandlers.js","sourceRoot":"","sources":["../../src/utils/proxyHandlers.ts"],"names":[],"mappings":";;;AAEA,
|
1
|
+
{"version":3,"file":"proxyHandlers.js","sourceRoot":"","sources":["../../src/utils/proxyHandlers.ts"],"names":[],"mappings":";;;AAEA,MAAM,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAA;AAOvC,MAAM,SAAS,GAAG,CAAI,CAA4B,EAAW,EAAE;IACpE,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;AAC7B,CAAC,CAAA;AALY,QAAA,SAAS,aAKrB;AAGM,MAAM,aAAa,GAAG,CAAC,CAAU,EAAQ,EAAE;IAChD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE;QACjC,YAAY,EAAE,KAAK;QACnB,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,IAAI;KACZ,CAAC,CAAA;AACJ,CAAC,CAAA;AANY,QAAA,aAAa,iBAMzB;AAEM,MAAM,yBAAyB,GACpC,CAAI,MAAS,EAAE,IAAa,EAAE,UAAsB,EAAE,EAAE,CACxD,KAAK,EAAE,GAAG,IAAe,EAAoB,EAAE;IAC7C,MAAM,UAAU,CAAC,OAAO,CAAC;QACvB,QAAQ,EAAE,IAAc;QACxB,sBAAsB,EAAE,KAAK;KAC9B,CAAC,CAAA;IAIF,MAAM,MAAM,GAAG,MAAO,MAAM,CAAC,IAAI,CAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;IACrE,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAZU,QAAA,yBAAyB,6BAYnC;AAEI,MAAM,wBAAwB,GAAG,CACtC,MAAS,EACT,IAAa,EACJ,EAAE;IACX,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAE7B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QAWnC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAA;QACpC,MAAM,iBAAiB,GAAG;YAKxB,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,IAAe;gBAC5C,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;YACvC,CAAC;SACF,CAAA;QAED,OAAO,iBAAiB,CAAC,cAAc,CAAC,CAAA;IAC1C,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAhCY,QAAA,wBAAwB,4BAgCpC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'mocha';
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
require("mocha");
|
4
|
+
const chai_1 = require("chai");
|
5
|
+
const proxyHandlers_1 = require("./proxyHandlers");
|
6
|
+
describe('proxiedGetWithoutAnalyze', () => {
|
7
|
+
it('should ensure proxied function names match originals', () => {
|
8
|
+
class Original {
|
9
|
+
constructor() {
|
10
|
+
this.arrowFn = () => 'hello';
|
11
|
+
}
|
12
|
+
method() {
|
13
|
+
return 'world';
|
14
|
+
}
|
15
|
+
}
|
16
|
+
const original = new Original();
|
17
|
+
const proxied = new Proxy(original, {
|
18
|
+
get(target, prop) {
|
19
|
+
return (0, proxyHandlers_1.proxiedGetWithoutAnalyze)(target, prop);
|
20
|
+
}
|
21
|
+
});
|
22
|
+
chai_1.assert.equal(proxied.arrowFn.name, original.arrowFn.name);
|
23
|
+
chai_1.assert.equal(proxied.method.name, original.method.name);
|
24
|
+
chai_1.assert.equal(proxied.constructor.name, original.constructor.name);
|
25
|
+
});
|
26
|
+
});
|
27
|
+
//# sourceMappingURL=proxyHandlers.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"proxyHandlers.test.js","sourceRoot":"","sources":["../../src/utils/proxyHandlers.test.ts"],"names":[],"mappings":";;AAAA,iBAAc;AACd,+BAA6B;AAC7B,mDAA0D;AAG1D,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,QAAQ;YAAd;gBACE,YAAO,GAAG,GAAG,EAAE,CAAC,OAAO,CAAA;YAIzB,CAAC;YAHC,MAAM;gBACJ,OAAO,OAAO,CAAA;YAChB,CAAC;SACF;QACD,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA;QAC/B,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClC,GAAG,CAAC,MAAM,EAAE,IAAoB;gBAC9B,OAAO,IAAA,wCAAwB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAC/C,CAAC;SACF,CAAC,CAAA;QACF,aAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACzD,aAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACvD,aAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACnE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'mocha';
|