@haibun/web-playwright 1.74.0 → 1.74.1
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/package.json +4 -4
- package/build/cycles.1.d.ts +0 -4
- package/build/cycles.1.d.ts.map +0 -1
- package/build/cycles.1.js +0 -93
- package/build/cycles.1.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haibun/web-playwright",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.74.
|
|
4
|
+
"version": "1.74.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "build/web-playwright.js",
|
|
7
7
|
"exports": { ".": "./build/web-playwright.js", "./*": "./build/*" },
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@haibun/core": "1.74.
|
|
23
|
-
"@haibun/domain-storage": "1.74.
|
|
24
|
-
"@haibun/storage-mem": "1.74.
|
|
22
|
+
"@haibun/core": "1.74.1",
|
|
23
|
+
"@haibun/domain-storage": "1.74.1",
|
|
24
|
+
"@haibun/storage-mem": "1.74.1",
|
|
25
25
|
"playwright": "1.52"
|
|
26
26
|
},
|
|
27
27
|
"gitHead": "7cf9680bd922fb622fb59f1e6bf5b65284cb8fd5",
|
package/build/cycles.1.d.ts
DELETED
package/build/cycles.1.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cycles.1.d.ts","sourceRoot":"","sources":["../src/cycles.1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiG,MAAM,gCAAgC,CAAC;AAO/J,OAAO,aAAmC,MAAM,qBAAqB,CAAC;AAGtE,eAAO,MAAM,MAAM,GAAI,IAAI,aAAa,KAAG,cAsFzC,CAAC"}
|
package/build/cycles.1.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { DOMAIN_STRING } from '@haibun/core/build/lib/domain-types.js';
|
|
2
|
-
import { EExecutionMessageType } from '@haibun/core/build/lib/interfaces/logger.js';
|
|
3
|
-
import { sleep } from '@haibun/core/build/lib/util/index.js';
|
|
4
|
-
import { rmSync } from 'fs';
|
|
5
|
-
import { createResolvedFeaturesArtifact } from './cycles.js';
|
|
6
|
-
import { DOMAIN_PAGE_LOCATOR } from './domains.js';
|
|
7
|
-
import WebPlaywright, { EMonitoringTypes } from './web-playwright.js';
|
|
8
|
-
export const cycles = (wp) => ({
|
|
9
|
-
getDomains() {
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
selectors: [DOMAIN_PAGE_LOCATOR],
|
|
13
|
-
coerce: (value) => String(value)
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
selectors: [DOMAIN_PAGE_LOCATOR, DOMAIN_STRING],
|
|
17
|
-
coerce: (value) => String(value)
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
},
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
-
async onFailure({ failedStep }) {
|
|
23
|
-
if (wp.bf?.hasPage(wp.getWorld().tag, wp.tab)) {
|
|
24
|
-
await wp.captureFailureScreenshot(EExecutionMessageType.ON_FAILURE, failedStep);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
async startFeature({ resolvedFeature, index }) {
|
|
28
|
-
if (WebPlaywright.twinPage) {
|
|
29
|
-
WebPlaywright.twinPage.updateWorld(wp.getWorld());
|
|
30
|
-
}
|
|
31
|
-
if (wp.monitor === EMonitoringTypes.MONITOR_EACH) {
|
|
32
|
-
await wp.createMonitor();
|
|
33
|
-
}
|
|
34
|
-
if (WebPlaywright.monitorHandler) {
|
|
35
|
-
await WebPlaywright.monitorHandler.updateWorld(wp.getWorld());
|
|
36
|
-
}
|
|
37
|
-
await sleep(1000);
|
|
38
|
-
await createResolvedFeaturesArtifact(wp, `feature-${index}`, [resolvedFeature], index);
|
|
39
|
-
},
|
|
40
|
-
async endFeature({ shouldClose = true }) {
|
|
41
|
-
// leave web server running if there was a failure and it's the last feature
|
|
42
|
-
if (shouldClose) {
|
|
43
|
-
for (const file of wp.downloaded) {
|
|
44
|
-
wp.getWorld().logger.debug(`removing ${JSON.stringify(file)}`);
|
|
45
|
-
rmSync(file);
|
|
46
|
-
wp.downloaded = [];
|
|
47
|
-
}
|
|
48
|
-
if (wp.hasFactory) {
|
|
49
|
-
if (wp.captureVideo) {
|
|
50
|
-
const page = await wp.getPage();
|
|
51
|
-
const path = await wp.storage.getRelativePath(await page.video().path());
|
|
52
|
-
const artifact = { artifactType: 'video', path };
|
|
53
|
-
const context = {
|
|
54
|
-
incident: EExecutionMessageType.FEATURE_END,
|
|
55
|
-
artifacts: [artifact],
|
|
56
|
-
tag: wp.getWorld().tag
|
|
57
|
-
};
|
|
58
|
-
wp.getWorld().logger.log('feature video', context);
|
|
59
|
-
}
|
|
60
|
-
// close the context, which closes any pages
|
|
61
|
-
if (wp.hasFactory) {
|
|
62
|
-
await wp.bf?.closeContext(wp.getWorld().tag);
|
|
63
|
-
}
|
|
64
|
-
await wp.bf?.close();
|
|
65
|
-
wp.bf = undefined;
|
|
66
|
-
wp.hasFactory = false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (wp.twin) {
|
|
70
|
-
await WebPlaywright.twinPage.writePage();
|
|
71
|
-
}
|
|
72
|
-
if (wp.monitor === EMonitoringTypes.MONITOR_EACH) {
|
|
73
|
-
await wp.callClosers();
|
|
74
|
-
await WebPlaywright.monitorHandler.writeMonitor();
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
async startExecution(resolvedFeatures) {
|
|
78
|
-
if (wp.monitor === EMonitoringTypes.MONITOR_ALL) {
|
|
79
|
-
await wp.createMonitor();
|
|
80
|
-
}
|
|
81
|
-
if (wp.twin) {
|
|
82
|
-
await wp.createTwin();
|
|
83
|
-
}
|
|
84
|
-
await createResolvedFeaturesArtifact(wp, 'features', resolvedFeatures);
|
|
85
|
-
},
|
|
86
|
-
async endExecution() {
|
|
87
|
-
if (wp.monitor === EMonitoringTypes.MONITOR_ALL) {
|
|
88
|
-
await wp.callClosers();
|
|
89
|
-
await WebPlaywright.monitorHandler.writeMonitor();
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
//# sourceMappingURL=cycles.1.js.map
|
package/build/cycles.1.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cycles.1.js","sourceRoot":"","sources":["../src/cycles.1.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAmC,MAAM,6CAA6C,CAAC;AACrH,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,aAAa,EAAE,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGtE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAiB,EAAkB,EAAE,CAAC,CAAC;IAC7D,UAAU;QACT,OAAO;YACN;gBACC,SAAS,EAAE,CAAC,mBAAmB,CAAC;gBAChC,MAAM,EAAE,CAAC,KAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;aACjD;YACD;gBACC,SAAS,EAAE,CAAC,mBAAmB,EAAE,aAAa,CAAC;gBAC/C,MAAM,EAAE,CAAC,KAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;aACjD;SACD,CAAC;IACH,CAAC;IACD,6DAA6D;IAC7D,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAgB;QAC3C,IAAI,EAAE,CAAC,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