@haibun/web-playwright 1.43.0 → 1.44.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/build/BrowserFactory.d.ts +15 -27
- package/build/BrowserFactory.d.ts.map +1 -1
- package/build/BrowserFactory.js +71 -50
- package/build/BrowserFactory.js.map +1 -1
- package/build/PlaywrightEvents.d.ts +3 -3
- package/build/PlaywrightEvents.d.ts.map +1 -1
- package/build/PlaywrightEvents.js +17 -13
- package/build/PlaywrightEvents.js.map +1 -1
- package/build/monitor/XXlogToMonitor.d.ts +8 -0
- package/build/monitor/XXlogToMonitor.d.ts.map +1 -0
- package/build/monitor/XXlogToMonitor.js +151 -0
- package/build/monitor/XXlogToMonitor.js.map +1 -0
- package/build/monitor/controls.d.ts +3 -0
- package/build/monitor/controls.d.ts.map +1 -0
- package/build/monitor/controls.js +318 -0
- package/build/monitor/controls.js.map +1 -0
- package/build/monitor/disclosureJson.d.ts +3 -0
- package/build/monitor/disclosureJson.d.ts.map +1 -0
- package/build/monitor/disclosureJson.js +121 -0
- package/build/monitor/disclosureJson.js.map +1 -0
- package/build/monitor/mermaidDiagram.d.ts +22 -0
- package/build/monitor/mermaidDiagram.d.ts.map +1 -0
- package/build/monitor/mermaidDiagram.js +199 -0
- package/build/monitor/mermaidDiagram.js.map +1 -0
- package/build/monitor/messages.d.ts +18 -0
- package/build/monitor/messages.d.ts.map +1 -0
- package/build/monitor/messages.js +303 -0
- package/build/monitor/messages.js.map +1 -0
- package/build/monitor/monitor.d.ts +16 -0
- package/build/monitor/monitor.d.ts.map +1 -0
- package/build/monitor/monitor.js +61 -0
- package/build/monitor/monitor.js.map +1 -0
- package/build/monitor/monitorHandler.d.ts +12 -0
- package/build/monitor/monitorHandler.d.ts.map +1 -0
- package/build/monitor/monitorHandler.js +89 -0
- package/build/monitor/monitorHandler.js.map +1 -0
- package/build/rest-playwright.d.ts +60 -2
- package/build/rest-playwright.d.ts.map +1 -1
- package/build/rest-playwright.js +170 -51
- package/build/rest-playwright.js.map +1 -1
- package/build/web-playwright.d.ts +142 -54
- package/build/web-playwright.d.ts.map +1 -1
- package/build/web-playwright.js +327 -110
- package/build/web-playwright.js.map +1 -1
- package/package.json +5 -4
- package/web/monitor.html +2925 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Page } from 'playwright';
|
|
2
|
+
import { TWorld } from '@haibun/core/build/lib/defs.js';
|
|
3
|
+
import { TLogLevel, TLogArgs, TMessageContext } from '@haibun/core/build/lib/interfaces/logger.js';
|
|
4
|
+
import { AStorage } from '@haibun/domain-storage/build/AStorage.js';
|
|
5
|
+
export declare const createMonitorPageAndSubscriber: () => () => Promise<{
|
|
6
|
+
monitorPage: Page;
|
|
7
|
+
subscriber: {
|
|
8
|
+
out: (level: TLogLevel, message: TLogArgs, messageContext?: TMessageContext) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export declare function writeMonitor(world: TWorld, storage: AStorage, page: Page): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=monitorHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitorHandler.d.ts","sourceRoot":"","sources":["../../src/monitor/monitorHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAEnG,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAMpE,eAAO,MAAM,8BAA8B;;;qBAetB,SAAS,WAAW,QAAQ,mBAAmB,eAAe;;EA6ClF,CAAC;AAGF,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,iBAkB9E"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { join, resolve } from 'path';
|
|
2
|
+
import { existsSync } from 'fs';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
4
|
+
import { chromium } from 'playwright';
|
|
5
|
+
import { sleep } from '@haibun/core/build/lib/util/index.js';
|
|
6
|
+
import { EMediaTypes } from '@haibun/domain-storage/build/media-types.js';
|
|
7
|
+
import { getPackageLocation } from '@haibun/core/build/lib/util/workspace-lib.js';
|
|
8
|
+
const monitorLocation = join(getPackageLocation(import.meta), '..', '..', 'web', 'monitor.html');
|
|
9
|
+
export const createMonitorPageAndSubscriber = () => async () => {
|
|
10
|
+
console.log(`Creating new monitor page`);
|
|
11
|
+
const browser = await chromium.launch({ headless: false });
|
|
12
|
+
const context = await browser.newContext();
|
|
13
|
+
const monitorPage = await context.newPage();
|
|
14
|
+
await waitForMonitorPage();
|
|
15
|
+
await monitorPage.goto(pathToFileURL(monitorLocation).toString(), { waitUntil: 'networkidle' });
|
|
16
|
+
await monitorPage.evaluate(() => {
|
|
17
|
+
document.body.dataset.haibunRuntime = 'true';
|
|
18
|
+
});
|
|
19
|
+
const subscriber = {
|
|
20
|
+
out: async (level, message, messageContext) => {
|
|
21
|
+
if (!monitorPage || monitorPage.isClosed()) {
|
|
22
|
+
console.error("Monitor page closed, cannot send logs.");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
await monitorPage.evaluate((entry) => {
|
|
27
|
+
// This code runs in the browser context (monitor.html)
|
|
28
|
+
if (window.receiveLogData) {
|
|
29
|
+
// Parse the context string back into an object inside the browser.
|
|
30
|
+
const contextObject = entry.messageContextString ? JSON.parse(entry.messageContextString) : undefined;
|
|
31
|
+
window.receiveLogData({
|
|
32
|
+
level: entry.level,
|
|
33
|
+
message: entry.message,
|
|
34
|
+
messageContext: contextObject,
|
|
35
|
+
timestamp: entry.timestamp
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw Error('window.receiveLogData not defined in monitor page');
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
// Data being sent from Node.js to the browser
|
|
43
|
+
level,
|
|
44
|
+
message,
|
|
45
|
+
messageContextString: messageContext ? JSON.stringify(messageContext) : undefined,
|
|
46
|
+
timestamp: Date.now()
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
catch (e) { // Use 'any' or a more specific error type
|
|
50
|
+
// Specific check for the serialization error
|
|
51
|
+
if (e instanceof Error && e.message.includes('Unexpected value')) {
|
|
52
|
+
console.error('Error sending log to monitor via evaluate: Serialization failed. Check the structure of messageContext.', e.message);
|
|
53
|
+
console.log('Problematic messageContext object before stringify:', messageContext);
|
|
54
|
+
}
|
|
55
|
+
// Handle page closure or other evaluate errors
|
|
56
|
+
else if (e instanceof Error && !e.message.includes('Target page, context or browser has been closed')) {
|
|
57
|
+
console.error('Error sending log to monitor via evaluate:', e.message);
|
|
58
|
+
}
|
|
59
|
+
throw (e);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
return { monitorPage, subscriber };
|
|
64
|
+
};
|
|
65
|
+
// Function to write the final monitor HTML (adapted)
|
|
66
|
+
export async function writeMonitor(world, storage, page) {
|
|
67
|
+
if (!page || page.isClosed()) {
|
|
68
|
+
world.logger.error('Monitor page is closed, cannot write monitor file.');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
await sleep(500); // Allow final rendering
|
|
72
|
+
await page.evaluate(() => {
|
|
73
|
+
delete document.body.dataset.haibunRuntime;
|
|
74
|
+
});
|
|
75
|
+
const content = await page.content();
|
|
76
|
+
const monitorLoc = await storage.getCaptureLocation({ ...world, mediaType: EMediaTypes.html });
|
|
77
|
+
const outHtml = join(monitorLoc, 'monitor.html');
|
|
78
|
+
await storage.writeFile(outHtml, content, EMediaTypes.html);
|
|
79
|
+
world.logger.info(`Wrote monitor HTML instance to ${pathToFileURL(resolve(outHtml))}`);
|
|
80
|
+
}
|
|
81
|
+
async function waitForMonitorPage() {
|
|
82
|
+
let waitForMonitor = 0;
|
|
83
|
+
while (!existsSync(monitorLocation) && waitForMonitor < 20) {
|
|
84
|
+
if (waitForMonitor++ === 1)
|
|
85
|
+
console.info(`Waiting up to ${20 * .5} seconds for monitor.html`);
|
|
86
|
+
await sleep(500);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=monitorHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitorHandler.js","sourceRoot":"","sources":["../../src/monitor/monitorHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAQ,MAAM,YAAY,CAAC;AAI5C,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE;IAC9D,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAE5C,MAAM,kB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,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IAErC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/F,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACjD,MAAM,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5D,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACxF,CAAC;AAED,KAAK,UAAU,kBAAkB;IAChC,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,cAAc,GAAG,EAAE,EAAE,CAAC;QAC5D,IAAI,cAAc,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE,2BAA2B,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;AACF,CAAC"}
|
|
@@ -1,14 +1,64 @@
|
|
|
1
|
-
import { TNamed } from '@haibun/core/build/lib/defs.js';
|
|
2
1
|
import WebPlaywright from './web-playwright.js';
|
|
2
|
+
import { TNamed, TAnyFixme } from '@haibun/core/build/lib/defs.js';
|
|
3
|
+
export declare const AUTHORIZATION = "Authorization";
|
|
4
|
+
export declare const ACCESS_TOKEN = "access_token";
|
|
5
|
+
export declare const base64Encode: ({ username, password }: {
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
}) => string;
|
|
3
9
|
export declare const restSteps: (webPlaywright: WebPlaywright) => {
|
|
10
|
+
setApiUserAgent: {
|
|
11
|
+
gwta: string;
|
|
12
|
+
action: ({ agent }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
13
|
+
};
|
|
14
|
+
addBasicAuthCredentials: {
|
|
15
|
+
gwta: string;
|
|
16
|
+
action: ({ username, password }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
17
|
+
};
|
|
4
18
|
addAuthBearerToken: {
|
|
5
19
|
gwta: string;
|
|
6
20
|
action: ({ token }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
7
21
|
};
|
|
22
|
+
restTokenRequest: {
|
|
23
|
+
gwta: string;
|
|
24
|
+
action: ({ endpoint }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
25
|
+
};
|
|
26
|
+
restTokenLogout: {
|
|
27
|
+
gwta: string;
|
|
28
|
+
action: ({ endpoint }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
29
|
+
};
|
|
30
|
+
acceptEndpointRequest: {
|
|
31
|
+
gwta: string;
|
|
32
|
+
action: ({ accept, method, endpoint }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
33
|
+
};
|
|
8
34
|
restEndpointRequest: {
|
|
9
35
|
gwta: string;
|
|
10
36
|
action: ({ method, endpoint }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
11
37
|
};
|
|
38
|
+
filterResponseJson: {
|
|
39
|
+
gwta: string;
|
|
40
|
+
action: ({ property, match }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
41
|
+
};
|
|
42
|
+
filteredResponseLengthIs: {
|
|
43
|
+
gwta: string;
|
|
44
|
+
action: ({ length }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
45
|
+
};
|
|
46
|
+
showResponseLength: {
|
|
47
|
+
gwta: string;
|
|
48
|
+
action: () => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
49
|
+
};
|
|
50
|
+
showFilteredLength: {
|
|
51
|
+
gwta: string;
|
|
52
|
+
action: () => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
53
|
+
};
|
|
54
|
+
responseJsonLengthIs: {
|
|
55
|
+
gwta: string;
|
|
56
|
+
action: ({ length }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
57
|
+
};
|
|
58
|
+
restEndpointFilteredPropertyRequest: {
|
|
59
|
+
gwta: string;
|
|
60
|
+
action: ({ property, method, endpoint, status }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
61
|
+
};
|
|
12
62
|
restEndpointRequestWithPayload: {
|
|
13
63
|
gwta: string;
|
|
14
64
|
action: ({ method, endpoint, payload }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
@@ -23,7 +73,15 @@ export declare const restSteps: (webPlaywright: WebPlaywright) => {
|
|
|
23
73
|
};
|
|
24
74
|
restResponseIs: {
|
|
25
75
|
gwta: string;
|
|
26
|
-
action: ({
|
|
76
|
+
action: ({ value }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult | import("@haibun/core/build/lib/defs.js").TNotOKActionResult>;
|
|
27
77
|
};
|
|
28
78
|
};
|
|
79
|
+
export type TCapturedResponse = {
|
|
80
|
+
status: number;
|
|
81
|
+
statusText: string;
|
|
82
|
+
headers: TAnyFixme;
|
|
83
|
+
url: string;
|
|
84
|
+
json: TAnyFixme;
|
|
85
|
+
text: string;
|
|
86
|
+
};
|
|
29
87
|
//# sourceMappingURL=rest-playwright.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-playwright.d.ts","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rest-playwright.d.ts","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAM,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAOvE,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;;;4BAG1B,MAAM;;;;yCAOO,MAAM;;;;4BAOnB,MAAM;;;;+BAOH,MAAM;;;;+BAcN,MAAM;;;;+CAYU,MAAM;;;;uCAad,MAAM;;;;sCAaP,MAAM;;;;6BAgBf,MAAM;;;;;;;;;;;;6BAkCN,MAAM;;;;yDAUsB,MAAM;;;;gDA+Bf,MAAM;;;;6BA2BzB,MAAM;;;;sCAUG,MAAM;;;;4BAUhB,MAAM;;CAQhC,CAAC;AAEH,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;CACb,CAAC"}
|
package/build/rest-playwright.js
CHANGED
|
@@ -1,100 +1,219 @@
|
|
|
1
|
+
import { actionNotOK, actionOK } from '@haibun/core/build/lib/util/index.js';
|
|
1
2
|
import { OK } from '@haibun/core/build/lib/defs.js';
|
|
2
|
-
import {
|
|
3
|
+
import { EExecutionMessageType } from '@haibun/core/build/lib/interfaces/logger.js';
|
|
3
4
|
const LAST_REST_RESPONSE = 'LAST_REST_RESPONSE';
|
|
4
5
|
const PAYLOAD_METHODS = ['post', 'put', 'patch'];
|
|
5
6
|
const NO_PAYLOAD_METHODS = ['get', 'delete', 'head'];
|
|
7
|
+
export const AUTHORIZATION = 'Authorization';
|
|
8
|
+
export const ACCESS_TOKEN = 'access_token';
|
|
9
|
+
const HTTP = 'HTTP';
|
|
10
|
+
export const base64Encode = ({ username, password }) => Buffer.from(`${username}:${password}`).toString('base64');
|
|
6
11
|
export const restSteps = (webPlaywright) => ({
|
|
12
|
+
setApiUserAgent: {
|
|
13
|
+
gwta: `API user agent is {agent}`,
|
|
14
|
+
action: async ({ agent }) => {
|
|
15
|
+
webPlaywright.apiUserAgent = agent;
|
|
16
|
+
return Promise.resolve(OK);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
addBasicAuthCredentials: {
|
|
20
|
+
gwta: `use Authorization Basic header with {username}, {password}`,
|
|
21
|
+
action: async ({ username, password }) => {
|
|
22
|
+
await webPlaywright.setExtraHTTPHeaders({ [AUTHORIZATION]: `Basic ${base64Encode({ username, password })}` });
|
|
23
|
+
return Promise.resolve(OK);
|
|
24
|
+
},
|
|
25
|
+
},
|
|
7
26
|
addAuthBearerToken: {
|
|
8
|
-
gwta:
|
|
27
|
+
gwta: `use Authorization Bearer header with {token}`,
|
|
9
28
|
action: async ({ token }) => {
|
|
10
|
-
await webPlaywright.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
29
|
+
await webPlaywright.setExtraHTTPHeaders({ [AUTHORIZATION]: `Bearer ${token}` });
|
|
30
|
+
return Promise.resolve(OK);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
restTokenRequest: {
|
|
34
|
+
gwta: `request OAuth 2.0 access token from {endpoint}`,
|
|
35
|
+
action: async ({ endpoint }) => {
|
|
36
|
+
const serialized = await webPlaywright.withPageFetch(endpoint);
|
|
37
|
+
const accessToken = serialized.json[ACCESS_TOKEN];
|
|
38
|
+
await webPlaywright.setExtraHTTPHeaders({ [AUTHORIZATION]: `Bearer ${accessToken}` });
|
|
39
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, serialized);
|
|
40
|
+
return Promise.resolve(OK);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
restTokenLogout: {
|
|
44
|
+
gwta: `perform OAuth 2.0 logout from {endpoint}`,
|
|
45
|
+
action: async ({ endpoint }) => {
|
|
46
|
+
await webPlaywright.setExtraHTTPHeaders({});
|
|
47
|
+
const serialized = await webPlaywright.withPageFetch(endpoint);
|
|
48
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, serialized);
|
|
49
|
+
return Promise.resolve(OK);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
acceptEndpointRequest: {
|
|
53
|
+
gwta: `accept {accept} using ${HTTP} {method} to {endpoint}`,
|
|
54
|
+
action: async ({ accept, method, endpoint }) => {
|
|
55
|
+
method = method.toLowerCase();
|
|
56
|
+
if (!NO_PAYLOAD_METHODS.includes(method)) {
|
|
57
|
+
return actionNotOK(`Method ${method} not supported`);
|
|
58
|
+
}
|
|
59
|
+
const serialized = await webPlaywright.withPageFetch(endpoint, method, { headers: { accept } });
|
|
60
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, serialized);
|
|
61
|
+
return Promise.resolve(OK);
|
|
14
62
|
},
|
|
15
63
|
},
|
|
16
64
|
restEndpointRequest: {
|
|
17
|
-
gwta:
|
|
65
|
+
gwta: `make an ${HTTP} {method} to {endpoint}`,
|
|
18
66
|
action: async ({ method, endpoint }) => {
|
|
19
67
|
method = method.toLowerCase();
|
|
20
68
|
if (!NO_PAYLOAD_METHODS.includes(method)) {
|
|
21
69
|
return actionNotOK(`Method ${method} not supported`);
|
|
22
70
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
71
|
+
const serialized = await webPlaywright.withPageFetch(endpoint, method);
|
|
72
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, serialized);
|
|
73
|
+
return Promise.resolve(OK);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
filterResponseJson: {
|
|
77
|
+
gwta: `filter JSON response by {property} matching {match}`,
|
|
78
|
+
action: async ({ property, match }) => {
|
|
79
|
+
const lastResponse = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
80
|
+
if (!lastResponse?.json || !Array.isArray(lastResponse.json)) {
|
|
81
|
+
return actionNotOK(`No JSON or array from ${JSON.stringify(lastResponse)}`);
|
|
82
|
+
}
|
|
83
|
+
const filtered = lastResponse.json.filter((item) => item[property].match(match));
|
|
84
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, {
|
|
85
|
+
...lastResponse,
|
|
86
|
+
filtered,
|
|
87
|
+
});
|
|
88
|
+
return Promise.resolve(OK);
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
filteredResponseLengthIs: {
|
|
92
|
+
gwta: `filtered response length is {length}`,
|
|
93
|
+
action: async ({ length }) => {
|
|
94
|
+
const lastResponse = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
95
|
+
if (!lastResponse?.filtered || lastResponse.filtered.length !== parseInt(length)) {
|
|
96
|
+
return actionNotOK(`Expected ${length}, got ${lastResponse?.filtered?.length}`);
|
|
97
|
+
}
|
|
98
|
+
return Promise.resolve(OK);
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
showResponseLength: {
|
|
102
|
+
gwta: `show JSON response count`,
|
|
103
|
+
action: async () => {
|
|
104
|
+
const lastResponse = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
105
|
+
if (!lastResponse?.json || typeof lastResponse.json.length !== 'number') {
|
|
106
|
+
console.debug(lastResponse);
|
|
107
|
+
return Promise.resolve(actionNotOK(`No last response to count`));
|
|
108
|
+
}
|
|
109
|
+
webPlaywright.getWorld().logger.info(`lastResponse JSON count is ${lastResponse.json.length}`);
|
|
110
|
+
return Promise.resolve(actionOK({ incident: EExecutionMessageType.ACTION, incidentDetails: { summary: 'options', details: { count: lastResponse.json.length } } }));
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
showFilteredLength: {
|
|
114
|
+
gwta: `show filtered response count`,
|
|
115
|
+
action: async () => {
|
|
116
|
+
const lastResponse = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
117
|
+
if (!lastResponse?.filtered || typeof lastResponse.filtered.length !== 'number') {
|
|
118
|
+
console.debug(lastResponse);
|
|
119
|
+
return Promise.resolve(actionNotOK(`No filtered response to count`));
|
|
120
|
+
}
|
|
121
|
+
webPlaywright.getWorld().logger.info(`lastResponse filtered count is ${lastResponse.filtered.length}`);
|
|
122
|
+
return Promise.resolve(actionOK({ incident: EExecutionMessageType.ACTION, incidentDetails: { summary: 'options', count: lastResponse.filtered.length } }));
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
responseJsonLengthIs: {
|
|
126
|
+
gwta: `JSON response length is {length}`,
|
|
127
|
+
action: async ({ length }) => {
|
|
128
|
+
const lastResponse = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
129
|
+
if (!lastResponse?.json || lastResponse.json.length !== parseInt(length)) {
|
|
130
|
+
return actionNotOK(`Expected ${length}, got ${lastResponse?.json?.length}`);
|
|
131
|
+
}
|
|
132
|
+
return Promise.resolve(OK);
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
restEndpointFilteredPropertyRequest: {
|
|
136
|
+
gwta: `for each filtered {property}, make REST {method} to {endpoint} yielding status {status}`,
|
|
137
|
+
action: async ({ property, method, endpoint, status }) => {
|
|
138
|
+
method = method.toLowerCase();
|
|
139
|
+
if (!NO_PAYLOAD_METHODS.includes(method)) {
|
|
140
|
+
return actionNotOK(`Method ${method} not supported`);
|
|
141
|
+
}
|
|
142
|
+
const lastResponse = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
143
|
+
const { filtered } = lastResponse;
|
|
144
|
+
if (!filtered) {
|
|
145
|
+
return actionNotOK(`No filtered response in ${lastResponse}`);
|
|
27
146
|
}
|
|
28
|
-
|
|
29
|
-
return actionNotOK(`
|
|
147
|
+
if (!filtered.every((item) => item[property] !== undefined)) {
|
|
148
|
+
return actionNotOK(`Property ${property} not found in all items`);
|
|
30
149
|
}
|
|
150
|
+
const responses = [];
|
|
151
|
+
for (const item of filtered) {
|
|
152
|
+
const requestPath = `${endpoint}/${item[property]}`;
|
|
153
|
+
const serialized = await webPlaywright.withPageFetch(requestPath, method);
|
|
154
|
+
if (serialized.status !== parseInt(status, 10)) {
|
|
155
|
+
return actionNotOK(`Expected status ${status} to ${requestPath}, got ${serialized.status}`);
|
|
156
|
+
}
|
|
157
|
+
responses.push(serialized);
|
|
158
|
+
}
|
|
159
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, responses);
|
|
160
|
+
return Promise.resolve(OK);
|
|
31
161
|
},
|
|
32
162
|
},
|
|
33
163
|
restEndpointRequestWithPayload: {
|
|
34
|
-
gwta:
|
|
164
|
+
gwta: `make an ${'HTTP'} {method} to {endpoint} with {payload}`,
|
|
35
165
|
action: async ({ method, endpoint, payload }) => {
|
|
36
166
|
method = method.toLowerCase();
|
|
37
167
|
if (!PAYLOAD_METHODS.includes(method)) {
|
|
38
|
-
return actionNotOK(`Method ${method} does not support payload`);
|
|
168
|
+
return actionNotOK(`Method ${method} (${method}) does not support payload`);
|
|
39
169
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const response = await webPlaywright.withPage(async (page) => await page[method](endpoint, requestOptions));
|
|
44
|
-
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, capturedResponse(response));
|
|
45
|
-
return OK;
|
|
170
|
+
let postData;
|
|
171
|
+
if (typeof payload === 'object') {
|
|
172
|
+
postData = JSON.stringify(payload);
|
|
46
173
|
}
|
|
47
|
-
|
|
48
|
-
|
|
174
|
+
else {
|
|
175
|
+
postData = payload;
|
|
49
176
|
}
|
|
177
|
+
const requestOptions = {
|
|
178
|
+
postData,
|
|
179
|
+
headers: {
|
|
180
|
+
'Content-Type': 'application/json',
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const serialized = await webPlaywright.withPageFetch(endpoint, method, requestOptions);
|
|
184
|
+
webPlaywright.getWorld().shared.set(LAST_REST_RESPONSE, serialized);
|
|
185
|
+
return Promise.resolve(OK);
|
|
50
186
|
},
|
|
51
187
|
},
|
|
52
188
|
restLastStatusIs: {
|
|
53
|
-
gwta:
|
|
189
|
+
gwta: `${HTTP} status is {status}`,
|
|
54
190
|
action: async ({ status }) => {
|
|
55
191
|
const response = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
56
192
|
if (response && response.status === parseInt(status)) {
|
|
57
|
-
return OK;
|
|
193
|
+
return Promise.resolve(OK);
|
|
58
194
|
}
|
|
59
195
|
return actionNotOK(`Expected status ${status}, got ${response?.status || 'no response'}`);
|
|
60
196
|
},
|
|
61
197
|
},
|
|
62
198
|
restResponsePropertyIs: {
|
|
63
|
-
gwta:
|
|
199
|
+
gwta: `${HTTP} response property {property} is {value}`,
|
|
64
200
|
action: async ({ property, value }) => {
|
|
65
201
|
const response = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
66
|
-
if (response && response.
|
|
67
|
-
return OK;
|
|
202
|
+
if (response && response.json && response.json[property] === value) {
|
|
203
|
+
return Promise.resolve(OK);
|
|
68
204
|
}
|
|
69
|
-
return actionNotOK(`Expected response.${property} to be ${value}, got ${response?.
|
|
205
|
+
return actionNotOK(`Expected response.json.${property} to be ${value}, got ${JSON.stringify(response?.json[property])}`);
|
|
70
206
|
},
|
|
71
207
|
},
|
|
72
208
|
restResponseIs: {
|
|
73
|
-
gwta:
|
|
74
|
-
action: async ({
|
|
209
|
+
gwta: `${HTTP} text response is {value}`,
|
|
210
|
+
action: async ({ value }) => {
|
|
75
211
|
const response = webPlaywright.getWorld().shared.get(LAST_REST_RESPONSE);
|
|
76
|
-
if (response && response.
|
|
77
|
-
return OK;
|
|
212
|
+
if (response && response.text === value) {
|
|
213
|
+
return Promise.resolve(OK);
|
|
78
214
|
}
|
|
79
|
-
return actionNotOK(`Expected response to be ${value}, got ${response?.
|
|
215
|
+
return actionNotOK(`Expected response to be ${value}, got ${response?.text}`);
|
|
80
216
|
},
|
|
81
217
|
},
|
|
82
218
|
});
|
|
83
|
-
async function capturedResponse(response) {
|
|
84
|
-
const capturedResponse = {
|
|
85
|
-
status: response.status,
|
|
86
|
-
statusText: response.statusText,
|
|
87
|
-
headers: response.headers,
|
|
88
|
-
url: response.url,
|
|
89
|
-
json: null,
|
|
90
|
-
text: null,
|
|
91
|
-
};
|
|
92
|
-
try {
|
|
93
|
-
capturedResponse.json = await response.json();
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
capturedResponse.text = await response.text();
|
|
97
|
-
}
|
|
98
|
-
return capturedResponse;
|
|
99
|
-
}
|
|
100
219
|
//# sourceMappingURL=rest-playwright.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-playwright.js","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rest-playwright.js","sourceRoot":"","sources":["../src/rest-playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAU,EAAE,EAAa,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,C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