@mablhq/mabl-cli 1.17.6 → 1.20.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/api/basicApiClient.js +11 -9
- package/api/featureSet.js +1 -4
- package/api/mablApiClient.js +6 -6
- package/api/mablApiClientFactory.js +9 -9
- package/api/types.js +8 -0
- package/auth/AuthClient.js +1 -0
- package/auth/OktaClient.js +66 -21
- package/browserLauncher/browserLauncherFactory.js +2 -3
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +3 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +12 -15
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +19 -1
- package/browserLauncher/runnerType.js +0 -1
- package/browserLauncher/types.js +2 -2
- package/cli.js +1 -3
- package/commands/applications/applications_cmds/list.js +1 -1
- package/commands/auth/auth_cmds/activate-key.js +2 -2
- package/commands/auth/auth_cmds/clear.js +1 -1
- package/commands/auth/auth_cmds/info.js +1 -1
- package/commands/branches/branches_cmds/create.js +1 -1
- package/commands/branches/branches_cmds/describe.js +1 -1
- package/commands/branches/branches_cmds/list.js +1 -1
- package/commands/branches/branches_cmds/merge.js +1 -1
- package/commands/commandUtil/util.js +3 -3
- package/commands/config/config_cmds/configKeys.js +11 -0
- package/commands/config/config_cmds/delete.js +6 -5
- package/commands/config/config_cmds/get.js +6 -5
- package/commands/config/config_cmds/list.js +7 -7
- package/commands/config/config_cmds/set.js +14 -21
- package/commands/credentials/credentials_cmds/list.js +1 -1
- package/commands/deploy/deploy_cmds/create.js +2 -2
- package/commands/deploy/deploy_cmds/list.js +1 -1
- package/commands/environments/environments_cmds/create.js +8 -4
- package/commands/environments/environments_cmds/list.js +1 -1
- package/commands/flows/flows_cmds/list.js +1 -1
- package/commands/link-agents/link-agents_cmds/delete.js +1 -6
- package/commands/plans/plans_cmds/list.js +1 -1
- package/commands/tests/testsUtil.js +8 -8
- package/commands/tests/tests_cmds/create.js +1 -1
- package/commands/tests/tests_cmds/import.js +2 -2
- package/commands/tests/tests_cmds/list.js +1 -1
- package/commands/tests/tests_cmds/run-cloud.js +3 -7
- package/commands/tests/tests_cmds/run.js +8 -4
- package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +2 -0
- package/index.d.ts +0 -1
- package/mablscript/MablAction.js +1 -1
- package/mablscript/MablStep.js +21 -3
- package/mablscript/actions/AwaitPDFDownloadAction.js +2 -1
- package/mablscript/actions/ConditionAction.js +11 -3
- package/mablscript/actions/ExtractAction.js +16 -7
- package/mablscript/actions/FindAction.js +71 -40
- package/mablscript/actions/GenerateRandomStringAction.js +2 -1
- package/mablscript/actions/GetUrlAction.js +1 -1
- package/mablscript/actions/GetVariableValue.js +2 -2
- package/mablscript/diffing/diffingUtil.js +146 -0
- package/mablscript/importer.js +20 -2
- package/mablscript/steps/AssertStep.js +33 -19
- package/mablscript/steps/AssertStepOld.js +38 -20
- package/mablscript/steps/AwaitTabStep.js +7 -6
- package/mablscript/steps/ClickAndHoldStep.js +1 -1
- package/mablscript/steps/DownloadStep.js +3 -2
- package/mablscript/steps/EchoStep.js +3 -1
- package/mablscript/steps/ElseIfConditionStep.js +5 -2
- package/mablscript/steps/EnterTextStep.js +4 -1
- package/mablscript/steps/EvaluateFlowStep.js +40 -0
- package/mablscript/steps/ReleaseStep.js +2 -1
- package/mablscript/steps/RemoveCookieStep.js +2 -3
- package/mablscript/steps/SendHttpRequestStep.js +3 -3
- package/mablscript/steps/SendKeyStep.js +2 -2
- package/mablscript/steps/SetCookieStep.js +2 -4
- package/mablscript/steps/SetViewportStep.js +1 -1
- package/mablscript/steps/VisitUrlStep.js +2 -1
- package/mablscript/steps/WaitStep.js +1 -4
- package/{browserLauncher/puppeteerBrowserLauncher/internals.js → mablscript/types/EvaluateFlowStepDescriptor.js} +0 -0
- package/mablscript/types/GetCurrentLocationDescriptor.js +4 -3
- package/mablscriptFind/index.js +1 -1
- package/package.json +4 -3
- package/providers/authenticationProvider.js +106 -60
- package/providers/cliConfigProvider.js +159 -61
- package/providers/types.js +9 -0
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/index.js +1 -1
- package/resources/pdf-viewer/libEmbeddedPdfHandler.js +11 -2
- package/util/actionabilityUtil.js +1 -24
- package/util/analytics.js +8 -8
- package/util/httpUtil.js +2 -2
- package/utilities.js +7 -0
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +0 -135
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowserLauncher.js +0 -45
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +0 -139
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +0 -115
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +0 -38
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +0 -27
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +0 -36
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +0 -335
- package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +0 -25
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PuppeteerPage = exports.highlightColor = exports.MAX_HIGHLIGHT_OPACITY = void 0;
|
|
7
|
-
const browserLauncher_1 = require("../browserLauncher");
|
|
8
|
-
const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
|
|
9
|
-
const events_1 = __importDefault(require("events"));
|
|
10
|
-
const puppeteerBrowserLauncher_1 = require("./puppeteerBrowserLauncher");
|
|
11
|
-
const puppeteerHttpRequest_1 = require("./puppeteerHttpRequest");
|
|
12
|
-
const puppeteerHttpResponse_1 = require("./puppeteerHttpResponse");
|
|
13
|
-
const puppeteerElementHandle_1 = require("./puppeteerElementHandle");
|
|
14
|
-
const puppeteerJsHandle_1 = require("./puppeteerJsHandle");
|
|
15
|
-
const puppeteerFrame_1 = require("./puppeteerFrame");
|
|
16
|
-
const utils_1 = require("../utils");
|
|
17
|
-
const wrappers_1 = require("./wrappers");
|
|
18
|
-
const logUtils_1 = require("../../util/logUtils");
|
|
19
|
-
exports.MAX_HIGHLIGHT_OPACITY = 0.9;
|
|
20
|
-
const highlightColor = (transparency) => ({
|
|
21
|
-
r: 196,
|
|
22
|
-
g: 68,
|
|
23
|
-
b: 183,
|
|
24
|
-
a: transparency,
|
|
25
|
-
});
|
|
26
|
-
exports.highlightColor = highlightColor;
|
|
27
|
-
class PuppeteerPage extends events_1.default {
|
|
28
|
-
constructor(page, browser) {
|
|
29
|
-
super();
|
|
30
|
-
this.page = page;
|
|
31
|
-
this.browser = browser;
|
|
32
|
-
this.puppeteerFrames = new Map();
|
|
33
|
-
page.off("dialog", PuppeteerPage.acceptDialogs);
|
|
34
|
-
page.on("dialog", PuppeteerPage.acceptDialogs);
|
|
35
|
-
page.on("close", () => {
|
|
36
|
-
this.browser.onPageClose(this);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async screenshot(clip) {
|
|
40
|
-
const { visualViewport } = await this.makeCdpCall('Page.getLayoutMetrics');
|
|
41
|
-
await this.makeCdpCall('Target.activateTarget', {
|
|
42
|
-
targetId: this.getPageId(),
|
|
43
|
-
});
|
|
44
|
-
let cdpClip;
|
|
45
|
-
if (clip) {
|
|
46
|
-
cdpClip = {
|
|
47
|
-
...clip,
|
|
48
|
-
scale: visualViewport.scale,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return this.makeCdpCall('Page.captureScreenshot', {
|
|
52
|
-
format: 'png',
|
|
53
|
-
clip: cdpClip,
|
|
54
|
-
captureBeyondViewport: false,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
async waitForInitialization() {
|
|
58
|
-
var _a;
|
|
59
|
-
if (this.browser.credentials !== undefined) {
|
|
60
|
-
await this.page.authenticate(this.browser.credentials);
|
|
61
|
-
}
|
|
62
|
-
if (this.browser.userAgent) {
|
|
63
|
-
await this.page.setUserAgent(this.browser.userAgent);
|
|
64
|
-
}
|
|
65
|
-
const opener = await ((_a = this.page.target().opener()) === null || _a === void 0 ? void 0 : _a.page());
|
|
66
|
-
this.openerPage = await (0, utils_1.mapIfNotNull)(opener, (page) => this.browser.getOrCreatePage(page));
|
|
67
|
-
}
|
|
68
|
-
makeCdpCall(method, paramArgs) {
|
|
69
|
-
return this.getCdpClient().send(method, paramArgs);
|
|
70
|
-
}
|
|
71
|
-
sendCharacter(key) {
|
|
72
|
-
return this.page.keyboard.sendCharacter(key);
|
|
73
|
-
}
|
|
74
|
-
getPageId() {
|
|
75
|
-
return this.page.target()._targetId;
|
|
76
|
-
}
|
|
77
|
-
viewport() {
|
|
78
|
-
const viewport = this.page.viewport();
|
|
79
|
-
return (0, utils_1.mapIfNotNull)(viewport, (descriptor) => ({
|
|
80
|
-
width: descriptor.width,
|
|
81
|
-
height: descriptor.height,
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
async setBrowserBounds(width, height) {
|
|
85
|
-
const windowInfo = await this.makeCdpCall('Browser.getWindowForTarget');
|
|
86
|
-
const setWindowBoundsRequest = {
|
|
87
|
-
windowId: windowInfo.windowId,
|
|
88
|
-
bounds: {
|
|
89
|
-
width,
|
|
90
|
-
height,
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
await this.makeCdpCall('Browser.setWindowBounds', setWindowBoundsRequest);
|
|
94
|
-
}
|
|
95
|
-
setCookie(...cookie) {
|
|
96
|
-
return this.page.setCookie(...cookie);
|
|
97
|
-
}
|
|
98
|
-
mouseMove(x, y) {
|
|
99
|
-
return this.page.mouse.move(x, y);
|
|
100
|
-
}
|
|
101
|
-
mouseDown() {
|
|
102
|
-
return this.page.mouse.down();
|
|
103
|
-
}
|
|
104
|
-
mouseUp() {
|
|
105
|
-
return this.page.mouse.up();
|
|
106
|
-
}
|
|
107
|
-
press(key) {
|
|
108
|
-
return this.page.keyboard.press(key);
|
|
109
|
-
}
|
|
110
|
-
keyDown(key) {
|
|
111
|
-
return this.page.keyboard.down(key);
|
|
112
|
-
}
|
|
113
|
-
keyUp(key) {
|
|
114
|
-
return this.page.keyboard.up(key);
|
|
115
|
-
}
|
|
116
|
-
sendChar(key) {
|
|
117
|
-
return this.page.keyboard.sendCharacter(key);
|
|
118
|
-
}
|
|
119
|
-
deleteCookie(...cookies) {
|
|
120
|
-
return this.page.deleteCookie(...cookies);
|
|
121
|
-
}
|
|
122
|
-
async waitForNavigation(options) {
|
|
123
|
-
try {
|
|
124
|
-
const result = await this.page.waitForNavigation((0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options));
|
|
125
|
-
return (0, utils_1.mapIfNotNull)(result, (result) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(result, this));
|
|
126
|
-
}
|
|
127
|
-
catch (e) {
|
|
128
|
-
if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
|
|
129
|
-
throw new browserLauncher_1.RUNNER_ERRORS.TimeoutError(e.message);
|
|
130
|
-
}
|
|
131
|
-
throw new browserLauncher_1.RunnerError(e.message);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
async goto(url, options) {
|
|
135
|
-
try {
|
|
136
|
-
return new puppeteerHttpResponse_1.PuppeteerHttpResponse(await this.page.goto(url, (0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options)), this);
|
|
137
|
-
}
|
|
138
|
-
catch (e) {
|
|
139
|
-
if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
|
|
140
|
-
throw new browserLauncher_1.RUNNER_ERRORS.TimeoutError(e.message);
|
|
141
|
-
}
|
|
142
|
-
throw new browserLauncher_1.RunnerError(e.message);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
async reload(options) {
|
|
146
|
-
try {
|
|
147
|
-
return (0, utils_1.mapIfNotNull)(await this.page.reload((0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options)), (response) => new puppeteerHttpResponse_1.PuppeteerHttpResponse(response, this));
|
|
148
|
-
}
|
|
149
|
-
catch (e) {
|
|
150
|
-
if (e instanceof puppeteer_core_1.default.errors.TimeoutError) {
|
|
151
|
-
throw new browserLauncher_1.RUNNER_ERRORS.TimeoutError(e.message);
|
|
152
|
-
}
|
|
153
|
-
throw new browserLauncher_1.RunnerError(e.message);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
title() {
|
|
157
|
-
return this.page.title();
|
|
158
|
-
}
|
|
159
|
-
isClosed() {
|
|
160
|
-
return this.page.isClosed();
|
|
161
|
-
}
|
|
162
|
-
cookies() {
|
|
163
|
-
return this.page.cookies();
|
|
164
|
-
}
|
|
165
|
-
async resizeViewport() {
|
|
166
|
-
await this.makeCdpCall('Emulation.clearDeviceMetricsOverride');
|
|
167
|
-
}
|
|
168
|
-
setRequestInterception(value) {
|
|
169
|
-
return this.page.setRequestInterception(value);
|
|
170
|
-
}
|
|
171
|
-
bringToFront() {
|
|
172
|
-
return this.page.bringToFront();
|
|
173
|
-
}
|
|
174
|
-
authenticate(credentials) {
|
|
175
|
-
return this.page.authenticate(credentials);
|
|
176
|
-
}
|
|
177
|
-
async setViewport(viewport) {
|
|
178
|
-
return this.emulateDevice(viewport);
|
|
179
|
-
}
|
|
180
|
-
async emulateDevice(deviceDescriptor) {
|
|
181
|
-
await this.page.setViewport(deviceDescriptor);
|
|
182
|
-
try {
|
|
183
|
-
await this.setBrowserBounds(deviceDescriptor.width, deviceDescriptor.height);
|
|
184
|
-
}
|
|
185
|
-
catch (error) {
|
|
186
|
-
(0, logUtils_1.logInternal)(`Set Browser Bounds during setViewport step failed: ${error}`);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
on(event, listener) {
|
|
190
|
-
this.wireEvents(event);
|
|
191
|
-
super.on(event, listener);
|
|
192
|
-
return this;
|
|
193
|
-
}
|
|
194
|
-
once(event, listener) {
|
|
195
|
-
this.wireEvents(event);
|
|
196
|
-
super.once(event, listener);
|
|
197
|
-
return this;
|
|
198
|
-
}
|
|
199
|
-
wireEvents(event) {
|
|
200
|
-
if (event === browserLauncher_1.PageEvent.RequestWillBeSentExtraInfo &&
|
|
201
|
-
!this.listenerCount(event)) {
|
|
202
|
-
const client = this.getCdpClient();
|
|
203
|
-
client.on('Network.requestWillBeSentExtraInfo', (event) => {
|
|
204
|
-
this.emit(browserLauncher_1.PageEvent.RequestWillBeSentExtraInfo, event);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
if (event === browserLauncher_1.PageEvent.Response && !this.listenerCount(event)) {
|
|
208
|
-
this.page.on("response", (event) => {
|
|
209
|
-
this.emit(browserLauncher_1.PageEvent.Response, new puppeteerHttpResponse_1.PuppeteerHttpResponse(event, this));
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
if (event === browserLauncher_1.PageEvent.Request && !this.listenerCount(event)) {
|
|
213
|
-
this.page.on("request", (request) => {
|
|
214
|
-
this.emit(browserLauncher_1.PageEvent.Request, new puppeteerHttpRequest_1.PuppeteerHttpRequest(request, this));
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
if (event === browserLauncher_1.PageEvent.FrameNavigated && !this.listenerCount(event)) {
|
|
218
|
-
this.page.on("framenavigated", (frame) => {
|
|
219
|
-
this.emit(browserLauncher_1.PageEvent.FrameNavigated, this.getOrCreateFrame(frame));
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
if (event === browserLauncher_1.PageEvent.FrameAttached && !this.listenerCount(event)) {
|
|
223
|
-
this.page.on("frameattached", (frame) => {
|
|
224
|
-
this.emit(browserLauncher_1.PageEvent.FrameAttached, this.getOrCreateFrame(frame));
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
if (event === browserLauncher_1.PageEvent.Console && !this.listenerCount(event)) {
|
|
228
|
-
this.page.on('console', (console) => {
|
|
229
|
-
this.emit(browserLauncher_1.PageEvent.Console, new wrappers_1.PuppeteerWrappedConsoleMessage(console, this));
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
if (event === browserLauncher_1.PageEvent.PageError && !this.listenerCount(event)) {
|
|
233
|
-
this.page.on("pageerror", (error) => {
|
|
234
|
-
this.emit(browserLauncher_1.PageEvent.PageError, error);
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
if (event === browserLauncher_1.PageEvent.Error && !this.listenerCount(event)) {
|
|
238
|
-
this.page.on("error", (error) => {
|
|
239
|
-
this.emit(browserLauncher_1.PageEvent.Error, error);
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
if (event === browserLauncher_1.PageEvent.TracingBufferUsage && !this.listenerCount(event)) {
|
|
243
|
-
this.getCdpClient().on('Tracing.bufferUsage', (tracing) => {
|
|
244
|
-
this.emit(browserLauncher_1.PageEvent.TracingBufferUsage, tracing);
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
if (event === browserLauncher_1.PageEvent.TracingComplete && !this.listenerCount(event)) {
|
|
248
|
-
this.getCdpClient().on('Tracing.tracingComplete', (tracingComplete) => {
|
|
249
|
-
this.emit(browserLauncher_1.PageEvent.TracingComplete, tracingComplete);
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
if (event === browserLauncher_1.PageEvent.TracingDataCollected &&
|
|
253
|
-
!this.listenerCount(event)) {
|
|
254
|
-
this.getCdpClient().on('Tracing.dataCollected', (data) => {
|
|
255
|
-
this.emit(browserLauncher_1.PageEvent.TracingComplete, data);
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
evaluateHandleInSecondaryWorld(code, ...args) {
|
|
260
|
-
return this.mainFrame().evaluateHandleInSecondaryWorld(code, ...args);
|
|
261
|
-
}
|
|
262
|
-
evaluate(pageFunction, ...args) {
|
|
263
|
-
return this.page.evaluate(pageFunction, ...args === null || args === void 0 ? void 0 : args.map((argument) => argument instanceof puppeteerJsHandle_1.PuppeteerJsHandle
|
|
264
|
-
? argument.getPuppeteerHandle()
|
|
265
|
-
: argument));
|
|
266
|
-
}
|
|
267
|
-
async $eval(selector, pageFunction, arg) {
|
|
268
|
-
const result = await this.page.$eval(selector, pageFunction, puppeteerJsHandle_1.PuppeteerJsHandle.unwrapProperties(arg));
|
|
269
|
-
return result;
|
|
270
|
-
}
|
|
271
|
-
async $$eval(selector, pageFunction, arg) {
|
|
272
|
-
const result = await this.page.$$eval(selector, pageFunction, puppeteerJsHandle_1.PuppeteerJsHandle.unwrapProperties(arg));
|
|
273
|
-
return result;
|
|
274
|
-
}
|
|
275
|
-
evaluateCodeInSecondaryWorld(code, args) {
|
|
276
|
-
return this.mainFrame().evaluateCodeInSecondaryWorld(code, args);
|
|
277
|
-
}
|
|
278
|
-
mainFrame() {
|
|
279
|
-
return this.getOrCreateFrame(this.page.mainFrame());
|
|
280
|
-
}
|
|
281
|
-
exposeFunction(name, puppeteerFunction) {
|
|
282
|
-
return this.page.exposeFunction(name, puppeteerFunction);
|
|
283
|
-
}
|
|
284
|
-
close() {
|
|
285
|
-
return this.page.close();
|
|
286
|
-
}
|
|
287
|
-
url() {
|
|
288
|
-
return this.page.url();
|
|
289
|
-
}
|
|
290
|
-
setExtraHTTPHeaders(headers) {
|
|
291
|
-
return this.page.setExtraHTTPHeaders(headers);
|
|
292
|
-
}
|
|
293
|
-
async $(selector) {
|
|
294
|
-
const handle = await this.page.$(selector);
|
|
295
|
-
return (0, utils_1.mapIfNotNull)(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this));
|
|
296
|
-
}
|
|
297
|
-
async $$(selector) {
|
|
298
|
-
return (await this.page.$$(selector)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this));
|
|
299
|
-
}
|
|
300
|
-
async $x(xpathQuery) {
|
|
301
|
-
return (await this.page.$x(xpathQuery)).map((element) => new puppeteerElementHandle_1.PuppeteerElementHandle(element, this));
|
|
302
|
-
}
|
|
303
|
-
static acceptDialogs(dialog) {
|
|
304
|
-
return dialog.accept();
|
|
305
|
-
}
|
|
306
|
-
async waitForSelector(selector, options) {
|
|
307
|
-
const handle = await this.page.waitForSelector(selector, (0, puppeteerBrowserLauncher_1.convertWaitForOptions)(options));
|
|
308
|
-
return (0, utils_1.mapIfNotNull)(handle, (handle) => new puppeteerElementHandle_1.PuppeteerElementHandle(handle, this));
|
|
309
|
-
}
|
|
310
|
-
frames() {
|
|
311
|
-
return this.page.frames().map((frame) => this.getOrCreateFrame(frame));
|
|
312
|
-
}
|
|
313
|
-
async getBrowserBounds() {
|
|
314
|
-
const getWindowForTarget = await this.makeCdpCall('Browser.getWindowForTarget', { targetId: this.page.target()._targetId });
|
|
315
|
-
return getWindowForTarget.bounds;
|
|
316
|
-
}
|
|
317
|
-
getPuppeteerPage() {
|
|
318
|
-
return this.page;
|
|
319
|
-
}
|
|
320
|
-
opener() {
|
|
321
|
-
return this.openerPage;
|
|
322
|
-
}
|
|
323
|
-
getOrCreateFrame(frame) {
|
|
324
|
-
const frameId = frame._id;
|
|
325
|
-
if (!this.puppeteerFrames.has(frameId)) {
|
|
326
|
-
const newFrame = new puppeteerFrame_1.PuppeteerFrame(frame, this);
|
|
327
|
-
this.puppeteerFrames.set(frameId, newFrame);
|
|
328
|
-
}
|
|
329
|
-
return this.puppeteerFrames.get(frameId);
|
|
330
|
-
}
|
|
331
|
-
getCdpClient() {
|
|
332
|
-
return this.page._client;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
exports.PuppeteerPage = PuppeteerPage;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PuppeteerWrappedConsoleMessage = void 0;
|
|
4
|
-
const puppeteerJsHandle_1 = require("../puppeteerBrowserLauncher/puppeteerJsHandle");
|
|
5
|
-
class PuppeteerWrappedConsoleMessage {
|
|
6
|
-
constructor(message, page) {
|
|
7
|
-
this.message = message;
|
|
8
|
-
this.page = page;
|
|
9
|
-
}
|
|
10
|
-
text() {
|
|
11
|
-
return this.message.text();
|
|
12
|
-
}
|
|
13
|
-
args() {
|
|
14
|
-
return this.message
|
|
15
|
-
.args()
|
|
16
|
-
.map((handle) => new puppeteerJsHandle_1.PuppeteerJsHandle(handle, this.page));
|
|
17
|
-
}
|
|
18
|
-
type() {
|
|
19
|
-
return this.message.type();
|
|
20
|
-
}
|
|
21
|
-
stackTrace() {
|
|
22
|
-
return this.message.stackTrace();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.PuppeteerWrappedConsoleMessage = PuppeteerWrappedConsoleMessage;
|