@memlab/e2e 1.0.4 → 1.0.7
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/index.d.ts +2 -0
- package/dist/index.js +19 -1
- package/dist/lib/operations/TestPlanner.d.ts +1 -0
- package/dist/lib/operations/TestPlanner.js +16 -1
- package/dist/plugins/scenarios/test-airbnb.d.ts +0 -1
- package/dist/plugins/scenarios/test-airbnb.js +0 -1
- package/dist/plugins/scenarios/test-databricks.d.ts +0 -1
- package/dist/plugins/scenarios/test-databricks.js +1 -2
- package/dist/plugins/scenarios/test-ebay.d.ts +0 -1
- package/dist/plugins/scenarios/test-ebay.js +0 -1
- package/dist/plugins/scenarios/test-google-maps.d.ts +0 -1
- package/dist/plugins/scenarios/test-google-maps.js +0 -1
- package/dist/plugins/scenarios/test-shopify.d.ts +0 -1
- package/dist/plugins/scenarios/test-shopify.js +0 -1
- package/dist/plugins/scenarios/test-youtube.d.ts +0 -1
- package/dist/plugins/scenarios/test-youtube.js +0 -1
- package/package.json +2 -2
- package/static/example/pages/_app.js +0 -1
- package/static/example/pages/_document.js +0 -1
- package/static/example/pages/index.js +0 -1
- package/static/links/src/App.js +0 -1
- package/static/links/src/index.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* @emails oncall+ws_labs
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare function registerPackage(): Promise<void>;
|
|
10
12
|
export { default as defaultTestPlanner } from './lib/operations/TestPlanner';
|
|
11
13
|
export * from './lib/operations/TestPlanner';
|
|
12
14
|
export { default as Xvfb } from './lib/operations/XVirtualFrameBuffer';
|
package/dist/index.js
CHANGED
|
@@ -22,11 +22,29 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
22
22
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
23
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
24
|
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
25
34
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
36
|
};
|
|
28
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.E2EUtils = exports.BaseSynthesizer = exports.E2EInteractionManager = exports.Xvfb = exports.defaultTestPlanner = void 0;
|
|
38
|
+
exports.E2EUtils = exports.BaseSynthesizer = exports.E2EInteractionManager = exports.Xvfb = exports.defaultTestPlanner = exports.registerPackage = void 0;
|
|
39
|
+
const path_1 = __importDefault(require("path"));
|
|
40
|
+
const core_1 = require("@memlab/core");
|
|
41
|
+
/** @internal */
|
|
42
|
+
function registerPackage() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return core_1.PackageInfoLoader.registerPackage(path_1.default.join(__dirname, '..'));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.registerPackage = registerPackage;
|
|
30
48
|
var TestPlanner_1 = require("./lib/operations/TestPlanner");
|
|
31
49
|
Object.defineProperty(exports, "defaultTestPlanner", { enumerable: true, get: function () { return __importDefault(TestPlanner_1).default; } });
|
|
32
50
|
__exportStar(require("./lib/operations/TestPlanner"), exports);
|
|
@@ -31,6 +31,7 @@ export declare class TestPlanner {
|
|
|
31
31
|
private prepareSynthesizer;
|
|
32
32
|
private generateVisitPlan;
|
|
33
33
|
loadCookies(visitPlan: IE2EScenarioVisitPlan, synthesizer: IE2EScenarioSynthesizer): Cookies;
|
|
34
|
+
private populateDomainInCookiesFromScenario;
|
|
34
35
|
private populateDomainInCookies;
|
|
35
36
|
private setSnapshotMode;
|
|
36
37
|
private assignSnapshotIds;
|
|
@@ -107,7 +107,8 @@ class TestPlanner {
|
|
|
107
107
|
loadCookies(visitPlan, synthesizer) {
|
|
108
108
|
var _a;
|
|
109
109
|
if (this.scenario && this.scenario.cookies) {
|
|
110
|
-
|
|
110
|
+
const cookies = this.scenario.cookies();
|
|
111
|
+
return this.populateDomainInCookiesFromScenario(cookies, this.scenario);
|
|
111
112
|
}
|
|
112
113
|
let cookieFile = synthesizer.getCookieFile(visitPlan);
|
|
113
114
|
// if no cookie file is specified
|
|
@@ -122,6 +123,20 @@ class TestPlanner {
|
|
|
122
123
|
const cookies = JSON.parse(fs_1.default.readFileSync(cookieFile, 'UTF-8'));
|
|
123
124
|
return this.populateDomainInCookies(cookies, synthesizer.getDomain(), synthesizer.getDomainPrefixes());
|
|
124
125
|
}
|
|
126
|
+
populateDomainInCookiesFromScenario(cookies, scenario) {
|
|
127
|
+
const ret = [];
|
|
128
|
+
const url = new URL(scenario.url());
|
|
129
|
+
const domain = '.' + url.hostname.split('.').slice(1).join('.');
|
|
130
|
+
for (const cookie of cookies) {
|
|
131
|
+
if (cookie.domain) {
|
|
132
|
+
ret.push(Object.assign({}, cookie));
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
ret.push(Object.assign(Object.assign({}, cookie), { domain }));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return ret;
|
|
139
|
+
}
|
|
125
140
|
populateDomainInCookies(cookies, domain, domainPrefixes) {
|
|
126
141
|
const cookiesTemplate = cookies;
|
|
127
142
|
const ret = [];
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
10
9
|
* @oncall ws_labs
|
|
11
10
|
*/
|
|
@@ -36,6 +35,6 @@ function back(page) {
|
|
|
36
35
|
}
|
|
37
36
|
// specify the number of repeat for the action
|
|
38
37
|
function repeat() {
|
|
39
|
-
return
|
|
38
|
+
return 1;
|
|
40
39
|
}
|
|
41
40
|
module.exports = { action, back, repeat, url };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/e2e",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "memlab browser E2E interaction libraries",
|
|
6
6
|
"author": "Liang Gong <lgong@fb.com>",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"static"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@memlab/core": "^1.
|
|
23
|
+
"@memlab/core": "^1.1.6",
|
|
24
24
|
"ansi": "^0.3.1",
|
|
25
25
|
"babar": "^0.2.0",
|
|
26
26
|
"chalk": "^4.0.0",
|
package/static/links/src/App.js
CHANGED