@axe-core/watcher 0.0.1-next.ce3a6d7b → 0.0.1-next.dccc616f

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.
@@ -0,0 +1,9 @@
1
+ declare abstract class Controller {
2
+ protected abstract executeScript(fn: string | (() => Promise<void>)): Promise<void>;
3
+ start(): Promise<void>;
4
+ stop(): Promise<void>;
5
+ analyze(): Promise<void>;
6
+ /** Flush all axe-core results by sending them to the server. */
7
+ flush(): Promise<void>;
8
+ }
9
+ export default Controller;
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var fs_1 = __importDefault(require("fs"));
43
+ var util_1 = require("./util");
44
+ var updateAutoAnalyze = function (val) {
45
+ var fileContents = fs_1.default.readFileSync(util_1.PATH_TO_EXTENSION_VARIABLES, 'utf-8');
46
+ var jsonValue = JSON.parse(fileContents);
47
+ jsonValue.auto_analyze = val;
48
+ fs_1.default.writeFileSync(util_1.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(jsonValue));
49
+ };
50
+ var Controller = /** @class */ (function () {
51
+ function Controller() {
52
+ }
53
+ Controller.prototype.start = function () {
54
+ return __awaiter(this, void 0, void 0, function () {
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0:
58
+ updateAutoAnalyze(true);
59
+ return [4 /*yield*/, this.executeScript(function () {
60
+ var event = new CustomEvent('axe:start-auto-mode');
61
+ window.dispatchEvent(event);
62
+ return Promise.resolve();
63
+ })];
64
+ case 1:
65
+ _a.sent();
66
+ return [2 /*return*/];
67
+ }
68
+ });
69
+ });
70
+ };
71
+ Controller.prototype.stop = function () {
72
+ return __awaiter(this, void 0, void 0, function () {
73
+ return __generator(this, function (_a) {
74
+ switch (_a.label) {
75
+ case 0:
76
+ updateAutoAnalyze(false);
77
+ return [4 /*yield*/, this.executeScript(function () {
78
+ var event = new CustomEvent('axe:stop-auto-mode');
79
+ window.dispatchEvent(event);
80
+ return Promise.resolve();
81
+ })];
82
+ case 1:
83
+ _a.sent();
84
+ return [2 /*return*/];
85
+ }
86
+ });
87
+ });
88
+ };
89
+ Controller.prototype.analyze = function () {
90
+ return __awaiter(this, void 0, void 0, function () {
91
+ return __generator(this, function (_a) {
92
+ switch (_a.label) {
93
+ case 0: return [4 /*yield*/, this.executeScript(function () {
94
+ return new Promise(function (resolve) {
95
+ var event = new CustomEvent('axe:manual-mode-analyze');
96
+ var fn = function () {
97
+ window.removeEventListener('axe:manual-mode-analyze-done', fn);
98
+ resolve();
99
+ };
100
+ window.addEventListener('axe:manual-mode-analyze-done', fn);
101
+ window.dispatchEvent(event);
102
+ });
103
+ })];
104
+ case 1:
105
+ _a.sent();
106
+ return [2 /*return*/];
107
+ }
108
+ });
109
+ });
110
+ };
111
+ /** Flush all axe-core results by sending them to the server. */
112
+ Controller.prototype.flush = function () {
113
+ return __awaiter(this, void 0, void 0, function () {
114
+ return __generator(this, function (_a) {
115
+ switch (_a.label) {
116
+ case 0: return [4 /*yield*/, this.executeScript(function () {
117
+ return new Promise(function (resolve) {
118
+ var fn = function () {
119
+ window.removeEventListener('axe:flush-end', fn);
120
+ resolve();
121
+ };
122
+ window.addEventListener('axe:flush-end', fn);
123
+ var event = new CustomEvent('axe:flush-start');
124
+ window.dispatchEvent(event);
125
+ });
126
+ })];
127
+ case 1:
128
+ _a.sent();
129
+ return [2 /*return*/];
130
+ }
131
+ });
132
+ });
133
+ };
134
+ return Controller;
135
+ }());
136
+ exports.default = Controller;
137
+ //# sourceMappingURL=Controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Controller.js","source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AM,KAAK,GAAG,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAAA;gCACxD,IAAM,EAAE,GAAG;oCACT,MAAM,CAAC,mBAAmB,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAA;oCAC9D,OAAO,EAAE,CAAA;gCACX,CAAC,CAAA;gCACD,MAAM,CAAC,gBAAgB,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAA;gCAC3D,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;4BAC7B,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAC,EAAA;;wBAVF,SAUE,CAAA;;;;;KACH;IAED,gEAAgE;IACnD,0BAAK,GAAlB;;;;4BACE,qBAAM,IAAI,CAAC,aAAa,CAAC;4BACvB,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO;gCACxB,IAAM,EAAE,GAAG;oCACT,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;oCAC/C,OAAO,EAAE,CAAA;gCACX,CAAC,CAAA;gCACD,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;gCAC5C,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,iBAAiB,CAAC,CAAA;gCAChD,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;4BAC7B,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAC,EAAA;;wBAVF,SAUE,CAAA;;;;;KACH;IACH,iBAAC;AAAD,CAAC,AAnDD,IAmDC;AAED,kBAAe,UAAU,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type Cypress from 'cypress';
2
+ import { Configuration } from './util';
3
+ /**
4
+ * Create a Cypress config that uses the axe Watcher extension.
5
+ *
6
+ * @param config Cypress config to extend
7
+ */
8
+ export declare const cypressConfig: (config: Cypress.ConfigOptions & Configuration) => Cypress.ConfigOptions;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.cypressConfig = void 0;
26
+ var util_1 = require("./util");
27
+ /**
28
+ * Create a Cypress config that uses the axe Watcher extension.
29
+ *
30
+ * @param config Cypress config to extend
31
+ */
32
+ var cypressConfig = function (config) {
33
+ var axe = config.axe, userConfig = __rest(config, ["axe"]);
34
+ (0, util_1.writeVariables)(axe);
35
+ (0, util_1.writeManifest)({
36
+ all_frames: true,
37
+ exclude_globs: [
38
+ // Top-level Cypress page.
39
+ '*/__/#/specs/runner?file=*',
40
+ // Cypress-specific iframes.
41
+ '*/__cypress/iframes/*'
42
+ ]
43
+ });
44
+ return __assign(__assign({}, userConfig), { e2e: __assign(__assign({}, userConfig.e2e), { setupNodeEvents: function (on) {
45
+ on('before:browser:launch', function (browser, launchOptions) {
46
+ var _a;
47
+ // We only support Chrome.
48
+ if (browser.name === 'chrome') {
49
+ if (browser.isHeadless) {
50
+ throw new util_1.HeadlessNotSupportedError();
51
+ }
52
+ // Load the extension.
53
+ (_a = launchOptions.args).push.apply(_a, util_1.extensionArgs);
54
+ }
55
+ return launchOptions;
56
+ });
57
+ } }) });
58
+ };
59
+ exports.cypressConfig = cypressConfig;
60
+ //# sourceMappingURL=cypress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAMe;AAEf;;;;GAIG;AAEI,IAAM,aAAa,GAAG,UAC3B,MAA6C;IAErC,IAAA,GAAG,GAAoB,MAAM,IAA1B,EAAK,UAAU,UAAK,MAAM,EAA/B,OAAsB,CAAF,CAAW;IAErC,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IACnB,IAAA,oBAAa,EAAC;QACZ,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE;YACb,0BAA0B;YAC1B,4BAA4B;YAC5B,4BAA4B;YAC5B,uBAAuB;SACxB;KACF,CAAC,CAAA;IAEF,6BACK,UAAU,KACb,GAAG,wBACE,UAAU,CAAC,GAAG,KACjB,eAAe,YAAC,EAAE;gBAChB,EAAE,CAAC,uBAAuB,EAAE,UAAC,OAAO,EAAE,aAAa;;oBACjD,0BAA0B;oBAC1B,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;wBAC7B,IAAI,OAAO,CAAC,UAAU,EAAE;4BACtB,MAAM,IAAI,gCAAyB,EAAE,CAAA;yBACtC;wBAED,sBAAsB;wBACtB,CAAA,KAAA,aAAa,CAAC,IAAI,CAAA,CAAC,IAAI,WAAI,oBAAa,EAAC;qBAC1C;oBAED,OAAO,aAAa,CAAA;gBACtB,CAAC,CAAC,CAAA;YACJ,CAAC,OAEJ;AACH,CAAC,CAAA;AArCY,QAAA,aAAa,iBAqCzB"}
@@ -0,0 +1,15 @@
1
+ export {};
2
+ declare global {
3
+ namespace Cypress {
4
+ interface Chainable {
5
+ /** Flush the axe-core result queue by sending results to the server. */
6
+ axeFlush(): Chainable<void>;
7
+ /** Perform a manual axe-core analysis. */
8
+ axeAnalyze(): Chainable<void>;
9
+ /** Start automatic analysis mode. */
10
+ axeStart(): Chainable<void>;
11
+ /** Stop automatic analysis mode. */
12
+ axeStop(): Chainable<void>;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ Cypress.Commands.add('axeFlush', function () {
4
+ cy.window().then(function (win) {
5
+ return new Promise(function (resolve) {
6
+ var fn = function () {
7
+ win.removeEventListener('axe:flush-end', fn);
8
+ resolve();
9
+ };
10
+ win.addEventListener('axe:flush-end', fn);
11
+ var event = new CustomEvent('axe:flush-start');
12
+ win.dispatchEvent(event);
13
+ });
14
+ });
15
+ });
16
+ Cypress.Commands.add('axeAnalyze', function () {
17
+ cy.window().then(function (win) {
18
+ return new Promise(function (resolve) {
19
+ var event = new CustomEvent('axe:manual-mode-analyze');
20
+ var fn = function () {
21
+ win.removeEventListener('axe:manual-mode-analyze-done', fn);
22
+ resolve();
23
+ };
24
+ win.addEventListener('axe:manual-mode-analyze-done', fn);
25
+ win.dispatchEvent(event);
26
+ });
27
+ });
28
+ });
29
+ Cypress.Commands.add('axeStart', function () {
30
+ cy.window().then(function (win) {
31
+ var event = new CustomEvent('axe:start-auto-mode');
32
+ win.dispatchEvent(event);
33
+ return Promise.resolve();
34
+ });
35
+ });
36
+ Cypress.Commands.add('axeStop', function () {
37
+ cy.window().then(function (win) {
38
+ var event = new CustomEvent('axe:stop-auto-mode');
39
+ win.dispatchEvent(event);
40
+ return Promise.resolve();
41
+ });
42
+ });
43
+ //# sourceMappingURL=cypressCommands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cypressCommands.js","sourceRoot":"","sources":["../src/cypressCommands.ts"],"names":[],"mappings":";;AAmBA,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE;IAC/B,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;QAClB,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO;YAC9B,IAAM,EAAE,GAAG;gBACT,GAAG,CAAC,mBAAmB,CAAC,eAAe,EA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AAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,oBAAoB,CAAC,CAAA;QACnD,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- /*! Copyright Deque 2001-2022 All Rights Reserved */
1
+ /*! Copyright Deque 2021-2022 All Rights Reserved */
2
2
  export { puppeteerConfig, PuppeteerController } from './puppeteer';
3
3
  export { wdioConfig, wdioTestRunner, WdioController } from './wdio';
4
4
  export { webdriverConfig, WebdriverController } from './webdriver';
5
5
  export { playwrightConfig, PlaywrightController } from './playwright';
6
+ export { cypressConfig } from './cypress';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- /*! Copyright Deque 2001-2022 All Rights Reserved */
2
+ /*! Copyright Deque 2021-2022 All Rights Reserved */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PlaywrightController = exports.playwrightConfig = exports.WebdriverController = exports.webdriverConfig = exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = exports.PuppeteerController = exports.puppeteerConfig = void 0;
4
+ exports.cypressConfig = exports.PlaywrightController = exports.playwrightConfig = exports.WebdriverController = exports.webdriverConfig = exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = exports.PuppeteerController = exports.puppeteerConfig = void 0;
5
5
  var puppeteer_1 = require("./puppeteer");
6
6
  Object.defineProperty(exports, "puppeteerConfig", { enumerable: true, get: function () { return puppeteer_1.puppeteerConfig; } });
7
7
  Object.defineProperty(exports, "PuppeteerController", { enumerable: true, get: function () { return puppeteer_1.PuppeteerController; } });
@@ -15,4 +15,6 @@ Object.defineProperty(exports, "WebdriverController", { enumerable: true, get: f
15
15
  var playwright_1 = require("./playwright");
16
16
  Object.defineProperty(exports, "playwrightConfig", { enumerable: true, get: function () { return playwright_1.playwrightConfig; } });
17
17
  Object.defineProperty(exports, "PlaywrightController", { enumerable: true, get: function () { return playwright_1.PlaywrightController; } });
18
+ var cypress_1 = require("./cypress");
19
+ Object.defineProperty(exports, "cypressConfig", { enumerable: true, get: function () { return cypress_1.cypressConfig; } });
18
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,+BAAmE;AAA1D,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AACnD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,2CAAqE;AAA5D,8GAAA,gBAAgB,OAAA;AAAE,kHAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,+BAAmE;AAA1D,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AACnD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,2CAAqE;AAA5D,8GAAA,gBAAgB,OAAA;AAAE,kHAAA,oBAAoB,OAAA;AAC/C,qCAAyC;AAAhC,wGAAA,aAAa,OAAA"}
@@ -1,5 +1,6 @@
1
- import { Configuration, Controller } from './util';
2
1
  import type { LaunchOptions, Page } from 'playwright';
2
+ import { Configuration } from './util';
3
+ import Controller from './Controller';
3
4
  /**
4
5
  * Creates a Playwright config that uses axe extension
5
6
  *
@@ -72,9 +72,13 @@ var __rest = (this && this.__rest) || function (s, e) {
72
72
  }
73
73
  return t;
74
74
  };
75
+ var __importDefault = (this && this.__importDefault) || function (mod) {
76
+ return (mod && mod.__esModule) ? mod : { "default": mod };
77
+ };
75
78
  Object.defineProperty(exports, "__esModule", { value: true });
76
79
  exports.PlaywrightController = exports.playwrightConfig = void 0;
77
80
  var util_1 = require("./util");
81
+ var Controller_1 = __importDefault(require("./Controller"));
78
82
  /**
79
83
  * Creates a Playwright config that uses axe extension
80
84
  *
@@ -85,7 +89,7 @@ function playwrightConfig(opts) {
85
89
  var _a = config.args, args = _a === void 0 ? [] : _a;
86
90
  (0, util_1.writeVariables)(axe);
87
91
  if (config.headless) {
88
- throw new Error('Cannot use extension while headless.');
92
+ throw new util_1.HeadlessNotSupportedError();
89
93
  }
90
94
  args = args.concat(util_1.extensionArgs);
91
95
  return __assign(__assign({}, config), { headless: false, args: args });
@@ -111,6 +115,6 @@ var PlaywrightController = /** @class */ (function (_super) {
111
115
  });
112
116
  };
113
117
  return PlaywrightController;
114
- }(util_1.Controller));
118
+ }(Controller_1.default));
115
119
  exports.PlaywrightController = PlaywrightController;
116
120
  //# sourceMappingURL=playwright.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAKe;AAGf;;;;GAIG;AAEH,SAAgB,gBAAgB,CAC9B,IAAmC;IAE3B,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,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IAGlD,8BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,4CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,2BAAC;AAAD,CAAC,AAbD,CAA0C,oBAAU,GAanD;AAbY,oDAAoB"}
@@ -1,5 +1,6 @@
1
- import { Configuration, Controller } from './util';
2
1
  import type { LaunchOptions, BrowserLaunchArgumentOptions, BrowserConnectOptions, Page } from 'puppeteer';
2
+ import { Configuration } from './util';
3
+ import Controller from './Controller';
3
4
  declare type Options = LaunchOptions & BrowserLaunchArgumentOptions & BrowserConnectOptions;
4
5
  /**
5
6
  * Creates a Puppeteer config that uses axe extension.
package/dist/puppeteer.js CHANGED
@@ -72,9 +72,13 @@ var __rest = (this && this.__rest) || function (s, e) {
72
72
  }
73
73
  return t;
74
74
  };
75
+ var __importDefault = (this && this.__importDefault) || function (mod) {
76
+ return (mod && mod.__esModule) ? mod : { "default": mod };
77
+ };
75
78
  Object.defineProperty(exports, "__esModule", { value: true });
76
79
  exports.PuppeteerController = exports.puppeteerConfig = void 0;
77
80
  var util_1 = require("./util");
81
+ var Controller_1 = __importDefault(require("./Controller"));
78
82
  /**
79
83
  * Creates a Puppeteer config that uses axe extension.
80
84
  *
@@ -85,7 +89,7 @@ function puppeteerConfig(opts) {
85
89
  var _a = config.args, args = _a === void 0 ? [] : _a;
86
90
  (0, util_1.writeVariables)(axe);
87
91
  if (config.headless) {
88
- throw new Error('Cannot use extension while headless.');
92
+ throw new util_1.HeadlessNotSupportedError();
89
93
  }
90
94
  args = args.concat(util_1.extensionArgs);
91
95
  return __assign(__assign({}, config), { headless: false, args: args });
@@ -111,6 +115,6 @@ var PuppeteerController = /** @class */ (function (_super) {
111
115
  });
112
116
  };
113
117
  return PuppeteerController;
114
- }(util_1.Controller));
118
+ }(Controller_1.default));
115
119
  exports.PuppeteerController = PuppeteerController;
116
120
  //# sourceMappingURL=puppeteer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAKe;AAYf;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,IAA6B;IACnD,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;KACxD;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAhBD,0CAgBC;AAED;IAAyC,uCAAU;IAGjD,6BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,2CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,iBAAU,GAalD;AAbY,kDAAmB"}
1
+ {"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,+BAKe;AACf,4DAAqC;AAMrC;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,IAA6B;IACnD,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAhBD,0CAgBC;AAED;IAAyC,uCAAU;IAGjD,6BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,2CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,oBAAU,GAalD;AAbY,kDAAmB"}
package/dist/util.d.ts CHANGED
@@ -3,6 +3,10 @@ export declare const DEFAULT_SERVER_URL = "https://axe.deque.com/";
3
3
  export declare const PATH_TO_SESSION_FILE: string;
4
4
  export declare const PATH_TO_EXTENSION_VARIABLES: string;
5
5
  export declare const extensionArgs: readonly [`--disable-extensions-except=${string}`, `--load-extension=${string}`];
6
+ export declare class HeadlessNotSupportedError extends Error {
7
+ name: string;
8
+ constructor();
9
+ }
6
10
  export interface Configuration {
7
11
  axe: {
8
12
  /** Your axe API key. */
@@ -26,12 +30,10 @@ interface WriteVariablesParams {
26
30
  }
27
31
  /** Write the user's settings to the disk, so the extension can load them. */
28
32
  export declare function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze }: WriteVariablesParams): void;
29
- export declare abstract class Controller {
30
- protected abstract executeScript(fn: string | (() => Promise<void>)): Promise<void>;
31
- start(): Promise<void>;
32
- stop(): Promise<void>;
33
- analyze(): Promise<void>;
34
- /** Flush all axe-core results by sending them to the server. */
35
- flush(): Promise<void>;
33
+ interface WriteManifestParams {
34
+ all_frames: boolean;
35
+ exclude_globs: string[];
36
36
  }
37
+ /** Update the extension manifest file. */
38
+ export declare function writeManifest({ all_frames, exclude_globs }: WriteManifestParams): void;
37
39
  export {};
package/dist/util.js CHANGED
@@ -1,45 +1,24 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
38
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
19
  };
41
20
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.Controller = exports.writeVariables = exports.extensionArgs = exports.PATH_TO_EXTENSION_VARIABLES = exports.PATH_TO_SESSION_FILE = exports.DEFAULT_SERVER_URL = exports.PATH_TO_EXTENSION = void 0;
21
+ exports.writeManifest = exports.writeVariables = exports.HeadlessNotSupportedError = exports.extensionArgs = exports.PATH_TO_EXTENSION_VARIABLES = exports.PATH_TO_SESSION_FILE = exports.DEFAULT_SERVER_URL = exports.PATH_TO_EXTENSION = void 0;
43
22
  var fs_1 = __importDefault(require("fs"));
44
23
  var path_1 = __importDefault(require("path"));
45
24
  var os_1 = __importDefault(require("os"));
@@ -51,6 +30,16 @@ exports.extensionArgs = [
51
30
  "--disable-extensions-except=".concat(exports.PATH_TO_EXTENSION),
52
31
  "--load-extension=".concat(exports.PATH_TO_EXTENSION)
53
32
  ];
33
+ var HeadlessNotSupportedError = /** @class */ (function (_super) {
34
+ __extends(HeadlessNotSupportedError, _super);
35
+ function HeadlessNotSupportedError() {
36
+ var _this = _super.call(this, 'Cannot use extension while headless.') || this;
37
+ _this.name = 'HeadlessNotSupportedError';
38
+ return _this;
39
+ }
40
+ return HeadlessNotSupportedError;
41
+ }(Error));
42
+ exports.HeadlessNotSupportedError = HeadlessNotSupportedError;
54
43
  /** Write the user's settings to the disk, so the extension can load them. */
55
44
  function writeVariables(_a) {
56
45
  var apiKey = _a.apiKey, serverURL = _a.serverURL, sessionId = _a.sessionId, autoAnalyze = _a.autoAnalyze;
@@ -86,97 +75,14 @@ function writeVariables(_a) {
86
75
  }));
87
76
  }
88
77
  exports.writeVariables = writeVariables;
89
- function updateAutoAnalyze(newVal) {
90
- var fileContents = fs_1.default.readFileSync(exports.PATH_TO_EXTENSION_VARIABLES, 'utf-8');
91
- var jsonValue = JSON.parse(fileContents);
92
- jsonValue['auto_analyze'] = newVal;
93
- fs_1.default.writeFileSync(exports.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(jsonValue));
78
+ /** Update the extension manifest file. */
79
+ function writeManifest(_a) {
80
+ var all_frames = _a.all_frames, exclude_globs = _a.exclude_globs;
81
+ var manifestPath = path_1.default.join(exports.PATH_TO_EXTENSION, 'manifest.json');
82
+ var manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
83
+ manifest.content_scripts[0].all_frames = all_frames;
84
+ manifest.content_scripts[0].exclude_globs = exclude_globs;
85
+ fs_1.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
94
86
  }
95
- var Controller = /** @class */ (function () {
96
- function Controller() {
97
- }
98
- Controller.prototype.start = function () {
99
- return __awaiter(this, void 0, void 0, function () {
100
- return __generator(this, function (_a) {
101
- switch (_a.label) {
102
- case 0:
103
- updateAutoAnalyze(true);
104
- return [4 /*yield*/, this.executeScript(function () {
105
- var event = new CustomEvent('axe:start-auto-mode');
106
- window.dispatchEvent(event);
107
- return Promise.resolve();
108
- })];
109
- case 1:
110
- _a.sent();
111
- return [2 /*return*/];
112
- }
113
- });
114
- });
115
- };
116
- Controller.prototype.stop = function () {
117
- return __awaiter(this, void 0, void 0, function () {
118
- return __generator(this, function (_a) {
119
- switch (_a.label) {
120
- case 0:
121
- updateAutoAnalyze(false);
122
- return [4 /*yield*/, this.executeScript(function () {
123
- var event = new CustomEvent('axe:stop-auto-mode');
124
- window.dispatchEvent(event);
125
- return Promise.resolve();
126
- })];
127
- case 1:
128
- _a.sent();
129
- return [2 /*return*/];
130
- }
131
- });
132
- });
133
- };
134
- Controller.prototype.analyze = function () {
135
- return __awaiter(this, void 0, void 0, function () {
136
- return __generator(this, function (_a) {
137
- switch (_a.label) {
138
- case 0: return [4 /*yield*/, this.executeScript(function () {
139
- return new Promise(function (resolve) {
140
- var event = new CustomEvent('axe:manual-mode-analyze');
141
- var fn = function () {
142
- window.removeEventListener('axe:manual-mode-analyze-done', fn);
143
- resolve();
144
- };
145
- window.addEventListener('axe:manual-mode-analyze-done', fn);
146
- window.dispatchEvent(event);
147
- });
148
- })];
149
- case 1:
150
- _a.sent();
151
- return [2 /*return*/];
152
- }
153
- });
154
- });
155
- };
156
- /** Flush all axe-core results by sending them to the server. */
157
- Controller.prototype.flush = function () {
158
- return __awaiter(this, void 0, void 0, function () {
159
- return __generator(this, function (_a) {
160
- switch (_a.label) {
161
- case 0: return [4 /*yield*/, this.executeScript(function () {
162
- return new Promise(function (resolve) {
163
- var fn = function () {
164
- window.removeEventListener('axe:flush-end', fn);
165
- resolve();
166
- };
167
- window.addEventListener('axe:flush-end', fn);
168
- var event = new CustomEvent('axe:flush-start');
169
- window.dispatchEvent(event);
170
- });
171
- })];
172
- case 1:
173
- _a.sent();
174
- return [2 /*return*/];
175
- }
176
- });
177
- });
178
- };
179
- return Controller;
180
- }());
181
- exports.Controller = Controller;
87
+ exports.writeManifest = writeManifest;
182
88
  //# sourceMappingURL=util.js.map