@haibun/web-playwright 1.32.2 → 1.32.3
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 +3 -3
- package/build/BrowserFactory.d.ts +0 -75
- package/build/BrowserFactory.js +0 -108
- package/build/BrowserFactory.js.map +0 -1
- package/build/BrowserFactory.test.d.ts +0 -1
- package/build/BrowserFactory.test.js +0 -66
- package/build/BrowserFactory.test.js.map +0 -1
- package/build/PlaywrightEvents.d.ts +0 -13
- package/build/PlaywrightEvents.js +0 -80
- package/build/PlaywrightEvents.js.map +0 -1
- package/build/web-playwright.d.ts +0 -330
- package/build/web-playwright.js +0 -598
- package/build/web-playwright.js.map +0 -1
- package/build/web-playwright.test.d.ts +0 -1
- package/build/web-playwright.test.js +0 -27
- package/build/web-playwright.test.js.map +0 -1
package/build/web-playwright.js
DELETED
|
@@ -1,598 +0,0 @@
|
|
|
1
|
-
import { OK, AStepper } from '@haibun/core/build/lib/defs.js';
|
|
2
|
-
import { onCurrentTypeForDomain } from '@haibun/core/build/steps/vars.js';
|
|
3
|
-
import { BrowserFactory } from './BrowserFactory.js';
|
|
4
|
-
import { actionNotOK, getStepperOption, boolOrError, intOrError, stringOrError, findStepperFromOption, sleep } from '@haibun/core/build/lib/util/index.js';
|
|
5
|
-
import { WEB_PAGE, WEB_CONTROL } from '@haibun/domain-webpage';
|
|
6
|
-
const WebPlaywright = class WebPlaywright extends AStepper {
|
|
7
|
-
static STORAGE = 'STORAGE';
|
|
8
|
-
static PERSISTENT_DIRECTORY = 'PERSISTENT_DIRECTORY';
|
|
9
|
-
requireDomains = [WEB_PAGE, WEB_CONTROL];
|
|
10
|
-
options = {
|
|
11
|
-
HEADLESS: {
|
|
12
|
-
desc: 'run browsers without a window (true, false)',
|
|
13
|
-
parse: (input) => boolOrError(input),
|
|
14
|
-
},
|
|
15
|
-
DEVTOOLS: {
|
|
16
|
-
desc: `show browser devtools (true or false)`,
|
|
17
|
-
parse: (input) => boolOrError(input),
|
|
18
|
-
},
|
|
19
|
-
[WebPlaywright.PERSISTENT_DIRECTORY]: {
|
|
20
|
-
desc: 'run browsers with a persistent directory (true or false)',
|
|
21
|
-
parse: (input) => boolOrError(input),
|
|
22
|
-
},
|
|
23
|
-
ARGS: {
|
|
24
|
-
desc: 'pass arguments',
|
|
25
|
-
parse: (input) => stringOrError(input),
|
|
26
|
-
},
|
|
27
|
-
CAPTURE_VIDEO: {
|
|
28
|
-
desc: 'capture video for every agent',
|
|
29
|
-
parse: (input) => boolOrError(input),
|
|
30
|
-
dependsOn: ['STORAGE'],
|
|
31
|
-
},
|
|
32
|
-
STEP_CAPTURE_SCREENSHOT: {
|
|
33
|
-
desc: 'capture screenshot for every step',
|
|
34
|
-
parse: (input) => boolOrError(input),
|
|
35
|
-
},
|
|
36
|
-
TIMEOUT: {
|
|
37
|
-
desc: 'timeout for each step',
|
|
38
|
-
parse: (input) => intOrError(input),
|
|
39
|
-
},
|
|
40
|
-
[WebPlaywright.STORAGE]: {
|
|
41
|
-
desc: 'Storage for output',
|
|
42
|
-
parse: (input) => stringOrError(input),
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
hasFactory = false;
|
|
46
|
-
bf;
|
|
47
|
-
storage;
|
|
48
|
-
factoryOptions;
|
|
49
|
-
tab = 0;
|
|
50
|
-
withFrame;
|
|
51
|
-
downloaded = [];
|
|
52
|
-
captureVideo;
|
|
53
|
-
async setWorld(world, steppers) {
|
|
54
|
-
await super.setWorld(world, steppers);
|
|
55
|
-
this.storage = findStepperFromOption(steppers, this, world.extraOptions, WebPlaywright.STORAGE);
|
|
56
|
-
const headless = getStepperOption(this, 'HEADLESS', world.extraOptions) === 'true' || !!process.env.CI;
|
|
57
|
-
const devtools = getStepperOption(this, 'DEVTOOLS', world.extraOptions) === 'true';
|
|
58
|
-
const args = [...(getStepperOption(this, 'ARGS', world.extraOptions)?.split(';') || ''), '--disable-gpu'];
|
|
59
|
-
const persistentDirectory = getStepperOption(this, WebPlaywright.PERSISTENT_DIRECTORY, world.extraOptions) === 'true';
|
|
60
|
-
const defaultTimeout = parseInt(getStepperOption(this, 'TIMEOUT', world.extraOptions)) || 30000;
|
|
61
|
-
this.captureVideo = getStepperOption(this, 'CAPTURE_VIDEO', world.extraOptions);
|
|
62
|
-
let recordVideo;
|
|
63
|
-
if (this.captureVideo) {
|
|
64
|
-
recordVideo = {
|
|
65
|
-
dir: await this.getCaptureDir('video')
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
this.factoryOptions = {
|
|
69
|
-
browser: {
|
|
70
|
-
headless,
|
|
71
|
-
args,
|
|
72
|
-
devtools,
|
|
73
|
-
},
|
|
74
|
-
recordVideo,
|
|
75
|
-
defaultTimeout,
|
|
76
|
-
persistentDirectory,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
async getCaptureDir(type) {
|
|
80
|
-
const loc = { ...this.world, mediaType: "video" /* EMediaTypes.video */ };
|
|
81
|
-
const dir = await this.storage.ensureCaptureLocation(loc, type);
|
|
82
|
-
return dir;
|
|
83
|
-
}
|
|
84
|
-
async getBrowserFactory() {
|
|
85
|
-
if (!this.hasFactory) {
|
|
86
|
-
this.bf = await BrowserFactory.getBrowserFactory(this.getWorld().logger, this.factoryOptions);
|
|
87
|
-
this.hasFactory = true;
|
|
88
|
-
}
|
|
89
|
-
return this.bf;
|
|
90
|
-
}
|
|
91
|
-
async getContext() {
|
|
92
|
-
const context = (await this.getBrowserFactory()).getExistingContext(this.getWorld().tag);
|
|
93
|
-
return context;
|
|
94
|
-
}
|
|
95
|
-
async getPage() {
|
|
96
|
-
const { tag } = this.getWorld();
|
|
97
|
-
const page = await (await this.getBrowserFactory()).getBrowserContextPage(tag, this.tab);
|
|
98
|
-
page.on('popup', async (popup) => {
|
|
99
|
-
await popup.waitForLoadState();
|
|
100
|
-
// const title = await popup.title();
|
|
101
|
-
this.newTab();
|
|
102
|
-
this.bf.registerPopup(tag, this.tab, popup);
|
|
103
|
-
});
|
|
104
|
-
return page;
|
|
105
|
-
}
|
|
106
|
-
async withPage(f) {
|
|
107
|
-
const page = this.withFrame ? (await this.getPage()).frameLocator(this.withFrame) : await this.getPage();
|
|
108
|
-
this.withFrame && console.debug('using frame', this.withFrame);
|
|
109
|
-
this.withFrame = undefined;
|
|
110
|
-
return await f(page);
|
|
111
|
-
}
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
113
|
-
async onFailure(result, step) {
|
|
114
|
-
if (this.bf?.hasPage(this.getWorld().tag, this.tab)) {
|
|
115
|
-
await this.captureFailureScreenshot('failure', 'onFailure', step);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// FIXME currently not executed
|
|
119
|
-
async nextStep(step) {
|
|
120
|
-
const captureScreenshot = getStepperOption(this, 'STEP_CAPTURE_SCREENSHOT', this.getWorld().extraOptions);
|
|
121
|
-
if (captureScreenshot) {
|
|
122
|
-
await this.captureRequestScreenshot('request', 'nextStep', step.seq);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
async endFeature() {
|
|
126
|
-
// close the context, which closes any pages
|
|
127
|
-
if (this.hasFactory) {
|
|
128
|
-
if (this.captureVideo) {
|
|
129
|
-
const page = await this.getPage();
|
|
130
|
-
const path = await page.video().path();
|
|
131
|
-
const artifact = { type: 'video', path };
|
|
132
|
-
this.getWorld().logger.info('endFeature video', { artifact, topic: { event: 'summary', stage: 'endFeature' }, tag: this.getWorld().tag });
|
|
133
|
-
}
|
|
134
|
-
// await this.bf?.closeContext(this.getWorld().tag);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
async close() {
|
|
138
|
-
// close the context, which closes any pages
|
|
139
|
-
if (this.hasFactory) {
|
|
140
|
-
await this.bf?.closeContext(this.getWorld().tag);
|
|
141
|
-
}
|
|
142
|
-
for (const file of this.downloaded) {
|
|
143
|
-
this.getWorld().logger.debug(`removing ${JSON.stringify(file)}`);
|
|
144
|
-
// rmSync(file);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
// FIXME
|
|
148
|
-
async finish() {
|
|
149
|
-
if (this.hasFactory) {
|
|
150
|
-
await this.bf?.close();
|
|
151
|
-
this.bf = undefined;
|
|
152
|
-
this.hasFactory = false;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
async sees(text, selector) {
|
|
156
|
-
let textContent = null;
|
|
157
|
-
// FIXME retry sometimes required?
|
|
158
|
-
for (let a = 0; a < 2; a++) {
|
|
159
|
-
textContent = await this.withPage(async (page) => await page.textContent(selector, { timeout: 1e9 }));
|
|
160
|
-
if (textContent?.toString().includes(text)) {
|
|
161
|
-
return OK;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const topics = { textContent: { summary: `in ${textContent?.length} characters`, details: textContent } };
|
|
165
|
-
return actionNotOK(`Did not find text "${text}" in ${selector}`, { topics });
|
|
166
|
-
}
|
|
167
|
-
steps = {
|
|
168
|
-
// INPUT
|
|
169
|
-
press: {
|
|
170
|
-
gwta: `press {key}`,
|
|
171
|
-
action: async ({ key }) => {
|
|
172
|
-
await this.withPage(async (page) => await page.keyboard.press(key));
|
|
173
|
-
return OK;
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
type: {
|
|
177
|
-
gwta: `type {text}`,
|
|
178
|
-
action: async ({ text }) => {
|
|
179
|
-
await this.withPage(async (page) => await page.keyboard.type(text));
|
|
180
|
-
return OK;
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
inputVariable: {
|
|
184
|
-
gwta: `input {what} for {field}`,
|
|
185
|
-
action: async ({ what, field }) => {
|
|
186
|
-
await this.withPage(async (page) => await page.locator(field).fill(what));
|
|
187
|
-
return OK;
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
selectionOption: {
|
|
191
|
-
gwta: `select {option} for {field: ${WEB_CONTROL}}`,
|
|
192
|
-
action: async ({ option, field }) => {
|
|
193
|
-
await this.withPage(async (page) => await page.selectOption(field, { label: option }));
|
|
194
|
-
// FIXME have to use id value
|
|
195
|
-
return OK;
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
// ASSERTIONS
|
|
199
|
-
dialogIs: {
|
|
200
|
-
gwta: 'dialog {what} {type} says {value}',
|
|
201
|
-
action: async ({ what, type, value }) => {
|
|
202
|
-
const cur = this.getWorld().shared.get(what)?.[type];
|
|
203
|
-
return cur === value ? OK : actionNotOK(`${what} is ${cur}`);
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
dialogIsUnset: {
|
|
207
|
-
gwta: 'dialog {what} {type} not set',
|
|
208
|
-
action: async ({ what, type }) => {
|
|
209
|
-
const cur = this.getWorld().shared.get(what)?.[type];
|
|
210
|
-
return !cur ? OK : actionNotOK(`${what} is ${cur}`);
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
seeTestId: {
|
|
214
|
-
gwta: 'has test id {testId}',
|
|
215
|
-
action: async ({ testId }) => {
|
|
216
|
-
const found = await this.withPage(async (page) => await page.getByTestId(testId));
|
|
217
|
-
return found ? OK : actionNotOK(`Did not find test id ${testId}`);
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
seeTextIn: {
|
|
221
|
-
gwta: 'in {selector}, see {text}',
|
|
222
|
-
action: async ({ text, selector }) => {
|
|
223
|
-
return await this.sees(text, selector);
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
seeText: {
|
|
227
|
-
gwta: 'see {text}',
|
|
228
|
-
action: async ({ text }) => {
|
|
229
|
-
return await this.sees(text, 'body');
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
waitFor: {
|
|
233
|
-
gwta: 'wait for {what}',
|
|
234
|
-
action: async ({ what }) => {
|
|
235
|
-
const found = await this.withPage(async (page) => await page.waitForSelector(what));
|
|
236
|
-
if (found) {
|
|
237
|
-
return OK;
|
|
238
|
-
}
|
|
239
|
-
return actionNotOK(`Did not find ${what}`);
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
onNewPage: {
|
|
243
|
-
gwta: `on a new tab`,
|
|
244
|
-
action: async () => {
|
|
245
|
-
this.newTab();
|
|
246
|
-
return OK;
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
waitForTabX: {
|
|
250
|
-
gwta: `pause until current tab is {tab}`,
|
|
251
|
-
action: async ({ tab }) => {
|
|
252
|
-
const waitForTab = parseInt(tab, 10);
|
|
253
|
-
let timedOut = false;
|
|
254
|
-
setTimeout(() => {
|
|
255
|
-
timedOut = true;
|
|
256
|
-
}, 5000);
|
|
257
|
-
while (this.tab !== waitForTab && !timedOut) {
|
|
258
|
-
await sleep(100);
|
|
259
|
-
}
|
|
260
|
-
return this.tab === waitForTab ? OK : actionNotOK(`current tab is ${this.tab}, not ${waitForTab}`);
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
onTabX: {
|
|
264
|
-
gwta: `on tab {tab}`,
|
|
265
|
-
action: async ({ tab }) => {
|
|
266
|
-
this.tab = parseInt(tab, 10);
|
|
267
|
-
return OK;
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
beOnPage: {
|
|
271
|
-
gwta: `be on the {name} ${WEB_PAGE}`,
|
|
272
|
-
action: async ({ name }) => {
|
|
273
|
-
const nowon = await this.withPage(async (page) => {
|
|
274
|
-
await page.waitForURL(name);
|
|
275
|
-
return page.url();
|
|
276
|
-
});
|
|
277
|
-
if (nowon === name) {
|
|
278
|
-
return OK;
|
|
279
|
-
}
|
|
280
|
-
return actionNotOK(`expected ${name} but on ${nowon}`);
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
extensionContext: {
|
|
284
|
-
gwta: `open extension popup for tab {tab}`,
|
|
285
|
-
action: async ({ tab }) => {
|
|
286
|
-
if (!this.factoryOptions?.persistentDirectory || this.factoryOptions?.browser.headless) {
|
|
287
|
-
throw Error(`extensions require ${WebPlaywright.PERSISTENT_DIRECTORY} and not HEADLESS`);
|
|
288
|
-
}
|
|
289
|
-
const context = await this.getContext();
|
|
290
|
-
if (!context) {
|
|
291
|
-
throw Error(`no context`);
|
|
292
|
-
}
|
|
293
|
-
const background = context?.serviceWorkers()[0];
|
|
294
|
-
if (!background) {
|
|
295
|
-
// background = await context.waitForEvent("serviceworker");
|
|
296
|
-
}
|
|
297
|
-
console.debug('background', background, context.serviceWorkers());
|
|
298
|
-
const extensionId = background.url().split('/')[2];
|
|
299
|
-
this.getWorld().shared.set('extensionContext', extensionId);
|
|
300
|
-
await this.withPage(async (page) => {
|
|
301
|
-
const popupURI = `chrome-extension://${extensionId}/popup.html?${tab}`;
|
|
302
|
-
return await page.goto(popupURI);
|
|
303
|
-
});
|
|
304
|
-
return OK;
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
cookieIs: {
|
|
308
|
-
gwta: 'cookie {name} is {value}',
|
|
309
|
-
action: async ({ name, value }) => {
|
|
310
|
-
const context = await this.getContext();
|
|
311
|
-
const cookies = await context?.cookies();
|
|
312
|
-
const found = cookies?.find((c) => c.name === name && c.value === value);
|
|
313
|
-
return found ? OK : actionNotOK(`did not find cookie ${name} with value ${value}`);
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
URIContains: {
|
|
317
|
-
gwta: 'URI includes {what}',
|
|
318
|
-
action: async ({ what }) => {
|
|
319
|
-
const uri = await this.withPage(async (page) => await page.url());
|
|
320
|
-
return uri.includes(what) ? OK : actionNotOK(`current URI ${uri} does not contain ${what}`);
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
URIQueryParameterIs: {
|
|
324
|
-
gwta: 'URI query parameter {what} is {value}',
|
|
325
|
-
action: async ({ what, value }) => {
|
|
326
|
-
const uri = await this.withPage(async (page) => await page.url());
|
|
327
|
-
const found = new URL(uri).searchParams.get(what);
|
|
328
|
-
if (found === value) {
|
|
329
|
-
return OK;
|
|
330
|
-
}
|
|
331
|
-
return actionNotOK(`URI query ${what} contains "${found}"", not "${value}""`);
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
URIStartsWith: {
|
|
335
|
-
gwta: 'URI starts with {start}',
|
|
336
|
-
action: async ({ start }) => {
|
|
337
|
-
const uri = await this.withPage(async (page) => await page.url());
|
|
338
|
-
return uri.startsWith(start) ? OK : actionNotOK(`current URI ${uri} does not start with ${start}`);
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
URIMatches: {
|
|
342
|
-
gwta: 'URI matches {what}',
|
|
343
|
-
action: async ({ what }) => {
|
|
344
|
-
const uri = await this.withPage(async (page) => await page.url());
|
|
345
|
-
return uri.match(what) ? OK : actionNotOK(`current URI ${uri} does not match ${what}`);
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
// CLICK
|
|
349
|
-
clickByAltText: {
|
|
350
|
-
gwta: 'click by alt text {altText}',
|
|
351
|
-
action: async ({ altText }) => {
|
|
352
|
-
await this.withPage(async (page) => await page.getByAltText(altText).click());
|
|
353
|
-
return OK;
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
clickByTestId: {
|
|
357
|
-
gwta: 'click by test id {testId}',
|
|
358
|
-
action: async ({ testId }) => {
|
|
359
|
-
await this.withPage(async (page) => await page.getByTestId(testId).click());
|
|
360
|
-
return OK;
|
|
361
|
-
},
|
|
362
|
-
},
|
|
363
|
-
clickByPlaceholder: {
|
|
364
|
-
gwta: 'click by placeholder {placeholder}',
|
|
365
|
-
action: async ({ placeholder }) => {
|
|
366
|
-
await this.withPage(async (page) => await page.getByPlaceholder(placeholder).click());
|
|
367
|
-
return OK;
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
clickByRole: {
|
|
371
|
-
gwta: 'click by role {roleStr}',
|
|
372
|
-
action: async ({ roleStr }) => {
|
|
373
|
-
const [role, ...restStr] = roleStr.split(' ');
|
|
374
|
-
let rest;
|
|
375
|
-
try {
|
|
376
|
-
rest = JSON.parse(restStr.join(' '));
|
|
377
|
-
}
|
|
378
|
-
catch (e) {
|
|
379
|
-
return actionNotOK(`could not parse role ${roleStr} as JSON: ${e}`);
|
|
380
|
-
}
|
|
381
|
-
await this.withPage(async (page) => await page.getByRole(role, rest || {}).click());
|
|
382
|
-
return OK;
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
clickByLabel: {
|
|
386
|
-
gwta: 'click by label {label}',
|
|
387
|
-
action: async ({ title: label }) => {
|
|
388
|
-
await this.withPage(async (page) => await page.getByLabel(label).click());
|
|
389
|
-
return OK;
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
clickByTitle: {
|
|
393
|
-
gwta: 'click by title {title}',
|
|
394
|
-
action: async ({ title }) => {
|
|
395
|
-
await this.withPage(async (page) => await page.getByTitle(title).click());
|
|
396
|
-
return OK;
|
|
397
|
-
},
|
|
398
|
-
},
|
|
399
|
-
clickByText: {
|
|
400
|
-
gwta: 'click by text {text}',
|
|
401
|
-
action: async ({ text }) => {
|
|
402
|
-
await this.withPage(async (page) => await page.getByText(text).click());
|
|
403
|
-
return OK;
|
|
404
|
-
},
|
|
405
|
-
},
|
|
406
|
-
clickOn: {
|
|
407
|
-
gwta: 'click on (?<name>.[^s]+)',
|
|
408
|
-
action: async ({ name }) => {
|
|
409
|
-
const what = this.getWorld().shared.get(name) || `text=${name}`;
|
|
410
|
-
await this.withPage(async (page) => await page.click(what));
|
|
411
|
-
return OK;
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
clickCheckbox: {
|
|
415
|
-
gwta: 'click the checkbox (?<name>.+)',
|
|
416
|
-
action: async ({ name }) => {
|
|
417
|
-
const what = this.getWorld().shared.get(name) || name;
|
|
418
|
-
this.getWorld().logger.log(`click ${name} ${what}`);
|
|
419
|
-
await this.withPage(async (page) => await page.click(what));
|
|
420
|
-
return OK;
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
clickShared: {
|
|
424
|
-
gwta: 'click `(?<id>.+)`',
|
|
425
|
-
action: async ({ id }) => {
|
|
426
|
-
const name = this.getWorld().shared.get(id);
|
|
427
|
-
await this.withPage(async (page) => await page.click(name));
|
|
428
|
-
return OK;
|
|
429
|
-
},
|
|
430
|
-
},
|
|
431
|
-
clickQuoted: {
|
|
432
|
-
gwta: 'click "(?<name>.+)"',
|
|
433
|
-
action: async ({ name }) => {
|
|
434
|
-
await this.withPage(async (page) => await page.click(`text=${name}`));
|
|
435
|
-
return OK;
|
|
436
|
-
},
|
|
437
|
-
},
|
|
438
|
-
clickLink: {
|
|
439
|
-
// TODO: generalize modifier
|
|
440
|
-
gwta: 'click( with alt)? the link {name}',
|
|
441
|
-
action: async ({ name }, vstep) => {
|
|
442
|
-
const modifier = vstep.in.match(/ with alt /) ? { modifiers: ['Alt'] } : {};
|
|
443
|
-
const field = this.getWorld().shared.get(name) || name;
|
|
444
|
-
await this.withPage(async (page) => await page.click(field, modifier));
|
|
445
|
-
return OK;
|
|
446
|
-
},
|
|
447
|
-
},
|
|
448
|
-
clickButton: {
|
|
449
|
-
gwta: 'click the button (?<id>.+)',
|
|
450
|
-
action: async ({ id }) => {
|
|
451
|
-
const field = this.getWorld().shared.get(id) || id;
|
|
452
|
-
await this.withPage(async (page) => await page.click(field));
|
|
453
|
-
return OK;
|
|
454
|
-
},
|
|
455
|
-
},
|
|
456
|
-
// NAVIGATION
|
|
457
|
-
// formerly On the {name} ${WEB_PAGE}
|
|
458
|
-
gotoPage: {
|
|
459
|
-
gwta: `go to the {name} ${WEB_PAGE}`,
|
|
460
|
-
action: async ({ name }) => {
|
|
461
|
-
const location = name.includes('://') ? name : onCurrentTypeForDomain({ name, type: WEB_PAGE }, this.getWorld());
|
|
462
|
-
const response = await this.withPage(async (page) => {
|
|
463
|
-
return await page.goto(location);
|
|
464
|
-
});
|
|
465
|
-
return response?.ok ? OK : actionNotOK(`response not ok`, { topics: { response: { ...response.allHeaders, summary: response.statusText() } } });
|
|
466
|
-
},
|
|
467
|
-
},
|
|
468
|
-
reloadPage: {
|
|
469
|
-
gwta: 'reload page',
|
|
470
|
-
action: async () => {
|
|
471
|
-
await this.withPage(async (page) => await page.reload());
|
|
472
|
-
return OK;
|
|
473
|
-
},
|
|
474
|
-
},
|
|
475
|
-
goBack: {
|
|
476
|
-
gwta: 'go back',
|
|
477
|
-
action: async () => {
|
|
478
|
-
await this.withPage(async (page) => await page.goBack());
|
|
479
|
-
return OK;
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
pressBack: {
|
|
483
|
-
gwta: 'press the back button',
|
|
484
|
-
action: async () => {
|
|
485
|
-
// FIXME
|
|
486
|
-
await this.withPage(async (page) => await page.evaluate(() => {
|
|
487
|
-
console.debug('going back', globalThis.history);
|
|
488
|
-
globalThis.history.go(-1);
|
|
489
|
-
}));
|
|
490
|
-
// await page.focus('body');
|
|
491
|
-
// await page.keyboard.press('Alt+ArrowRight');
|
|
492
|
-
return OK;
|
|
493
|
-
},
|
|
494
|
-
},
|
|
495
|
-
// BROWSER
|
|
496
|
-
usingBrowserVar: {
|
|
497
|
-
gwta: 'using {browser} browser',
|
|
498
|
-
action: async ({ browser }) => {
|
|
499
|
-
return this.setBrowser(browser);
|
|
500
|
-
},
|
|
501
|
-
},
|
|
502
|
-
// FILE DOWNLOAD/UPLOAD
|
|
503
|
-
uploadFile: {
|
|
504
|
-
gwta: 'upload file {file} using {selector}',
|
|
505
|
-
action: async ({ file, selector }) => {
|
|
506
|
-
await this.withPage(async (page) => await page.setInputFiles(selector, file));
|
|
507
|
-
return OK;
|
|
508
|
-
},
|
|
509
|
-
},
|
|
510
|
-
waitForDownload: {
|
|
511
|
-
gwta: 'save download to {file}',
|
|
512
|
-
action: async ({ file }) => {
|
|
513
|
-
try {
|
|
514
|
-
const download = await this.withPage(async (page) => page.waitForEvent('download'));
|
|
515
|
-
await download.saveAs(file);
|
|
516
|
-
this.downloaded.push(file);
|
|
517
|
-
return OK;
|
|
518
|
-
}
|
|
519
|
-
catch (e) {
|
|
520
|
-
return actionNotOK(e);
|
|
521
|
-
}
|
|
522
|
-
},
|
|
523
|
-
},
|
|
524
|
-
// MISC
|
|
525
|
-
withFrame: {
|
|
526
|
-
gwta: 'with frame {name}',
|
|
527
|
-
action: async ({ name }) => {
|
|
528
|
-
this.withFrame = name;
|
|
529
|
-
return OK;
|
|
530
|
-
},
|
|
531
|
-
},
|
|
532
|
-
captureDialog: {
|
|
533
|
-
gwta: 'Accept next dialog to {where}',
|
|
534
|
-
action: async ({ where }) => {
|
|
535
|
-
await this.withPage(async (page) => page.on('dialog', async (dialog) => {
|
|
536
|
-
const res = {
|
|
537
|
-
defaultValue: dialog.defaultValue(),
|
|
538
|
-
message: dialog.message(),
|
|
539
|
-
type: dialog.type(),
|
|
540
|
-
};
|
|
541
|
-
await dialog.accept();
|
|
542
|
-
this.getWorld().shared.set(where, res);
|
|
543
|
-
}));
|
|
544
|
-
return OK;
|
|
545
|
-
},
|
|
546
|
-
},
|
|
547
|
-
takeScreenshot: {
|
|
548
|
-
gwta: 'take a screenshot',
|
|
549
|
-
action: async (notUsed, vstep) => {
|
|
550
|
-
await this.captureScreenshot('request', 'action', vstep);
|
|
551
|
-
return OK;
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
assertOpen: {
|
|
555
|
-
gwta: '{what} is expanded with the {using}',
|
|
556
|
-
action: async ({ what, using }) => {
|
|
557
|
-
const isVisible = await this.withPage(async (page) => await page.isVisible(what));
|
|
558
|
-
if (!isVisible) {
|
|
559
|
-
await this.withPage(async (page) => await page.click(using));
|
|
560
|
-
}
|
|
561
|
-
return OK;
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
setToURIQueryParameter: {
|
|
565
|
-
gwta: 'save URI query parameter {what} to {where}',
|
|
566
|
-
action: async ({ what, where }) => {
|
|
567
|
-
const uri = await this.withPage(async (page) => await page.url());
|
|
568
|
-
const found = new URL(uri).searchParams.get(what);
|
|
569
|
-
this.getWorld().shared.set(where, found);
|
|
570
|
-
return OK;
|
|
571
|
-
},
|
|
572
|
-
},
|
|
573
|
-
};
|
|
574
|
-
setBrowser(browser) {
|
|
575
|
-
this.factoryOptions.type = browser;
|
|
576
|
-
return OK;
|
|
577
|
-
}
|
|
578
|
-
newTab() {
|
|
579
|
-
this.tab = this.tab + 1;
|
|
580
|
-
}
|
|
581
|
-
async captureFailureScreenshot(event, stage, step) {
|
|
582
|
-
return await this.captureScreenshot(event, stage, { step });
|
|
583
|
-
}
|
|
584
|
-
async captureRequestScreenshot(event, stage, seq) {
|
|
585
|
-
return await this.captureScreenshot(event, stage, { seq });
|
|
586
|
-
}
|
|
587
|
-
async captureScreenshot(event, stage, details) {
|
|
588
|
-
const loc = { ...this.getWorld(), mediaType: "image" /* EMediaTypes.image */ };
|
|
589
|
-
const dir = await this.storage.ensureCaptureLocation(loc, `screenshot ${event}`);
|
|
590
|
-
const path = `${dir}/${event}-${Date.now()}.png`;
|
|
591
|
-
await this.withPage(async (page) => await page.screenshot({
|
|
592
|
-
path,
|
|
593
|
-
}));
|
|
594
|
-
this.getWorld().logger.info('screenshot', { topic: { ...details, event, stage }, artifact: { type: 'picture', path, }, tag: this.getWorld().tag });
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
|
-
export default WebPlaywright;
|
|
598
|
-
//# sourceMappingURL=web-playwright.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web-playwright.js","sourceRoot":"","sources":["../src/web-playwright.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,EAAE,EAAwC,QAAQ,EAA6B,MAAM,gCAAgC,CAAC;AAC5I,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAyC,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC3J,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK/D,MAAM,aAAa,GAAG,MAAM,aAAc,SAAQ,QAAQ;IACx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,YAAY,EAA2B,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9K,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getCreateSteppers } from '@haibun/core/build/lib/test/lib.js';
|
|
2
|
-
const stxt = ['~@haibun/domain-webpage/build/domain-webpage', [process.cwd(), 'build', 'web-playwright'].join('/')];
|
|
3
|
-
describe('playwrightWeb', () => {
|
|
4
|
-
it('sets up steps', async () => {
|
|
5
|
-
const steppers = await getCreateSteppers(stxt);
|
|
6
|
-
expect(Object.keys(steppers[0].steps).length > 0).toBe(true);
|
|
7
|
-
expect(Object.values(steppers[0].steps).every((s) => !!s.action)).toBe(true);
|
|
8
|
-
});
|
|
9
|
-
/*
|
|
10
|
-
it.skip('sets browser type and device', async () => {
|
|
11
|
-
const { world, vstep, steppers } = await getTestEnv(stxt, 'using firefox.Pixel 5 browser', getDefaultWorld(0).world);
|
|
12
|
-
await FeatureExecutor.doFeatureStep(steppers, vstep, world);
|
|
13
|
-
const webPlaywright = findStepper<any>(steppers, 'WebPlaywright');
|
|
14
|
-
const bf = await webPlaywright.getBrowserFactory();
|
|
15
|
-
|
|
16
|
-
expect(bf.browserType.name()).toBe('firefox');
|
|
17
|
-
expect(bf.device).toBe('Pixel 5');
|
|
18
|
-
});
|
|
19
|
-
it('fails setting browser type and device', async () => {
|
|
20
|
-
const { world, vstep, steppers } = await getTestEnv(stxt, 'using nonexistent browser', getDefaultWorld(0).world);
|
|
21
|
-
const result = await FeatureExecutor.doFeatureStep(steppers, vstep, world);
|
|
22
|
-
console.log('🤑', JSON.stringify(result, null, 2));
|
|
23
|
-
expect(result.actionResults[0].ok).toBe(false);
|
|
24
|
-
});
|
|
25
|
-
*/
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=web-playwright.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web-playwright.test.js","sourceRoot":"","sources":["../src/web-playwright.test.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGpG,MAAM,IAAI,GAAG,CAAC,8CAA8C,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEpH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IACH;;;;;;;;;;;;;;;;MAgBE;AACJ,CAAC,CAAC,CAAC"}
|