@haibun/web-playwright 3.0.3 → 3.1.0
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/build/PlaywrightEvents.d.ts +2 -1
- package/build/PlaywrightEvents.d.ts.map +1 -1
- package/build/PlaywrightEvents.js +11 -1
- package/build/PlaywrightEvents.js.map +1 -1
- package/build/cycles.d.ts.map +1 -1
- package/build/cycles.js +4 -10
- package/build/cycles.js.map +1 -1
- package/build/domains.d.ts.map +1 -1
- package/build/domains.js +6 -2
- package/build/domains.js.map +1 -1
- package/build/interactionSteps.d.ts +247 -2
- package/build/interactionSteps.d.ts.map +1 -1
- package/build/interactionSteps.js +41 -34
- package/build/interactionSteps.js.map +1 -1
- package/build/monitor/MonitorHandler.d.ts +1 -0
- package/build/monitor/MonitorHandler.d.ts.map +1 -1
- package/build/monitor/MonitorHandler.js +22 -5
- package/build/monitor/MonitorHandler.js.map +1 -1
- package/build/monitor/artifactDisplays/ResolvedFeaturesArtifactDisplay.d.ts.map +1 -1
- package/build/monitor/artifactDisplays/ResolvedFeaturesArtifactDisplay.js +117 -8
- package/build/monitor/artifactDisplays/ResolvedFeaturesArtifactDisplay.js.map +1 -1
- package/build/monitor/artifactDisplays/VideoArtifactDisplay.js +1 -1
- package/build/monitor/artifactDisplays/VideoArtifactDisplay.js.map +1 -1
- package/build/monitor/controls.d.ts.map +1 -1
- package/build/monitor/controls.js +247 -209
- package/build/monitor/controls.js.map +1 -1
- package/build/monitor/graph/generateMermaidGraph.d.ts +9 -2
- package/build/monitor/graph/generateMermaidGraph.d.ts.map +1 -1
- package/build/monitor/graph/generateMermaidGraph.js +249 -54
- package/build/monitor/graph/generateMermaidGraph.js.map +1 -1
- package/build/monitor/graph/graphUtils.d.ts.map +1 -1
- package/build/monitor/graph/graphUtils.js +21 -11
- package/build/monitor/graph/graphUtils.js.map +1 -1
- package/build/monitor/graph/mermaidGraphLinks.d.ts.map +1 -1
- package/build/monitor/graph/mermaidGraphLinks.js +0 -5
- package/build/monitor/graph/mermaidGraphLinks.js.map +1 -1
- package/build/monitor/messages.d.ts +1 -1
- package/build/monitor/messages.d.ts.map +1 -1
- package/build/monitor/messages.js +196 -27
- package/build/monitor/messages.js.map +1 -1
- package/build/monitor/monitor.d.ts +2 -1
- package/build/monitor/monitor.d.ts.map +1 -1
- package/build/monitor/monitor.js +532 -12
- package/build/monitor/monitor.js.map +1 -1
- package/build/rest-playwright.d.ts +62 -60
- package/build/rest-playwright.d.ts.map +1 -1
- package/build/rest-playwright.js +13 -9
- package/build/rest-playwright.js.map +1 -1
- package/build/web-playwright.d.ts +25 -125
- package/build/web-playwright.d.ts.map +1 -1
- package/build/web-playwright.js +34 -6
- package/build/web-playwright.js.map +1 -1
- package/package.json +8 -5
- package/web/monitor.html +0 -3244
|
@@ -7,112 +7,114 @@ export declare const base64Encode: ({ username, password }: {
|
|
|
7
7
|
password: string;
|
|
8
8
|
}) => string;
|
|
9
9
|
export declare const restSteps: (webPlaywright: WebPlaywright) => {
|
|
10
|
-
setApiUserAgent: {
|
|
11
|
-
gwta:
|
|
12
|
-
action: ({ agent }: {
|
|
10
|
+
readonly setApiUserAgent: {
|
|
11
|
+
readonly gwta: "API user agent is {agent}";
|
|
12
|
+
readonly action: ({ agent }: {
|
|
13
13
|
agent: string;
|
|
14
14
|
}) => import("@haibun/core/lib/defs.js").TOKActionResult;
|
|
15
15
|
};
|
|
16
|
-
addBasicAuthCredentials: {
|
|
17
|
-
gwta:
|
|
18
|
-
action: ({ username, password }: {
|
|
16
|
+
readonly addBasicAuthCredentials: {
|
|
17
|
+
readonly gwta: "use Authorization Basic header with {username}, {password}";
|
|
18
|
+
readonly action: ({ username, password }: {
|
|
19
19
|
username: string;
|
|
20
20
|
password: string;
|
|
21
21
|
}) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
22
22
|
};
|
|
23
|
-
addAuthBearerToken: {
|
|
24
|
-
gwta:
|
|
25
|
-
action: ({ token }: {
|
|
23
|
+
readonly addAuthBearerToken: {
|
|
24
|
+
readonly gwta: "use Authorization Bearer header with {token}";
|
|
25
|
+
readonly action: ({ token }: {
|
|
26
26
|
token: string;
|
|
27
27
|
}) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
28
28
|
};
|
|
29
|
-
restTokenRequest: {
|
|
30
|
-
gwta:
|
|
31
|
-
action: ({ endpoint }: {
|
|
29
|
+
readonly restTokenRequest: {
|
|
30
|
+
readonly gwta: "request OAuth 2.0 access token from {endpoint}";
|
|
31
|
+
readonly action: ({ endpoint }: {
|
|
32
32
|
endpoint: string;
|
|
33
|
-
}, featureStep:
|
|
33
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
34
34
|
};
|
|
35
|
-
restTokenLogout: {
|
|
36
|
-
gwta:
|
|
37
|
-
action: ({ endpoint }: {
|
|
35
|
+
readonly restTokenLogout: {
|
|
36
|
+
readonly gwta: "perform OAuth 2.0 logout from {endpoint}";
|
|
37
|
+
readonly action: ({ endpoint }: {
|
|
38
38
|
endpoint: string;
|
|
39
|
-
}, featureStep:
|
|
39
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
40
40
|
};
|
|
41
|
-
acceptEndpointRequest: {
|
|
42
|
-
gwta:
|
|
43
|
-
|
|
41
|
+
readonly acceptEndpointRequest: {
|
|
42
|
+
readonly gwta: "accept {accept} using HTTP {method} to {endpoint}";
|
|
43
|
+
readonly handlesUndefined: ["method"];
|
|
44
|
+
readonly action: ({ accept, endpoint }: {
|
|
44
45
|
accept: string;
|
|
45
46
|
method: string;
|
|
46
47
|
endpoint: string;
|
|
47
|
-
}, featureStep:
|
|
48
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
48
49
|
};
|
|
49
|
-
restEndpointRequest: {
|
|
50
|
-
gwta:
|
|
51
|
-
|
|
50
|
+
readonly restEndpointRequest: {
|
|
51
|
+
readonly gwta: "make an HTTP {method} to {endpoint}";
|
|
52
|
+
readonly handlesUndefined: ["method"];
|
|
53
|
+
readonly action: ({ endpoint }: {
|
|
52
54
|
method: string;
|
|
53
55
|
endpoint: string;
|
|
54
|
-
}, featureStep:
|
|
56
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
55
57
|
};
|
|
56
|
-
filterResponseJson: {
|
|
57
|
-
gwta:
|
|
58
|
-
action: ({ property, match }: {
|
|
58
|
+
readonly filterResponseJson: {
|
|
59
|
+
readonly gwta: "filter JSON response by {property} matching {match}";
|
|
60
|
+
readonly action: ({ property, match }: {
|
|
59
61
|
property: string;
|
|
60
62
|
match: string;
|
|
61
|
-
}, featureStep:
|
|
63
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
62
64
|
};
|
|
63
|
-
filteredResponseLengthIs: {
|
|
64
|
-
gwta:
|
|
65
|
-
action: ({ length }: {
|
|
65
|
+
readonly filteredResponseLengthIs: {
|
|
66
|
+
readonly gwta: "filtered response length is {length}";
|
|
67
|
+
readonly action: ({ length }: {
|
|
66
68
|
length: string;
|
|
67
69
|
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
68
70
|
};
|
|
69
|
-
showResponseLength: {
|
|
70
|
-
gwta:
|
|
71
|
-
action: () => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
71
|
+
readonly showResponseLength: {
|
|
72
|
+
readonly gwta: "show JSON response count";
|
|
73
|
+
readonly action: () => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
72
74
|
};
|
|
73
|
-
showFilteredLength: {
|
|
74
|
-
gwta:
|
|
75
|
-
action: () => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
75
|
+
readonly showFilteredLength: {
|
|
76
|
+
readonly gwta: "show filtered response count";
|
|
77
|
+
readonly action: () => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
76
78
|
};
|
|
77
|
-
responseJsonLengthIs: {
|
|
78
|
-
gwta:
|
|
79
|
-
action: ({ length }: {
|
|
79
|
+
readonly responseJsonLengthIs: {
|
|
80
|
+
readonly gwta: "JSON response length is {length}";
|
|
81
|
+
readonly action: ({ length }: {
|
|
80
82
|
length: string;
|
|
81
83
|
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
82
84
|
};
|
|
83
|
-
restEndpointFilteredPropertyRequest: {
|
|
84
|
-
gwta:
|
|
85
|
-
|
|
85
|
+
readonly restEndpointFilteredPropertyRequest: {
|
|
86
|
+
readonly gwta: "for each filtered {property}, make REST {method} to {endpoint} yielding status {status}";
|
|
87
|
+
readonly handlesUndefined: ["method"];
|
|
88
|
+
readonly action: ({ property, endpoint, status }: {
|
|
86
89
|
property: string;
|
|
87
|
-
method: string;
|
|
88
90
|
endpoint: string;
|
|
89
91
|
status: string;
|
|
90
|
-
}) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
92
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
91
93
|
};
|
|
92
|
-
restEndpointRequestWithPayload: {
|
|
93
|
-
gwta:
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
readonly restEndpointRequestWithPayload: {
|
|
95
|
+
readonly gwta: "make an HTTP {method} to {endpoint} with {payload}";
|
|
96
|
+
readonly handlesUndefined: ["method"];
|
|
97
|
+
readonly action: ({ endpoint, payload }: {
|
|
96
98
|
endpoint: string;
|
|
97
99
|
payload: string;
|
|
98
|
-
}, featureStep:
|
|
100
|
+
}, featureStep: import("@haibun/core/lib/defs.js").TFeatureStep) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
99
101
|
};
|
|
100
|
-
restLastStatusIs: {
|
|
101
|
-
gwta:
|
|
102
|
-
action: ({ status }: {
|
|
102
|
+
readonly restLastStatusIs: {
|
|
103
|
+
readonly gwta: "HTTP status is {status}";
|
|
104
|
+
readonly action: ({ status }: {
|
|
103
105
|
status: string;
|
|
104
106
|
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
105
107
|
};
|
|
106
|
-
restResponsePropertyIs: {
|
|
107
|
-
gwta:
|
|
108
|
-
action: ({ property, value }: {
|
|
108
|
+
readonly restResponsePropertyIs: {
|
|
109
|
+
readonly gwta: "HTTP response property {property} is {value}";
|
|
110
|
+
readonly action: ({ property, value }: {
|
|
109
111
|
property: string;
|
|
110
112
|
value: string;
|
|
111
113
|
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
112
114
|
};
|
|
113
|
-
restResponseIs: {
|
|
114
|
-
gwta:
|
|
115
|
-
action: ({ value }: {
|
|
115
|
+
readonly restResponseIs: {
|
|
116
|
+
readonly gwta: "HTTP text response is {value}";
|
|
117
|
+
readonly action: ({ value }: {
|
|
116
118
|
value: string;
|
|
117
119
|
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
118
120
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-playwright.d.ts","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"rest-playwright.d.ts","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAI3C,eAAO,MAAM,YAAY,GAAI,wBAAwB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,WACjC,CAAC;AAE3D,eAAO,MAAM,SAAS,GAAI,eAAe,aAAa;;;qCAGhC;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE;;;;kDAOE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE;;;;qCAOnD;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE;;;;wCAOd;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE;;;;wCAUpB;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE;;;;;gDAWZ;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE;;;;;wCAa5D;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE;;;;+CAYnC;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;;;;sCAY5C;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;sCAoClB;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;0DAWQ;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;iDA0B/D;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;;;;sCAatD;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;+CAUT;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;;;;qCAU7C;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE;;CAQJ,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB,CAAC"}
|
package/build/rest-playwright.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { actionNotOK, actionOK } from '@haibun/core/lib/util/index.js';
|
|
1
|
+
import { actionNotOK, actionOK, getStepTerm } from '@haibun/core/lib/util/index.js';
|
|
2
2
|
import { OK } from '@haibun/core/lib/defs.js';
|
|
3
3
|
import { EExecutionMessageType } from '@haibun/core/lib/interfaces/logger.js';
|
|
4
4
|
const PAYLOAD_METHODS = ['post', 'put', 'patch'];
|
|
@@ -50,8 +50,9 @@ export const restSteps = (webPlaywright) => ({
|
|
|
50
50
|
},
|
|
51
51
|
acceptEndpointRequest: {
|
|
52
52
|
gwta: `accept {accept} using ${HTTP} {method} to {endpoint}`,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
handlesUndefined: ['method'],
|
|
54
|
+
action: async ({ accept, endpoint }, featureStep) => {
|
|
55
|
+
const method = getStepTerm(featureStep, 'method').toLowerCase();
|
|
55
56
|
if (!NO_PAYLOAD_METHODS.includes(method)) {
|
|
56
57
|
return actionNotOK(`Method ${method} not supported`);
|
|
57
58
|
}
|
|
@@ -62,8 +63,9 @@ export const restSteps = (webPlaywright) => ({
|
|
|
62
63
|
},
|
|
63
64
|
restEndpointRequest: {
|
|
64
65
|
gwta: `make an ${HTTP} {method} to {endpoint}`,
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
handlesUndefined: ['method'],
|
|
67
|
+
action: async ({ endpoint }, featureStep) => {
|
|
68
|
+
const method = getStepTerm(featureStep, 'method').toLowerCase();
|
|
67
69
|
if (!NO_PAYLOAD_METHODS.includes(method)) {
|
|
68
70
|
return actionNotOK(`Method ${method} not supported`);
|
|
69
71
|
}
|
|
@@ -132,8 +134,9 @@ export const restSteps = (webPlaywright) => ({
|
|
|
132
134
|
},
|
|
133
135
|
restEndpointFilteredPropertyRequest: {
|
|
134
136
|
gwta: `for each filtered {property}, make REST {method} to {endpoint} yielding status {status}`,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
handlesUndefined: ['method'],
|
|
138
|
+
action: async ({ property, endpoint, status }, featureStep) => {
|
|
139
|
+
const method = getStepTerm(featureStep, 'method').toLowerCase();
|
|
137
140
|
if (!NO_PAYLOAD_METHODS.includes(method)) {
|
|
138
141
|
return actionNotOK(`Method ${method} not supported`);
|
|
139
142
|
}
|
|
@@ -157,8 +160,9 @@ export const restSteps = (webPlaywright) => ({
|
|
|
157
160
|
},
|
|
158
161
|
restEndpointRequestWithPayload: {
|
|
159
162
|
gwta: `make an ${'HTTP'} {method} to {endpoint} with {payload}`,
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
handlesUndefined: ['method'],
|
|
164
|
+
action: async ({ endpoint, payload }, featureStep) => {
|
|
165
|
+
const method = getStepTerm(featureStep, 'method').toLowerCase();
|
|
162
166
|
if (!PAYLOAD_METHODS.includes(method)) {
|
|
163
167
|
return actionNotOK(`Method ${method} (${method}) does not support payload`);
|
|
164
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-playwright.js","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"rest-playwright.js","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAEpF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAmB,MAAM,uCAAuC,CAAC;AAI/F,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACjD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAE3C,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAA0C,EAAE,EAAE,CAC9F,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC;IAC3D,eAAe,EAAE;QAChB,IAAI,EAAE,2BAA2B;QACjC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAqB,EAAE,EAAE;YACxC,aAAa,CAAC,YAAY,GAAG,KAAK,CAAC;YACnC,OAAO,EAAE,CAAC;QACX,CAAC;KACD;IACD,uBAAuB,EAAE;QACxB,IAAI,EAAE,4DAA4D;QAClE,MAAM,EAAE,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,EAAE,CAAC;gBACjD,OAAO,EAAE,CAAC;YACX,CAAC;YACD,OAAO,WAAW,CAAC,2BAA2B,KAAK,SAAS,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QACnF,CAAC;KACD;CACiC,CAAA,CAAC"}
|
|
@@ -6,8 +6,11 @@ import { EExecutionMessageType, TMessageContext } from '@haibun/core/lib/interfa
|
|
|
6
6
|
import { MonitorHandler } from './monitor/MonitorHandler.js';
|
|
7
7
|
import { TAnyFixme } from '@haibun/core/lib/fixme.js';
|
|
8
8
|
import { AStepper, IHasCycles, IHasOptions } from '@haibun/core/lib/astepper.js';
|
|
9
|
-
import {
|
|
9
|
+
import { interactionSteps } from './interactionSteps.js';
|
|
10
|
+
import { restSteps, TCapturedResponse } from './rest-playwright.js';
|
|
10
11
|
import { TwinPage } from './twin-page.js';
|
|
12
|
+
type TWebPlaywrightSteps = ReturnType<typeof interactionSteps> & ReturnType<typeof restSteps>;
|
|
13
|
+
type TWebPlaywrightTypedSteps = ReturnType<typeof interactionSteps> & ReturnType<typeof restSteps>;
|
|
11
14
|
export declare const WEB_PAGE = "webpage";
|
|
12
15
|
/**
|
|
13
16
|
* This is the infrastructure for web-playwright.
|
|
@@ -16,6 +19,7 @@ export declare const WEB_PAGE = "webpage";
|
|
|
16
19
|
* @see {@link restSteps} for rest steps
|
|
17
20
|
*/
|
|
18
21
|
export declare const LAST_REST_RESPONSE = "LAST_REST_RESPONSE";
|
|
22
|
+
export declare const VISITED_PAGES = "Visited pages";
|
|
19
23
|
export declare enum EMonitoringTypes {
|
|
20
24
|
MONITOR_ALL = "all",
|
|
21
25
|
MONITOR_EACH = "each"
|
|
@@ -27,7 +31,10 @@ type TRequestOptions = {
|
|
|
27
31
|
};
|
|
28
32
|
export declare class WebPlaywright extends AStepper implements IHasOptions, IHasCycles {
|
|
29
33
|
cycles: import("@haibun/core/lib/defs.js").IStepperCycles;
|
|
30
|
-
|
|
34
|
+
cyclesWhen: {
|
|
35
|
+
startExecution: number;
|
|
36
|
+
startFeature: number;
|
|
37
|
+
};
|
|
31
38
|
static PERSISTENT_DIRECTORY: string;
|
|
32
39
|
options: {
|
|
33
40
|
[WebPlaywright.PERSISTENT_DIRECTORY]: {
|
|
@@ -40,17 +47,6 @@ export declare class WebPlaywright extends AStepper implements IHasOptions, IHas
|
|
|
40
47
|
parseError?: undefined;
|
|
41
48
|
};
|
|
42
49
|
};
|
|
43
|
-
[WebPlaywright.STORAGE]: {
|
|
44
|
-
desc: string;
|
|
45
|
-
parse: (input: string) => {
|
|
46
|
-
parseError: string;
|
|
47
|
-
result?: undefined;
|
|
48
|
-
} | {
|
|
49
|
-
result: string;
|
|
50
|
-
parseError?: undefined;
|
|
51
|
-
};
|
|
52
|
-
required: boolean;
|
|
53
|
-
};
|
|
54
50
|
TWIN: {
|
|
55
51
|
desc: string;
|
|
56
52
|
parse: (input: string) => {
|
|
@@ -110,7 +106,7 @@ export declare class WebPlaywright extends AStepper implements IHasOptions, IHas
|
|
|
110
106
|
result: boolean;
|
|
111
107
|
parseError?: undefined;
|
|
112
108
|
};
|
|
113
|
-
dependsOn:
|
|
109
|
+
dependsOn: "STORAGE"[];
|
|
114
110
|
};
|
|
115
111
|
TIMEOUT: {
|
|
116
112
|
desc: string;
|
|
@@ -122,6 +118,17 @@ export declare class WebPlaywright extends AStepper implements IHasOptions, IHas
|
|
|
122
118
|
parseError?: undefined;
|
|
123
119
|
};
|
|
124
120
|
};
|
|
121
|
+
STORAGE: {
|
|
122
|
+
desc: string;
|
|
123
|
+
parse: (input: string) => {
|
|
124
|
+
parseError: string;
|
|
125
|
+
result?: undefined;
|
|
126
|
+
} | {
|
|
127
|
+
result: string;
|
|
128
|
+
parseError?: undefined;
|
|
129
|
+
};
|
|
130
|
+
required: boolean;
|
|
131
|
+
};
|
|
125
132
|
};
|
|
126
133
|
hasFactory: boolean;
|
|
127
134
|
bf?: BrowserFactory;
|
|
@@ -142,6 +149,7 @@ export declare class WebPlaywright extends AStepper implements IHasOptions, IHas
|
|
|
142
149
|
expectedDownload: Promise<Download>;
|
|
143
150
|
headless: boolean;
|
|
144
151
|
inContainer: Locator;
|
|
152
|
+
steppers: AStepper[];
|
|
145
153
|
setWorld(world: TWorld, steppers: AStepper[]): Promise<void>;
|
|
146
154
|
getCaptureDir(type?: string): Promise<string>;
|
|
147
155
|
getBrowserFactory(): Promise<BrowserFactory>;
|
|
@@ -150,117 +158,8 @@ export declare class WebPlaywright extends AStepper implements IHasOptions, IHas
|
|
|
150
158
|
withPage<TReturn>(f: TAnyFixme): Promise<TReturn>;
|
|
151
159
|
sees(text: string, selector: string): Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
152
160
|
getCookies(): Promise<import("playwright").Cookie[]>;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
gwta: string;
|
|
156
|
-
action: ({ agent }: {
|
|
157
|
-
agent: string;
|
|
158
|
-
}) => import("@haibun/core/lib/defs.js").TOKActionResult;
|
|
159
|
-
};
|
|
160
|
-
addBasicAuthCredentials: {
|
|
161
|
-
gwta: string;
|
|
162
|
-
action: ({ username, password }: {
|
|
163
|
-
username: string;
|
|
164
|
-
password: string;
|
|
165
|
-
}) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
166
|
-
};
|
|
167
|
-
addAuthBearerToken: {
|
|
168
|
-
gwta: string;
|
|
169
|
-
action: ({ token }: {
|
|
170
|
-
token: string;
|
|
171
|
-
}) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
172
|
-
};
|
|
173
|
-
restTokenRequest: {
|
|
174
|
-
gwta: string;
|
|
175
|
-
action: ({ endpoint }: {
|
|
176
|
-
endpoint: string;
|
|
177
|
-
}, featureStep: any) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
178
|
-
};
|
|
179
|
-
restTokenLogout: {
|
|
180
|
-
gwta: string;
|
|
181
|
-
action: ({ endpoint }: {
|
|
182
|
-
endpoint: string;
|
|
183
|
-
}, featureStep: any) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
184
|
-
};
|
|
185
|
-
acceptEndpointRequest: {
|
|
186
|
-
gwta: string;
|
|
187
|
-
action: ({ accept, method, endpoint }: {
|
|
188
|
-
accept: string;
|
|
189
|
-
method: string;
|
|
190
|
-
endpoint: string;
|
|
191
|
-
}, featureStep: any) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
192
|
-
};
|
|
193
|
-
restEndpointRequest: {
|
|
194
|
-
gwta: string;
|
|
195
|
-
action: ({ method, endpoint }: {
|
|
196
|
-
method: string;
|
|
197
|
-
endpoint: string;
|
|
198
|
-
}, featureStep: any) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
199
|
-
};
|
|
200
|
-
filterResponseJson: {
|
|
201
|
-
gwta: string;
|
|
202
|
-
action: ({ property, match }: {
|
|
203
|
-
property: string;
|
|
204
|
-
match: string;
|
|
205
|
-
}, featureStep: any) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
206
|
-
};
|
|
207
|
-
filteredResponseLengthIs: {
|
|
208
|
-
gwta: string;
|
|
209
|
-
action: ({ length }: {
|
|
210
|
-
length: string;
|
|
211
|
-
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
212
|
-
};
|
|
213
|
-
showResponseLength: {
|
|
214
|
-
gwta: string;
|
|
215
|
-
action: () => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
216
|
-
};
|
|
217
|
-
showFilteredLength: {
|
|
218
|
-
gwta: string;
|
|
219
|
-
action: () => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
220
|
-
};
|
|
221
|
-
responseJsonLengthIs: {
|
|
222
|
-
gwta: string;
|
|
223
|
-
action: ({ length }: {
|
|
224
|
-
length: string;
|
|
225
|
-
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
226
|
-
};
|
|
227
|
-
restEndpointFilteredPropertyRequest: {
|
|
228
|
-
gwta: string;
|
|
229
|
-
action: ({ property, method, endpoint, status }: {
|
|
230
|
-
property: string;
|
|
231
|
-
method: string;
|
|
232
|
-
endpoint: string;
|
|
233
|
-
status: string;
|
|
234
|
-
}) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
235
|
-
};
|
|
236
|
-
restEndpointRequestWithPayload: {
|
|
237
|
-
gwta: string;
|
|
238
|
-
action: ({ method, endpoint, payload }: {
|
|
239
|
-
method: string;
|
|
240
|
-
endpoint: string;
|
|
241
|
-
payload: string;
|
|
242
|
-
}, featureStep: any) => Promise<import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult>;
|
|
243
|
-
};
|
|
244
|
-
restLastStatusIs: {
|
|
245
|
-
gwta: string;
|
|
246
|
-
action: ({ status }: {
|
|
247
|
-
status: string;
|
|
248
|
-
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
249
|
-
};
|
|
250
|
-
restResponsePropertyIs: {
|
|
251
|
-
gwta: string;
|
|
252
|
-
action: ({ property, value }: {
|
|
253
|
-
property: string;
|
|
254
|
-
value: string;
|
|
255
|
-
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
256
|
-
};
|
|
257
|
-
restResponseIs: {
|
|
258
|
-
gwta: string;
|
|
259
|
-
action: ({ value }: {
|
|
260
|
-
value: string;
|
|
261
|
-
}) => import("@haibun/core/lib/defs.js").TOKActionResult | import("@haibun/core/lib/defs.js").TNotOKActionResult;
|
|
262
|
-
};
|
|
263
|
-
};
|
|
161
|
+
get typedSteps(): TWebPlaywrightTypedSteps;
|
|
162
|
+
steps: TWebPlaywrightSteps;
|
|
264
163
|
setBrowser(browser: string): import("@haibun/core/lib/defs.js").TOKActionResult;
|
|
265
164
|
newTab(): void;
|
|
266
165
|
captureFailureScreenshot(event: EExecutionMessageType, step: TStepResult): Promise<void>;
|
|
@@ -285,6 +184,7 @@ export declare class WebPlaywright extends AStepper implements IHasOptions, IHas
|
|
|
285
184
|
createMonitor(): Promise<import("@haibun/core/lib/defs.js").TOKActionResult>;
|
|
286
185
|
getLastResponse(): TCapturedResponse;
|
|
287
186
|
setLastResponse(serialized: TCapturedResponse, featureStep: TFeatureStep): void;
|
|
187
|
+
locateByDomain(page: Page, featureStep: TFeatureStep, where: string): Locator;
|
|
288
188
|
}
|
|
289
189
|
export default WebPlaywright;
|
|
290
190
|
//# sourceMappingURL=web-playwright.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-playwright.d.ts","sourceRoot":"","sources":["../src/web-playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"web-playwright.d.ts","sourceRoot":"","sources":["../src/web-playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrD,OAAO,EAAE,MAAM,EAAM,WAAW,EAAE,YAAY,EAAwC,MAAM,0BAA0B,CAAC;AACvH,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAA2B,MAAM,qBAAqB,CAAC;AAE5G,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAkB,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAG/G,OAAO,EAAE,cAAc,EAAE,MAAM,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B;IACF,UAAU,CAAC,OAAO,EAAE,MAAM;IAI1B,MAAM;IAGA,wBAAwB,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,WAAW;IAQxE,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAA;KAAE;IAKnG,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAA;KAAE;;;;IAe7F,4BAA4B;IAS5B,mBAAmB,CAAC,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE;IAQxD,aAAa,CAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAQ,EACd,cAAc,GAAE,eAAoB,GAClC,OAAO,CAAC,iBAAiB,CAAC;IAmDvB,WAAW;IAQX,UAAU;IAIV,aAAa;IAOnB,eAAe,IAAI,iBAAiB;IAGpC,eAAe,CAAC,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY;IAGxE,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM;CAKnE;AAED,eAAe,aAAa,CAAC"}
|
package/build/web-playwright.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
2
|
import { pathToFileURL } from 'url';
|
|
3
|
-
import {
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { OK, Origin, CycleWhen } from '@haibun/core/lib/defs.js';
|
|
4
5
|
import { BrowserFactory, BROWSERS } from './BrowserFactory.js';
|
|
5
6
|
import { actionNotOK, getStepperOption, boolOrError, intOrError, stringOrError, findStepperFromOption, optionOrError } from '@haibun/core/lib/util/index.js';
|
|
6
7
|
import { EExecutionMessageType } from '@haibun/core/lib/interfaces/logger.js';
|
|
7
8
|
import { EMediaTypes } from '@haibun/domain-storage/media-types.js';
|
|
8
9
|
import { MonitorHandler } from './monitor/MonitorHandler.js';
|
|
9
|
-
import { AStepper } from '@haibun/core/lib/astepper.js';
|
|
10
|
+
import { AStepper, StepperKinds } from '@haibun/core/lib/astepper.js';
|
|
10
11
|
import { cycles } from './cycles.js';
|
|
11
12
|
import { interactionSteps } from './interactionSteps.js';
|
|
12
13
|
import { restSteps } from './rest-playwright.js';
|
|
13
14
|
import { TwinPage } from './twin-page.js';
|
|
15
|
+
import { DOMAIN_STRING, registerDomains } from '@haibun/core/lib/domain-types.js';
|
|
14
16
|
export const WEB_PAGE = 'webpage';
|
|
15
17
|
/**
|
|
16
18
|
* This is the infrastructure for web-playwright.
|
|
@@ -19,6 +21,7 @@ export const WEB_PAGE = 'webpage';
|
|
|
19
21
|
* @see {@link restSteps} for rest steps
|
|
20
22
|
*/
|
|
21
23
|
export const LAST_REST_RESPONSE = 'LAST_REST_RESPONSE';
|
|
24
|
+
export const VISITED_PAGES = 'Visited pages';
|
|
22
25
|
export var EMonitoringTypes;
|
|
23
26
|
(function (EMonitoringTypes) {
|
|
24
27
|
EMonitoringTypes["MONITOR_ALL"] = "all";
|
|
@@ -26,7 +29,10 @@ export var EMonitoringTypes;
|
|
|
26
29
|
})(EMonitoringTypes || (EMonitoringTypes = {}));
|
|
27
30
|
export class WebPlaywright extends AStepper {
|
|
28
31
|
cycles = cycles(this);
|
|
29
|
-
|
|
32
|
+
cyclesWhen = {
|
|
33
|
+
startExecution: CycleWhen.FIRST - 1,
|
|
34
|
+
startFeature: CycleWhen.FIRST - 1,
|
|
35
|
+
};
|
|
30
36
|
static PERSISTENT_DIRECTORY = 'PERSISTENT_DIRECTORY';
|
|
31
37
|
options = {
|
|
32
38
|
TWIN: {
|
|
@@ -56,13 +62,13 @@ export class WebPlaywright extends AStepper {
|
|
|
56
62
|
CAPTURE_VIDEO: {
|
|
57
63
|
desc: 'capture video for every agent',
|
|
58
64
|
parse: (input) => boolOrError(input),
|
|
59
|
-
dependsOn: [
|
|
65
|
+
dependsOn: [StepperKinds.STORAGE],
|
|
60
66
|
},
|
|
61
67
|
TIMEOUT: {
|
|
62
68
|
desc: 'browser timeout for each step',
|
|
63
69
|
parse: (input) => intOrError(input),
|
|
64
70
|
},
|
|
65
|
-
[
|
|
71
|
+
[StepperKinds.STORAGE]: {
|
|
66
72
|
desc: 'Storage for output',
|
|
67
73
|
parse: (input) => stringOrError(input),
|
|
68
74
|
required: true
|
|
@@ -85,10 +91,12 @@ export class WebPlaywright extends AStepper {
|
|
|
85
91
|
expectedDownload;
|
|
86
92
|
headless;
|
|
87
93
|
inContainer;
|
|
94
|
+
steppers;
|
|
88
95
|
async setWorld(world, steppers) {
|
|
96
|
+
this.steppers = steppers;
|
|
89
97
|
await super.setWorld(world, steppers);
|
|
90
98
|
const args = [...(getStepperOption(this, 'ARGS', world.moduleOptions)?.split(';') || ''),]; //'--disable-gpu'
|
|
91
|
-
this.storage = findStepperFromOption(steppers, this, world.moduleOptions,
|
|
99
|
+
this.storage = findStepperFromOption(steppers, this, world.moduleOptions, StepperKinds.STORAGE);
|
|
92
100
|
this.headless = getStepperOption(this, 'HEADLESS', world.moduleOptions) === 'true' || !!process.env.CI;
|
|
93
101
|
const devtools = getStepperOption(this, 'DEVTOOLS', world.moduleOptions) === 'true';
|
|
94
102
|
if (devtools) {
|
|
@@ -117,6 +125,18 @@ export class WebPlaywright extends AStepper {
|
|
|
117
125
|
defaultTimeout,
|
|
118
126
|
persistentDirectory,
|
|
119
127
|
};
|
|
128
|
+
// Register visited-pages domain for tracking navigated URLs
|
|
129
|
+
// This is an open domain (inherits from string) - visited URLs are added as members
|
|
130
|
+
// Only register if not already registered (other tests may share the world)
|
|
131
|
+
if (!world.domains[VISITED_PAGES]) {
|
|
132
|
+
const visitedPagesDef = {
|
|
133
|
+
selectors: [VISITED_PAGES],
|
|
134
|
+
schema: z.string(),
|
|
135
|
+
coerce: (proto) => String(proto.value),
|
|
136
|
+
description: 'Pages visited during test execution (auto-tracked by WebPlaywright)',
|
|
137
|
+
};
|
|
138
|
+
registerDomains(world, [[visitedPagesDef]]);
|
|
139
|
+
}
|
|
120
140
|
}
|
|
121
141
|
async getCaptureDir(type = '') {
|
|
122
142
|
const loc = { ...this.world, mediaType: EMediaTypes.video };
|
|
@@ -169,6 +189,9 @@ export class WebPlaywright extends AStepper {
|
|
|
169
189
|
const browserContext = await this.getExistingBrowserContext();
|
|
170
190
|
return await browserContext?.cookies();
|
|
171
191
|
}
|
|
192
|
+
get typedSteps() {
|
|
193
|
+
return { ...restSteps(this), ...interactionSteps(this) };
|
|
194
|
+
}
|
|
172
195
|
steps = {
|
|
173
196
|
...restSteps(this),
|
|
174
197
|
...interactionSteps(this),
|
|
@@ -297,6 +320,11 @@ export class WebPlaywright extends AStepper {
|
|
|
297
320
|
setLastResponse(serialized, featureStep) {
|
|
298
321
|
this.getWorld().shared.setJSON(LAST_REST_RESPONSE, serialized, Origin.var, featureStep);
|
|
299
322
|
}
|
|
323
|
+
locateByDomain(page, featureStep, where) {
|
|
324
|
+
const { value, domain } = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap[where], featureStep);
|
|
325
|
+
const located = domain === DOMAIN_STRING ? page.getByText(value, { exact: true }) : page.locator(value);
|
|
326
|
+
return located;
|
|
327
|
+
}
|
|
300
328
|
}
|
|
301
329
|
export default WebPlaywright;
|
|
302
330
|
//# sourceMappingURL=web-playwright.js.map
|