@memlab/e2e 1.0.13 → 1.0.16
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/README.md +2 -2
- package/dist/BaseSynthesizer.d.ts +1 -1
- package/dist/E2EInteractionManager.d.ts +2 -1
- package/dist/E2EInteractionManager.js +17 -7
- package/dist/NetworkManager.d.ts +21 -0
- package/dist/NetworkManager.js +110 -0
- package/dist/ScriptManager.d.ts +24 -0
- package/dist/ScriptManager.js +104 -0
- package/dist/TestRunnerLoader.d.ts +1 -1
- package/dist/TestRunnerLoader.js +1 -1
- package/dist/TypesThirdParty.d.ts +1 -1
- package/dist/TypesThirdParty.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/instrumentation/BaseAstTransform.d.ts +16 -0
- package/dist/instrumentation/BaseAstTransform.js +31 -0
- package/dist/instrumentation/ScriptRewriteManager.d.ts +17 -0
- package/dist/instrumentation/ScriptRewriteManager.js +45 -0
- package/dist/instrumentation/TransformLoader.d.ts +14 -0
- package/dist/instrumentation/TransformLoader.js +21 -0
- package/dist/instrumentation/transforms/InjectSourceInfoTranform.d.ts +17 -0
- package/dist/instrumentation/transforms/InjectSourceInfoTranform.js +62 -0
- package/dist/instrumentation/transforms/InjectSourceInfoTransform.d.ts +17 -0
- package/dist/instrumentation/transforms/InjectSourceInfoTransform.js +63 -0
- package/dist/lib/E2EUtils.d.ts +1 -1
- package/dist/lib/E2EUtils.js +1 -1
- package/dist/lib/SynthesisUtils.d.ts +1 -1
- package/dist/lib/SynthesisUtils.js +1 -1
- package/dist/lib/operations/BackOperation.d.ts +1 -1
- package/dist/lib/operations/BackOperation.js +1 -1
- package/dist/lib/operations/BackspaceOperation.d.ts +1 -1
- package/dist/lib/operations/BackspaceOperation.js +1 -1
- package/dist/lib/operations/BaseOperation.d.ts +1 -1
- package/dist/lib/operations/BaseOperation.js +1 -1
- package/dist/lib/operations/CachePageContent.d.ts +1 -1
- package/dist/lib/operations/CachePageContent.js +1 -1
- package/dist/lib/operations/ClickOperation.d.ts +1 -1
- package/dist/lib/operations/ClickOperation.js +1 -1
- package/dist/lib/operations/CompoundOperation.d.ts +1 -1
- package/dist/lib/operations/CompoundOperation.js +1 -1
- package/dist/lib/operations/EnterOperation.d.ts +1 -1
- package/dist/lib/operations/EnterOperation.js +1 -1
- package/dist/lib/operations/EscOperation.d.ts +1 -1
- package/dist/lib/operations/EscOperation.js +1 -1
- package/dist/lib/operations/HoverOperation.d.ts +1 -1
- package/dist/lib/operations/HoverOperation.js +1 -1
- package/dist/lib/operations/InteractionUtils.d.ts +1 -1
- package/dist/lib/operations/InteractionUtils.js +1 -1
- package/dist/lib/operations/Operations.d.ts +1 -1
- package/dist/lib/operations/Operations.js +1 -1
- package/dist/lib/operations/RevertOperation.d.ts +1 -1
- package/dist/lib/operations/RevertOperation.js +1 -1
- package/dist/lib/operations/RunJSCode.d.ts +1 -1
- package/dist/lib/operations/RunJSCode.js +1 -1
- package/dist/lib/operations/ScrollOperation.d.ts +1 -1
- package/dist/lib/operations/ScrollOperation.js +1 -1
- package/dist/lib/operations/TargetExtraOperation.d.ts +1 -1
- package/dist/lib/operations/TargetExtraOperation.js +1 -1
- package/dist/lib/operations/TestPlanner.d.ts +1 -1
- package/dist/lib/operations/TestPlanner.js +1 -1
- package/dist/lib/operations/TypeOperation.d.ts +1 -1
- package/dist/lib/operations/TypeOperation.js +1 -1
- package/dist/lib/operations/UploadOperation.d.ts +1 -1
- package/dist/lib/operations/UploadOperation.js +1 -1
- package/dist/lib/operations/WaitForElementOperation.d.ts +1 -1
- package/dist/lib/operations/WaitForElementOperation.js +1 -1
- package/dist/lib/operations/WaitOperation.d.ts +1 -1
- package/dist/lib/operations/WaitOperation.js +1 -1
- package/dist/lib/operations/WithCachedPageContent.d.ts +1 -1
- package/dist/lib/operations/WithCachedPageContent.js +1 -1
- package/dist/lib/operations/XVirtualFrameBuffer.d.ts +1 -1
- package/dist/lib/operations/XVirtualFrameBuffer.js +1 -1
- package/dist/plugins/DefaultScenarioSynthesizer.d.ts +1 -1
- package/dist/plugins/DefaultScenarioSynthesizer.js +1 -1
- package/dist/plugins/TestSPAVisitSynthesizer.d.ts +1 -1
- package/dist/plugins/TestSPAVisitSynthesizer.js +2 -2
- package/dist/plugins/scenarios/test-airbnb.d.ts +1 -1
- package/dist/plugins/scenarios/test-airbnb.js +1 -1
- package/dist/plugins/scenarios/test-databricks.d.ts +1 -1
- package/dist/plugins/scenarios/test-databricks.js +1 -1
- package/dist/plugins/scenarios/test-ebay.d.ts +1 -1
- package/dist/plugins/scenarios/test-ebay.js +1 -1
- package/dist/plugins/scenarios/test-google-maps.d.ts +1 -1
- package/dist/plugins/scenarios/test-google-maps.js +1 -1
- package/dist/plugins/scenarios/test-shopify.d.ts +1 -1
- package/dist/plugins/scenarios/test-shopify.js +1 -1
- package/dist/plugins/scenarios/test-youtube.d.ts +1 -1
- package/dist/plugins/scenarios/test-youtube.js +1 -1
- package/package.json +11 -5
- package/static/example/components/layout.jsx +1 -1
- package/static/example/leak-filters/filter-by-retained-size.js +7 -1
- package/static/example/next.config.js +4 -3
- package/static/example/pages/_app.js +1 -1
- package/static/example/pages/_document.js +1 -1
- package/static/example/pages/examples/detached-dom.jsx +9 -3
- package/static/example/pages/examples/oversized-object.jsx +8 -2
- package/static/example/pages/index.js +1 -1
- package/static/example/scenarios/detached-dom.js +7 -6
- package/static/example/scenarios/oversized-leak-filter.js +7 -2
- package/static/example/scenarios/oversized-object-with-filter.js +7 -2
- package/static/example/scenarios/oversized-object.js +4 -4
- package/static/links/min.js +1 -0
- package/static/links/src/App.js +1 -1
- package/static/links/src/index.js +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @oncall
|
|
8
|
+
* @oncall web_perf_infra
|
|
9
9
|
*/
|
|
10
10
|
import type { AnyOptions, CheckPageLoadCallback, IE2EScenarioVisitPlan, IE2EStepBasic } from '@memlab/core';
|
|
11
11
|
import BaseSynthesizer from '../BaseSynthesizer';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @oncall
|
|
8
|
+
* @oncall web_perf_infra
|
|
9
9
|
*/
|
|
10
10
|
import type { AnyOptions, CheckPageLoadCallback, IE2EScenarioVisitPlan, IE2EStepBasic } from '@memlab/core';
|
|
11
11
|
import BaseSynthesizer from '../BaseSynthesizer';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -26,7 +26,7 @@ const BaseSynthesizer_1 = __importDefault(require("../BaseSynthesizer"));
|
|
|
26
26
|
const ClickOperation_1 = __importDefault(require("../lib/operations/ClickOperation"));
|
|
27
27
|
const InteractionUtils_1 = __importDefault(require("../lib/operations/InteractionUtils"));
|
|
28
28
|
class TestSPAVisitSynthesizer extends BaseSynthesizer_1.default {
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
30
|
getBaseURL(_options = {}) {
|
|
31
31
|
const indexFile = path_1.default.join(__dirname, '..', '..', 'static', 'links', 'index.html');
|
|
32
32
|
return `file://${indexFile}`;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/e2e",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "memlab browser E2E interaction libraries",
|
|
6
6
|
"author": "Liang Gong <lgong@fb.com>",
|
|
@@ -30,9 +30,15 @@
|
|
|
30
30
|
"puppeteer": "^13.5.1",
|
|
31
31
|
"string-width": "^4.2.0",
|
|
32
32
|
"util.promisify": "^1.1.1",
|
|
33
|
-
"xvfb": "^0.4.0"
|
|
33
|
+
"xvfb": "^0.4.0",
|
|
34
|
+
"@babel/parser": "^7.16.4",
|
|
35
|
+
"@babel/traverse": "^7.16.3",
|
|
36
|
+
"@babel/generator": "^7.16.0",
|
|
37
|
+
"@babel/template": "^7.16.0"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
40
|
+
"@babel/types": "^7.16.0",
|
|
41
|
+
"@types/babel-core": "^6.25.7",
|
|
36
42
|
"@types/fs-extra": "^9.0.3",
|
|
37
43
|
"@types/jest": "^27.4.1",
|
|
38
44
|
"@types/minimist": "^1.2.2",
|
|
@@ -44,7 +50,7 @@
|
|
|
44
50
|
},
|
|
45
51
|
"repository": {
|
|
46
52
|
"type": "git",
|
|
47
|
-
"url": "git+https://github.com/
|
|
53
|
+
"url": "git+https://github.com/facebook/memlab.git",
|
|
48
54
|
"directory": "packages/e2e"
|
|
49
55
|
},
|
|
50
56
|
"scripts": {
|
|
@@ -53,7 +59,7 @@
|
|
|
53
59
|
"clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
|
|
54
60
|
},
|
|
55
61
|
"bugs": {
|
|
56
|
-
"url": "https://github.com/
|
|
62
|
+
"url": "https://github.com/facebook/memlab/issues"
|
|
57
63
|
},
|
|
58
|
-
"homepage": "https://github.com/
|
|
64
|
+
"homepage": "https://github.com/facebook/memlab#readme"
|
|
59
65
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
|
|
7
8
|
/** @type {import('next').NextConfig} */
|
|
8
9
|
const nextConfig = {
|
|
9
10
|
reactStrictMode: true,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
8
|
import Link from 'next/link';
|
|
4
9
|
import React from 'react';
|
|
5
10
|
|
|
6
11
|
export default function DetachedDom() {
|
|
7
|
-
|
|
8
12
|
const addNewItem = () => {
|
|
9
13
|
if (!window.leakedObjects) {
|
|
10
14
|
window.leakedObjects = [];
|
|
@@ -12,7 +16,9 @@ export default function DetachedDom() {
|
|
|
12
16
|
for (let i = 0; i < 1024; i++) {
|
|
13
17
|
window.leakedObjects.push(document.createElement('div'));
|
|
14
18
|
}
|
|
15
|
-
console.log(
|
|
19
|
+
console.log(
|
|
20
|
+
'Detached DOMs are created. Please check Memory tab in devtools',
|
|
21
|
+
);
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
return (
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
6
|
+
*/
|
|
7
|
+
|
|
2
8
|
import Link from 'next/link';
|
|
3
9
|
import React, {useEffect} from 'react';
|
|
4
10
|
|
|
@@ -21,7 +27,7 @@ export default function OversizedObject() {
|
|
|
21
27
|
<div className="row">
|
|
22
28
|
<Link href="/">Go back</Link>
|
|
23
29
|
</div>
|
|
24
|
-
<br/>
|
|
30
|
+
<br />
|
|
25
31
|
<div className="row">
|
|
26
32
|
Object<code>bigArray</code>is leaked. Please check <code>Memory</code>{' '}
|
|
27
33
|
tab in devtools
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
|
|
7
8
|
// memlab/packages/e2e/static/example/scenario/detached-dom.js
|
|
8
9
|
/**
|
|
9
10
|
* The initial `url` of the scenario we would like to run.
|
|
10
11
|
*/
|
|
11
12
|
function url() {
|
|
12
|
-
return
|
|
13
|
+
return 'http://localhost:3000/examples/detached-dom';
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -21,7 +22,7 @@ function url() {
|
|
|
21
22
|
*/
|
|
22
23
|
async function action(page) {
|
|
23
24
|
const elements = await page.$x(
|
|
24
|
-
"//button[contains(., 'Create detached DOMs')]"
|
|
25
|
+
"//button[contains(., 'Create detached DOMs')]",
|
|
25
26
|
);
|
|
26
27
|
const [button] = elements;
|
|
27
28
|
if (button) {
|
|
@@ -42,4 +43,4 @@ async function back(page) {
|
|
|
42
43
|
await page.click('a[href="/"]');
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
module.exports = {
|
|
46
|
+
module.exports = {action, back, url};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
8
|
// leakFilter is called with each object (node) in browser
|
|
4
9
|
// allocated by `action` but not released after the `back` call
|
|
@@ -6,4 +11,4 @@ function leakFilter(node, _snapshot, _leakedNodeIds) {
|
|
|
6
11
|
return node.retainedSize > 1000 * 1000;
|
|
7
12
|
}
|
|
8
13
|
|
|
9
|
-
module.exports = {
|
|
14
|
+
module.exports = {leakFilter};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
8
|
function url() {
|
|
4
9
|
return 'http://localhost:3000/';
|
|
@@ -20,4 +25,4 @@ function leakFilter(node, _snapshot, _leakedNodeIds) {
|
|
|
20
25
|
return node.retainedSize > 1000 * 1000;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
module.exports = {
|
|
28
|
+
module.exports = {action, back, leakFilter, url};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
4
|
+
* @nolint
|
|
5
|
+
* @oncall web_perf_infra
|
|
5
6
|
*/
|
|
6
|
-
/* @nolint */
|
|
7
7
|
|
|
8
8
|
function url() {
|
|
9
9
|
return 'http://localhost:3000/';
|
|
@@ -19,4 +19,4 @@ async function back(page) {
|
|
|
19
19
|
await page.click('a[href="/"]');
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
module.exports = {
|
|
22
|
+
module.exports = {action, back, url};
|