patchright-core 1.51.3 → 1.52.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/browsers.json +15 -13
- package/lib/androidServerImpl.js +42 -48
- package/lib/browserServerImpl.js +54 -67
- package/lib/cli/driver.js +71 -69
- package/lib/cli/program.js +312 -328
- package/lib/cli/programWithTestStub.js +51 -45
- package/lib/client/accessibility.js +31 -32
- package/lib/client/android.js +141 -228
- package/lib/client/api.js +135 -283
- package/lib/client/artifact.js +39 -36
- package/lib/client/browser.js +57 -61
- package/lib/client/browserContext.js +297 -326
- package/lib/client/browserType.js +92 -106
- package/lib/client/cdpSession.js +29 -31
- package/lib/client/channelOwner.js +82 -95
- package/lib/client/clientHelper.js +46 -38
- package/lib/client/clientInstrumentation.js +40 -37
- package/lib/client/clientStackTrace.js +41 -37
- package/lib/client/clock.js +36 -36
- package/lib/client/connection.js +190 -212
- package/lib/client/consoleMessage.js +31 -28
- package/lib/client/coverage.js +25 -22
- package/lib/client/dialog.js +30 -31
- package/lib/client/download.js +25 -25
- package/lib/client/electron.js +73 -75
- package/lib/client/elementHandle.js +111 -147
- package/lib/client/errors.js +53 -53
- package/lib/client/eventEmitter.js +124 -121
- package/lib/client/events.js +72 -68
- package/lib/client/fetch.js +135 -158
- package/lib/client/fileChooser.js +25 -24
- package/lib/client/fileUtils.js +31 -28
- package/lib/client/frame.js +187 -306
- package/lib/client/harRouter.js +42 -52
- package/lib/client/input.js +40 -69
- package/lib/client/jsHandle.js +54 -69
- package/lib/client/jsonPipe.js +27 -23
- package/lib/client/localUtils.js +29 -28
- package/lib/client/locator.js +161 -245
- package/lib/client/network.js +277 -295
- package/lib/client/page.js +270 -318
- package/lib/client/platform.js +46 -43
- package/lib/client/playwright.js +51 -66
- package/lib/client/selectors.js +48 -46
- package/lib/client/stream.js +29 -25
- package/lib/client/timeoutSettings.js +49 -39
- package/lib/client/tracing.js +48 -84
- package/lib/client/types.js +26 -22
- package/lib/client/video.js +35 -27
- package/lib/client/waiter.js +69 -88
- package/lib/client/webError.js +25 -23
- package/lib/client/webSocket.js +61 -56
- package/lib/client/worker.js +48 -58
- package/lib/client/writableStream.js +27 -23
- package/lib/generated/clockSource.js +26 -5
- package/lib/generated/consoleApiSource.js +26 -5
- package/lib/generated/injectedScriptSource.js +26 -5
- package/lib/generated/pollingRecorderSource.js +26 -5
- package/lib/generated/utilityScriptSource.js +26 -5
- package/lib/generated/webSocketMockSource.js +375 -4
- package/lib/inProcessFactory.js +53 -53
- package/lib/inprocess.js +2 -19
- package/lib/outofprocess.js +53 -46
- package/lib/protocol/debug.js +209 -25
- package/lib/protocol/serializers.js +153 -134
- package/lib/protocol/validator.js +2714 -2714
- package/lib/protocol/validatorPrimitives.js +114 -73
- package/lib/remote/playwrightConnection.js +140 -157
- package/lib/remote/playwrightServer.js +99 -84
- package/lib/server/accessibility.js +44 -37
- package/lib/server/android/android.js +216 -209
- package/lib/server/android/backendAdb.js +89 -82
- package/lib/server/artifact.js +78 -55
- package/lib/server/bidi/bidiBrowser.js +221 -155
- package/lib/server/bidi/bidiChromium.js +106 -79
- package/lib/server/bidi/bidiConnection.js +66 -83
- package/lib/server/bidi/bidiExecutionContext.js +128 -113
- package/lib/server/bidi/bidiFirefox.js +76 -69
- package/lib/server/bidi/bidiInput.js +86 -97
- package/lib/server/bidi/bidiNetworkManager.js +137 -154
- package/lib/server/bidi/bidiOverCdp.js +57 -58
- package/lib/server/bidi/bidiPage.js +247 -219
- package/lib/server/bidi/bidiPdf.js +52 -86
- package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/lib/server/bidi/third_party/bidiDeserializer.js +55 -50
- package/lib/server/bidi/third_party/bidiKeyboard.js +236 -220
- package/lib/server/bidi/third_party/bidiProtocol.js +144 -131
- package/lib/server/bidi/third_party/bidiSerializer.js +67 -63
- package/lib/server/bidi/third_party/firefoxPrefs.js +141 -119
- package/lib/server/browser.js +76 -84
- package/lib/server/browserContext.js +321 -346
- package/lib/server/browserType.js +169 -182
- package/lib/server/callLog.js +47 -44
- package/lib/server/chromium/chromium.js +212 -190
- package/lib/server/chromium/chromiumSwitches.js +86 -64
- package/lib/server/chromium/crAccessibility.js +157 -131
- package/lib/server/chromium/crBrowser.js +253 -273
- package/lib/server/chromium/crConnection.js +91 -116
- package/lib/server/chromium/crCoverage.js +113 -127
- package/lib/server/chromium/crDevTools.js +59 -51
- package/lib/server/chromium/crDragDrop.js +62 -79
- package/lib/server/chromium/crExecutionContext.js +88 -83
- package/lib/server/chromium/crInput.js +97 -95
- package/lib/server/chromium/crNetworkManager.js +284 -404
- package/lib/server/chromium/crPage.js +522 -608
- package/lib/server/chromium/crPdf.js +54 -86
- package/lib/server/chromium/crProtocolHelper.js +92 -80
- package/lib/server/chromium/crServiceWorker.js +82 -67
- package/lib/server/chromium/defaultFontFamilies.js +152 -135
- package/lib/server/chromium/protocol.d.js +16 -0
- package/lib/server/chromium/videoRecorder.js +65 -99
- package/lib/server/clock.js +62 -50
- package/lib/server/codegen/csharp.js +185 -160
- package/lib/server/codegen/java.js +155 -128
- package/lib/server/codegen/javascript.js +163 -148
- package/lib/server/codegen/jsonl.js +32 -28
- package/lib/server/codegen/language.js +75 -52
- package/lib/server/codegen/languages.js +65 -27
- package/lib/server/codegen/python.js +140 -125
- package/lib/server/codegen/types.js +15 -4
- package/lib/server/console.js +28 -32
- package/lib/server/cookieStore.js +105 -86
- package/lib/server/debugController.js +97 -124
- package/lib/server/debugger.js +82 -78
- package/lib/server/deviceDescriptors.js +37 -24
- package/lib/server/deviceDescriptorsSource.json +50 -50
- package/lib/server/dialog.js +36 -35
- package/lib/server/dispatchers/androidDispatcher.js +196 -107
- package/lib/server/dispatchers/artifactDispatcher.js +62 -62
- package/lib/server/dispatchers/browserContextDispatcher.js +176 -205
- package/lib/server/dispatchers/browserDispatcher.js +78 -97
- package/lib/server/dispatchers/browserTypeDispatcher.js +35 -35
- package/lib/server/dispatchers/cdpSessionDispatcher.js +32 -36
- package/lib/server/dispatchers/debugControllerDispatcher.js +48 -66
- package/lib/server/dispatchers/dialogDispatcher.js +30 -27
- package/lib/server/dispatchers/dispatcher.js +169 -220
- package/lib/server/dispatchers/electronDispatcher.js +54 -57
- package/lib/server/dispatchers/elementHandlerDispatcher.js +77 -119
- package/lib/server/dispatchers/frameDispatcher.js +99 -163
- package/lib/server/dispatchers/jsHandleDispatcher.js +49 -66
- package/lib/server/dispatchers/jsonPipeDispatcher.js +35 -36
- package/lib/server/dispatchers/localUtilsDispatcher.js +95 -80
- package/lib/server/dispatchers/networkDispatchers.js +90 -107
- package/lib/server/dispatchers/pageDispatcher.js +128 -169
- package/lib/server/dispatchers/playwrightDispatcher.js +69 -76
- package/lib/server/dispatchers/selectorsDispatcher.js +28 -24
- package/lib/server/dispatchers/streamDispatcher.js +42 -45
- package/lib/server/dispatchers/tracingDispatcher.js +36 -41
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +96 -131
- package/lib/server/dispatchers/writableStreamDispatcher.js +54 -38
- package/lib/server/dom.js +413 -443
- package/lib/server/download.js +45 -35
- package/lib/server/electron/electron.js +156 -176
- package/lib/server/electron/loader.js +8 -36
- package/lib/server/errors.js +47 -46
- package/lib/server/fetch.js +289 -323
- package/lib/server/fileChooser.js +25 -24
- package/lib/server/fileUploadUtils.js +65 -59
- package/lib/server/firefox/ffAccessibility.js +153 -131
- package/lib/server/firefox/ffBrowser.js +213 -277
- package/lib/server/firefox/ffConnection.js +63 -84
- package/lib/server/firefox/ffExecutionContext.js +91 -73
- package/lib/server/firefox/ffInput.js +67 -69
- package/lib/server/firefox/ffNetworkManager.js +131 -110
- package/lib/server/firefox/ffPage.js +236 -273
- package/lib/server/firefox/firefox.js +76 -67
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/formData.js +107 -35
- package/lib/server/frameSelectors.js +77 -111
- package/lib/server/frames.js +730 -894
- package/lib/server/har/harRecorder.js +85 -77
- package/lib/server/har/harTracer.js +287 -222
- package/lib/server/harBackend.js +80 -80
- package/lib/server/helper.js +56 -59
- package/lib/server/index.js +59 -99
- package/lib/server/input.js +134 -163
- package/lib/server/instrumentation.js +49 -44
- package/lib/server/javascript.js +143 -134
- package/lib/server/launchApp.js +92 -73
- package/lib/server/localUtils.js +130 -122
- package/lib/server/macEditingCommands.js +141 -137
- package/lib/server/network.js +262 -296
- package/lib/server/page.js +329 -426
- package/lib/server/pageBinding.js +88 -0
- package/lib/server/pipeTransport.js +49 -45
- package/lib/server/playwright.js +60 -67
- package/lib/server/progress.js +56 -51
- package/lib/server/protocolError.js +34 -31
- package/lib/server/recorder/chat.js +70 -86
- package/lib/server/recorder/contextRecorder.js +134 -138
- package/lib/server/recorder/recorderApp.js +127 -136
- package/lib/server/recorder/recorderCollection.js +56 -44
- package/lib/server/recorder/recorderFrontend.js +15 -4
- package/lib/server/recorder/recorderRunner.js +79 -103
- package/lib/server/recorder/recorderUtils.js +56 -45
- package/lib/server/recorder/throttledFile.js +42 -30
- package/lib/server/recorder.js +177 -186
- package/lib/server/registry/browserFetcher.js +106 -101
- package/lib/server/registry/dependencies.js +245 -196
- package/lib/server/registry/index.js +904 -792
- package/lib/server/registry/nativeDeps.js +1073 -464
- package/lib/server/registry/oopDownloadBrowserMain.js +57 -75
- package/lib/server/screenshotter.js +166 -182
- package/lib/server/selectors.js +85 -46
- package/lib/server/socksClientCertificatesInterceptor.js +166 -185
- package/lib/server/socksInterceptor.js +62 -70
- package/lib/server/storageScript.js +94 -100
- package/lib/server/timeoutSettings.js +58 -43
- package/lib/server/trace/recorder/snapshotter.js +70 -89
- package/lib/server/trace/recorder/snapshotterInjected.js +238 -217
- package/lib/server/trace/recorder/tracing.js +321 -333
- package/lib/server/trace/test/inMemorySnapshotter.js +46 -52
- package/lib/server/trace/viewer/traceViewer.js +168 -146
- package/lib/server/transport.js +124 -133
- package/lib/server/types.js +26 -22
- package/lib/server/usKeyboardLayout.js +135 -545
- package/lib/server/utils/ascii.js +39 -26
- package/lib/server/utils/comparators.js +105 -103
- package/lib/server/utils/crypto.js +157 -112
- package/lib/server/utils/debug.js +37 -28
- package/lib/server/utils/debugLogger.js +69 -48
- package/lib/server/utils/env.js +52 -37
- package/lib/server/utils/eventsHelper.js +29 -28
- package/lib/server/utils/expectUtils.js +31 -26
- package/lib/server/utils/fileUtils.js +123 -136
- package/lib/server/utils/happyEyeballs.js +138 -123
- package/lib/server/utils/hostPlatform.js +84 -120
- package/lib/server/utils/httpServer.js +106 -121
- package/lib/server/utils/image_tools/colorUtils.js +42 -51
- package/lib/server/utils/image_tools/compare.js +44 -43
- package/lib/server/utils/image_tools/imageChannel.js +38 -30
- package/lib/server/utils/image_tools/stats.js +40 -40
- package/lib/server/utils/linuxUtils.js +50 -37
- package/lib/server/utils/network.js +143 -86
- package/lib/server/utils/nodePlatform.js +87 -79
- package/lib/server/utils/pipeTransport.js +44 -42
- package/lib/server/utils/processLauncher.js +111 -121
- package/lib/server/utils/profiler.js +52 -39
- package/lib/server/utils/socksProxy.js +280 -339
- package/lib/server/utils/spawnAsync.js +37 -41
- package/lib/server/utils/task.js +31 -38
- package/lib/server/utils/userAgent.js +73 -66
- package/lib/server/utils/wsServer.js +73 -69
- package/lib/server/utils/zipFile.js +36 -37
- package/lib/server/utils/zones.js +37 -34
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/server/webkit/webkit.js +76 -63
- package/lib/server/webkit/wkAccessibility.js +161 -118
- package/lib/server/webkit/wkBrowser.js +159 -176
- package/lib/server/webkit/wkConnection.js +59 -83
- package/lib/server/webkit/wkExecutionContext.js +84 -70
- package/lib/server/webkit/wkInput.js +82 -80
- package/lib/server/webkit/wkInterceptableRequest.js +102 -95
- package/lib/server/webkit/wkPage.js +525 -619
- package/lib/server/webkit/wkProvisionalPage.js +45 -56
- package/lib/server/webkit/wkWorkers.js +77 -77
- package/lib/utils/isomorphic/ariaSnapshot.js +144 -152
- package/lib/utils/isomorphic/assert.js +28 -22
- package/lib/utils/isomorphic/builtins.js +90 -0
- package/lib/utils/isomorphic/colors.js +66 -59
- package/lib/utils/isomorphic/cssParser.js +121 -125
- package/lib/utils/isomorphic/cssTokenizer.js +436 -364
- package/lib/utils/isomorphic/headers.js +38 -37
- package/lib/utils/isomorphic/locatorGenerators.js +340 -357
- package/lib/utils/isomorphic/locatorParser.js +96 -105
- package/lib/utils/isomorphic/locatorUtils.js +63 -44
- package/lib/utils/isomorphic/manualPromise.js +47 -39
- package/lib/utils/isomorphic/mimeType.js +448 -25
- package/lib/utils/isomorphic/multimap.js +35 -27
- package/lib/utils/isomorphic/rtti.js +35 -33
- package/lib/utils/isomorphic/selectorParser.js +183 -193
- package/lib/utils/isomorphic/semaphore.js +27 -24
- package/lib/utils/isomorphic/stackTrace.js +87 -98
- package/lib/utils/isomorphic/stringUtils.js +113 -106
- package/lib/utils/isomorphic/time.js +41 -22
- package/lib/utils/isomorphic/timeoutRunner.js +55 -54
- package/lib/utils/isomorphic/traceUtils.js +38 -41
- package/lib/utils/isomorphic/types.js +15 -4
- package/lib/utils/isomorphic/urlMatch.js +112 -67
- package/lib/utils/isomorphic/utilityScriptSerializers.js +248 -0
- package/lib/utils.js +97 -443
- package/lib/utilsBundle.js +101 -52
- package/lib/vite/htmlReport/index.html +21 -15
- package/lib/vite/recorder/assets/{codeMirrorModule-B9YMkrwa.js → codeMirrorModule-DVQi6prl.js} +1 -1
- package/lib/vite/recorder/assets/index-97EUAAbk.js +184 -0
- package/lib/vite/recorder/index.html +1 -1
- package/lib/vite/traceViewer/assets/{codeMirrorModule-1DiydmYA.js → codeMirrorModule-dvXVzLxY.js} +1 -1
- package/lib/vite/traceViewer/assets/defaultSettingsView-BjymbO6M.js +265 -0
- package/lib/vite/traceViewer/{defaultSettingsView.5fN5lw10.css → defaultSettingsView.QdHITyLI.css} +1 -1
- package/lib/vite/traceViewer/index.ChIUCJnj.js +2 -0
- package/lib/vite/traceViewer/index.html +3 -3
- package/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/lib/vite/traceViewer/uiMode.html +3 -3
- package/lib/vite/traceViewer/uiMode.jUCiCtdp.js +5 -0
- package/lib/zipBundle.js +32 -23
- package/package.json +1 -1
- package/types/protocol.d.ts +436 -17
- package/types/types.d.ts +35 -16
- package/lib/server/isomorphic/utilityScriptSerializers.js +0 -229
- package/lib/vite/recorder/assets/index-ELPgmkwA.js +0 -184
- package/lib/vite/traceViewer/assets/defaultSettingsView-l0TyP_G8.js +0 -259
- package/lib/vite/traceViewer/index.BqUZLSro.js +0 -2
- package/lib/vite/traceViewer/uiMode.C1d2m5sF.js +0 -5
package/lib/client/locator.js
CHANGED
|
@@ -1,73 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var locator_exports = {};
|
|
20
|
+
__export(locator_exports, {
|
|
21
|
+
FrameLocator: () => FrameLocator,
|
|
22
|
+
Locator: () => Locator,
|
|
23
|
+
setTestIdAttribute: () => setTestIdAttribute,
|
|
24
|
+
testIdAttributeName: () => testIdAttributeName
|
|
5
25
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var _time = require("../utils/isomorphic/time");
|
|
16
|
-
// undetected-undetected_playwright-patch - custom imports
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) Microsoft Corporation.
|
|
20
|
-
*
|
|
21
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
-
* you may not use this file except in compliance with the License.
|
|
23
|
-
* You may obtain a copy of the License at
|
|
24
|
-
*
|
|
25
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
-
*
|
|
27
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
-
* See the License for the specific language governing permissions and
|
|
31
|
-
* limitations under the License.
|
|
32
|
-
*/
|
|
33
|
-
|
|
26
|
+
module.exports = __toCommonJS(locator_exports);
|
|
27
|
+
var import_jsHandle = require("./jsHandle");
|
|
28
|
+
var import_elementHandle = require("./elementHandle");
|
|
29
|
+
var import_jsHandle2 = require("./jsHandle");
|
|
30
|
+
var import_locatorGenerators = require("../utils/isomorphic/locatorGenerators");
|
|
31
|
+
var import_locatorUtils = require("../utils/isomorphic/locatorUtils");
|
|
32
|
+
var import_stringUtils = require("../utils/isomorphic/stringUtils");
|
|
33
|
+
var import_rtti = require("../utils/isomorphic/rtti");
|
|
34
|
+
var import_time = require("../utils/isomorphic/time");
|
|
34
35
|
class Locator {
|
|
35
36
|
constructor(frame, selector, options) {
|
|
36
|
-
this._frame = void 0;
|
|
37
|
-
this._selector = void 0;
|
|
38
37
|
this._frame = frame;
|
|
39
38
|
this._selector = selector;
|
|
40
|
-
if (options
|
|
41
|
-
|
|
42
|
-
if (options
|
|
39
|
+
if (options?.hasText)
|
|
40
|
+
this._selector += ` >> internal:has-text=${(0, import_stringUtils.escapeForTextSelector)(options.hasText, false)}`;
|
|
41
|
+
if (options?.hasNotText)
|
|
42
|
+
this._selector += ` >> internal:has-not-text=${(0, import_stringUtils.escapeForTextSelector)(options.hasNotText, false)}`;
|
|
43
|
+
if (options?.has) {
|
|
43
44
|
const locator = options.has;
|
|
44
|
-
if (locator._frame !== frame)
|
|
45
|
+
if (locator._frame !== frame)
|
|
46
|
+
throw new Error(`Inner "has" locator must belong to the same frame.`);
|
|
45
47
|
this._selector += ` >> internal:has=` + JSON.stringify(locator._selector);
|
|
46
48
|
}
|
|
47
|
-
if (options
|
|
49
|
+
if (options?.hasNot) {
|
|
48
50
|
const locator = options.hasNot;
|
|
49
|
-
if (locator._frame !== frame)
|
|
51
|
+
if (locator._frame !== frame)
|
|
52
|
+
throw new Error(`Inner "hasNot" locator must belong to the same frame.`);
|
|
50
53
|
this._selector += ` >> internal:has-not=` + JSON.stringify(locator._selector);
|
|
51
54
|
}
|
|
52
|
-
if (
|
|
53
|
-
|
|
55
|
+
if (options?.visible !== void 0)
|
|
56
|
+
this._selector += ` >> visible=${options.visible ? "true" : "false"}`;
|
|
57
|
+
if (this._frame._platform.inspectCustom)
|
|
58
|
+
this[this._frame._platform.inspectCustom] = () => this._inspect();
|
|
54
59
|
}
|
|
55
60
|
async _withElement(task, timeout) {
|
|
56
|
-
timeout = this._frame.page()._timeoutSettings.timeout({
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
const deadline = timeout ? (0, _time.monotonicTime)() + timeout : 0;
|
|
61
|
+
timeout = this._frame.page()._timeoutSettings.timeout({ timeout });
|
|
62
|
+
const deadline = timeout ? (0, import_time.monotonicTime)() + timeout : 0;
|
|
60
63
|
return await this._frame._wrapApiCall(async () => {
|
|
61
|
-
const result = await this._frame._channel.waitForSelector({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
timeout
|
|
66
|
-
});
|
|
67
|
-
const handle = _elementHandle.ElementHandle.fromNullable(result.element);
|
|
68
|
-
if (!handle) throw new Error(`Could not resolve ${this._selector} to DOM Element`);
|
|
64
|
+
const result = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: "attached", timeout });
|
|
65
|
+
const handle = import_elementHandle.ElementHandle.fromNullable(result.element);
|
|
66
|
+
if (!handle)
|
|
67
|
+
throw new Error(`Could not resolve ${this._selector} to DOM Element`);
|
|
69
68
|
try {
|
|
70
|
-
return await task(handle, deadline ? deadline - (0,
|
|
69
|
+
return await task(handle, deadline ? deadline - (0, import_time.monotonicTime)() : 0);
|
|
71
70
|
} finally {
|
|
72
71
|
await handle.dispose();
|
|
73
72
|
}
|
|
@@ -80,31 +79,19 @@ class Locator {
|
|
|
80
79
|
return this._frame.page();
|
|
81
80
|
}
|
|
82
81
|
async boundingBox(options) {
|
|
83
|
-
return await this._withElement(h => h.boundingBox(), options
|
|
82
|
+
return await this._withElement((h) => h.boundingBox(), options?.timeout);
|
|
84
83
|
}
|
|
85
84
|
async check(options = {}) {
|
|
86
|
-
return await this._frame.check(this._selector, {
|
|
87
|
-
strict: true,
|
|
88
|
-
...options
|
|
89
|
-
});
|
|
85
|
+
return await this._frame.check(this._selector, { strict: true, ...options });
|
|
90
86
|
}
|
|
91
87
|
async click(options = {}) {
|
|
92
|
-
return await this._frame.click(this._selector, {
|
|
93
|
-
strict: true,
|
|
94
|
-
...options
|
|
95
|
-
});
|
|
88
|
+
return await this._frame.click(this._selector, { strict: true, ...options });
|
|
96
89
|
}
|
|
97
90
|
async dblclick(options = {}) {
|
|
98
|
-
return await this._frame.dblclick(this._selector, {
|
|
99
|
-
strict: true,
|
|
100
|
-
...options
|
|
101
|
-
});
|
|
91
|
+
return await this._frame.dblclick(this._selector, { strict: true, ...options });
|
|
102
92
|
}
|
|
103
93
|
async dispatchEvent(type, eventInit = {}, options) {
|
|
104
|
-
return await this._frame.dispatchEvent(this._selector, type, eventInit, {
|
|
105
|
-
strict: true,
|
|
106
|
-
...options
|
|
107
|
-
});
|
|
94
|
+
return await this._frame.dispatchEvent(this._selector, type, eventInit, { strict: true, ...options });
|
|
108
95
|
}
|
|
109
96
|
async dragTo(target, options = {}) {
|
|
110
97
|
return await this._frame.dragAndDrop(this._selector, target._selector, {
|
|
@@ -113,78 +100,82 @@ class Locator {
|
|
|
113
100
|
});
|
|
114
101
|
}
|
|
115
102
|
async evaluate(pageFunction, arg, options, isolatedContext = true) {
|
|
116
|
-
return await this._withElement(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
return await this._withElement(
|
|
104
|
+
async (h) => (0, import_jsHandle2.parseResult)(
|
|
105
|
+
(await h._channel.evaluateExpression({
|
|
106
|
+
expression: String(pageFunction),
|
|
107
|
+
isFunction: typeof pageFunction === "function",
|
|
108
|
+
arg: (0, import_jsHandle2.serializeArgument)(arg),
|
|
109
|
+
isolatedContext
|
|
110
|
+
})).value
|
|
111
|
+
),
|
|
112
|
+
options?.timeout
|
|
113
|
+
);
|
|
122
114
|
}
|
|
123
115
|
async evaluateAll(pageFunction, arg) {
|
|
124
116
|
return await this._frame.$$eval(this._selector, pageFunction, arg);
|
|
125
117
|
}
|
|
126
118
|
async evaluateHandle(pageFunction, arg, options, isolatedContext = true) {
|
|
127
|
-
return await this._withElement(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
return await this._withElement(
|
|
120
|
+
async (h) => import_jsHandle.JSHandle.from(
|
|
121
|
+
(await h._channel.evaluateExpressionHandle({
|
|
122
|
+
expression: String(pageFunction),
|
|
123
|
+
isFunction: typeof pageFunction === "function",
|
|
124
|
+
arg: (0, import_jsHandle2.serializeArgument)(arg),
|
|
125
|
+
isolatedContext
|
|
126
|
+
})).handle
|
|
127
|
+
),
|
|
128
|
+
options?.timeout
|
|
129
|
+
);
|
|
133
130
|
}
|
|
134
131
|
async fill(value, options = {}) {
|
|
135
|
-
return await this._frame.fill(this._selector, value, {
|
|
136
|
-
strict: true,
|
|
137
|
-
...options
|
|
138
|
-
});
|
|
132
|
+
return await this._frame.fill(this._selector, value, { strict: true, ...options });
|
|
139
133
|
}
|
|
140
134
|
async clear(options = {}) {
|
|
141
|
-
return await this.fill(
|
|
135
|
+
return await this.fill("", options);
|
|
142
136
|
}
|
|
143
137
|
async _highlight() {
|
|
144
|
-
// VS Code extension uses this one, keep it for now.
|
|
145
138
|
return await this._frame._highlight(this._selector);
|
|
146
139
|
}
|
|
147
140
|
async highlight() {
|
|
148
141
|
return await this._frame._highlight(this._selector);
|
|
149
142
|
}
|
|
150
143
|
locator(selectorOrLocator, options) {
|
|
151
|
-
if ((0,
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
if ((0, import_rtti.isString)(selectorOrLocator))
|
|
145
|
+
return new Locator(this._frame, this._selector + " >> " + selectorOrLocator, options);
|
|
146
|
+
if (selectorOrLocator._frame !== this._frame)
|
|
147
|
+
throw new Error(`Locators must belong to the same frame.`);
|
|
148
|
+
return new Locator(this._frame, this._selector + " >> internal:chain=" + JSON.stringify(selectorOrLocator._selector), options);
|
|
154
149
|
}
|
|
155
150
|
getByTestId(testId) {
|
|
156
|
-
return this.locator((0,
|
|
151
|
+
return this.locator((0, import_locatorUtils.getByTestIdSelector)(testIdAttributeName(), testId));
|
|
157
152
|
}
|
|
158
153
|
getByAltText(text, options) {
|
|
159
|
-
return this.locator((0,
|
|
154
|
+
return this.locator((0, import_locatorUtils.getByAltTextSelector)(text, options));
|
|
160
155
|
}
|
|
161
156
|
getByLabel(text, options) {
|
|
162
|
-
return this.locator((0,
|
|
157
|
+
return this.locator((0, import_locatorUtils.getByLabelSelector)(text, options));
|
|
163
158
|
}
|
|
164
159
|
getByPlaceholder(text, options) {
|
|
165
|
-
return this.locator((0,
|
|
160
|
+
return this.locator((0, import_locatorUtils.getByPlaceholderSelector)(text, options));
|
|
166
161
|
}
|
|
167
162
|
getByText(text, options) {
|
|
168
|
-
return this.locator((0,
|
|
163
|
+
return this.locator((0, import_locatorUtils.getByTextSelector)(text, options));
|
|
169
164
|
}
|
|
170
165
|
getByTitle(text, options) {
|
|
171
|
-
return this.locator((0,
|
|
166
|
+
return this.locator((0, import_locatorUtils.getByTitleSelector)(text, options));
|
|
172
167
|
}
|
|
173
168
|
getByRole(role, options = {}) {
|
|
174
|
-
return this.locator((0,
|
|
169
|
+
return this.locator((0, import_locatorUtils.getByRoleSelector)(role, options));
|
|
175
170
|
}
|
|
176
171
|
frameLocator(selector) {
|
|
177
|
-
return new FrameLocator(this._frame, this._selector +
|
|
172
|
+
return new FrameLocator(this._frame, this._selector + " >> " + selector);
|
|
178
173
|
}
|
|
179
174
|
filter(options) {
|
|
180
175
|
return new Locator(this._frame, this._selector, options);
|
|
181
176
|
}
|
|
182
177
|
async elementHandle(options) {
|
|
183
|
-
return await this._frame.waitForSelector(this._selector, {
|
|
184
|
-
strict: true,
|
|
185
|
-
state: 'attached',
|
|
186
|
-
...options
|
|
187
|
-
});
|
|
178
|
+
return await this._frame.waitForSelector(this._selector, { strict: true, state: "attached", ...options });
|
|
188
179
|
}
|
|
189
180
|
async elementHandles() {
|
|
190
181
|
return await this._frame.$$(this._selector);
|
|
@@ -193,7 +184,7 @@ class Locator {
|
|
|
193
184
|
return new FrameLocator(this._frame, this._selector);
|
|
194
185
|
}
|
|
195
186
|
first() {
|
|
196
|
-
return new Locator(this._frame, this._selector +
|
|
187
|
+
return new Locator(this._frame, this._selector + " >> nth=0");
|
|
197
188
|
}
|
|
198
189
|
last() {
|
|
199
190
|
return new Locator(this._frame, this._selector + ` >> nth=-1`);
|
|
@@ -202,253 +193,172 @@ class Locator {
|
|
|
202
193
|
return new Locator(this._frame, this._selector + ` >> nth=${index}`);
|
|
203
194
|
}
|
|
204
195
|
and(locator) {
|
|
205
|
-
if (locator._frame !== this._frame)
|
|
196
|
+
if (locator._frame !== this._frame)
|
|
197
|
+
throw new Error(`Locators must belong to the same frame.`);
|
|
206
198
|
return new Locator(this._frame, this._selector + ` >> internal:and=` + JSON.stringify(locator._selector));
|
|
207
199
|
}
|
|
208
200
|
or(locator) {
|
|
209
|
-
if (locator._frame !== this._frame)
|
|
201
|
+
if (locator._frame !== this._frame)
|
|
202
|
+
throw new Error(`Locators must belong to the same frame.`);
|
|
210
203
|
return new Locator(this._frame, this._selector + ` >> internal:or=` + JSON.stringify(locator._selector));
|
|
211
204
|
}
|
|
212
205
|
async focus(options) {
|
|
213
|
-
return await this._frame.focus(this._selector, {
|
|
214
|
-
strict: true,
|
|
215
|
-
...options
|
|
216
|
-
});
|
|
206
|
+
return await this._frame.focus(this._selector, { strict: true, ...options });
|
|
217
207
|
}
|
|
218
208
|
async blur(options) {
|
|
219
|
-
await this._frame._channel.blur({
|
|
220
|
-
selector: this._selector,
|
|
221
|
-
strict: true,
|
|
222
|
-
...options
|
|
223
|
-
});
|
|
209
|
+
await this._frame._channel.blur({ selector: this._selector, strict: true, ...options });
|
|
224
210
|
}
|
|
225
211
|
async count() {
|
|
226
212
|
return await this._frame._queryCount(this._selector);
|
|
227
213
|
}
|
|
228
214
|
async _generateLocatorString() {
|
|
229
|
-
return await this._withElement(h => h._generateLocatorString());
|
|
215
|
+
return await this._withElement((h) => h._generateLocatorString());
|
|
230
216
|
}
|
|
231
217
|
async getAttribute(name, options) {
|
|
232
|
-
return await this._frame.getAttribute(this._selector, name, {
|
|
233
|
-
strict: true,
|
|
234
|
-
...options
|
|
235
|
-
});
|
|
218
|
+
return await this._frame.getAttribute(this._selector, name, { strict: true, ...options });
|
|
236
219
|
}
|
|
237
220
|
async hover(options = {}) {
|
|
238
|
-
return await this._frame.hover(this._selector, {
|
|
239
|
-
strict: true,
|
|
240
|
-
...options
|
|
241
|
-
});
|
|
221
|
+
return await this._frame.hover(this._selector, { strict: true, ...options });
|
|
242
222
|
}
|
|
243
223
|
async innerHTML(options) {
|
|
244
|
-
return await this._frame.innerHTML(this._selector, {
|
|
245
|
-
strict: true,
|
|
246
|
-
...options
|
|
247
|
-
});
|
|
224
|
+
return await this._frame.innerHTML(this._selector, { strict: true, ...options });
|
|
248
225
|
}
|
|
249
226
|
async innerText(options) {
|
|
250
|
-
return await this._frame.innerText(this._selector, {
|
|
251
|
-
strict: true,
|
|
252
|
-
...options
|
|
253
|
-
});
|
|
227
|
+
return await this._frame.innerText(this._selector, { strict: true, ...options });
|
|
254
228
|
}
|
|
255
229
|
async inputValue(options) {
|
|
256
|
-
return await this._frame.inputValue(this._selector, {
|
|
257
|
-
strict: true,
|
|
258
|
-
...options
|
|
259
|
-
});
|
|
230
|
+
return await this._frame.inputValue(this._selector, { strict: true, ...options });
|
|
260
231
|
}
|
|
261
232
|
async isChecked(options) {
|
|
262
|
-
return await this._frame.isChecked(this._selector, {
|
|
263
|
-
strict: true,
|
|
264
|
-
...options
|
|
265
|
-
});
|
|
233
|
+
return await this._frame.isChecked(this._selector, { strict: true, ...options });
|
|
266
234
|
}
|
|
267
235
|
async isDisabled(options) {
|
|
268
|
-
return await this._frame.isDisabled(this._selector, {
|
|
269
|
-
strict: true,
|
|
270
|
-
...options
|
|
271
|
-
});
|
|
236
|
+
return await this._frame.isDisabled(this._selector, { strict: true, ...options });
|
|
272
237
|
}
|
|
273
238
|
async isEditable(options) {
|
|
274
|
-
return await this._frame.isEditable(this._selector, {
|
|
275
|
-
strict: true,
|
|
276
|
-
...options
|
|
277
|
-
});
|
|
239
|
+
return await this._frame.isEditable(this._selector, { strict: true, ...options });
|
|
278
240
|
}
|
|
279
241
|
async isEnabled(options) {
|
|
280
|
-
return await this._frame.isEnabled(this._selector, {
|
|
281
|
-
strict: true,
|
|
282
|
-
...options
|
|
283
|
-
});
|
|
242
|
+
return await this._frame.isEnabled(this._selector, { strict: true, ...options });
|
|
284
243
|
}
|
|
285
244
|
async isHidden(options) {
|
|
286
|
-
return await this._frame.isHidden(this._selector, {
|
|
287
|
-
strict: true,
|
|
288
|
-
...options
|
|
289
|
-
});
|
|
245
|
+
return await this._frame.isHidden(this._selector, { strict: true, ...options });
|
|
290
246
|
}
|
|
291
247
|
async isVisible(options) {
|
|
292
|
-
return await this._frame.isVisible(this._selector, {
|
|
293
|
-
strict: true,
|
|
294
|
-
...options
|
|
295
|
-
});
|
|
248
|
+
return await this._frame.isVisible(this._selector, { strict: true, ...options });
|
|
296
249
|
}
|
|
297
250
|
async press(key, options = {}) {
|
|
298
|
-
return await this._frame.press(this._selector, key, {
|
|
299
|
-
strict: true,
|
|
300
|
-
...options
|
|
301
|
-
});
|
|
251
|
+
return await this._frame.press(this._selector, key, { strict: true, ...options });
|
|
302
252
|
}
|
|
303
253
|
async screenshot(options = {}) {
|
|
304
254
|
const mask = options.mask;
|
|
305
|
-
return await this._withElement((h, timeout) => h.screenshot({
|
|
306
|
-
...options,
|
|
307
|
-
mask,
|
|
308
|
-
timeout
|
|
309
|
-
}), options.timeout);
|
|
255
|
+
return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), options.timeout);
|
|
310
256
|
}
|
|
311
257
|
async ariaSnapshot(options) {
|
|
312
|
-
const result = await this._frame._channel.ariaSnapshot({
|
|
313
|
-
...options,
|
|
314
|
-
id: options === null || options === void 0 ? void 0 : options._id,
|
|
315
|
-
mode: options === null || options === void 0 ? void 0 : options._mode,
|
|
316
|
-
selector: this._selector
|
|
317
|
-
});
|
|
258
|
+
const result = await this._frame._channel.ariaSnapshot({ ...options, mode: options?._mode, selector: this._selector });
|
|
318
259
|
return result.snapshot;
|
|
319
260
|
}
|
|
320
261
|
async scrollIntoViewIfNeeded(options = {}) {
|
|
321
|
-
return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({
|
|
322
|
-
...options,
|
|
323
|
-
timeout
|
|
324
|
-
}), options.timeout);
|
|
262
|
+
return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), options.timeout);
|
|
325
263
|
}
|
|
326
264
|
async selectOption(values, options = {}) {
|
|
327
|
-
return await this._frame.selectOption(this._selector, values, {
|
|
328
|
-
strict: true,
|
|
329
|
-
...options
|
|
330
|
-
});
|
|
265
|
+
return await this._frame.selectOption(this._selector, values, { strict: true, ...options });
|
|
331
266
|
}
|
|
332
267
|
async selectText(options = {}) {
|
|
333
|
-
return await this._withElement((h, timeout) => h.selectText({
|
|
334
|
-
...options,
|
|
335
|
-
timeout
|
|
336
|
-
}), options.timeout);
|
|
268
|
+
return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), options.timeout);
|
|
337
269
|
}
|
|
338
270
|
async setChecked(checked, options) {
|
|
339
|
-
if (checked)
|
|
271
|
+
if (checked)
|
|
272
|
+
await this.check(options);
|
|
273
|
+
else
|
|
274
|
+
await this.uncheck(options);
|
|
340
275
|
}
|
|
341
276
|
async setInputFiles(files, options = {}) {
|
|
342
|
-
return await this._frame.setInputFiles(this._selector, files, {
|
|
343
|
-
strict: true,
|
|
344
|
-
...options
|
|
345
|
-
});
|
|
277
|
+
return await this._frame.setInputFiles(this._selector, files, { strict: true, ...options });
|
|
346
278
|
}
|
|
347
279
|
async tap(options = {}) {
|
|
348
|
-
return await this._frame.tap(this._selector, {
|
|
349
|
-
strict: true,
|
|
350
|
-
...options
|
|
351
|
-
});
|
|
280
|
+
return await this._frame.tap(this._selector, { strict: true, ...options });
|
|
352
281
|
}
|
|
353
282
|
async textContent(options) {
|
|
354
|
-
return await this._frame.textContent(this._selector, {
|
|
355
|
-
strict: true,
|
|
356
|
-
...options
|
|
357
|
-
});
|
|
283
|
+
return await this._frame.textContent(this._selector, { strict: true, ...options });
|
|
358
284
|
}
|
|
359
285
|
async type(text, options = {}) {
|
|
360
|
-
return await this._frame.type(this._selector, text, {
|
|
361
|
-
strict: true,
|
|
362
|
-
...options
|
|
363
|
-
});
|
|
286
|
+
return await this._frame.type(this._selector, text, { strict: true, ...options });
|
|
364
287
|
}
|
|
365
288
|
async pressSequentially(text, options = {}) {
|
|
366
289
|
return await this.type(text, options);
|
|
367
290
|
}
|
|
368
291
|
async uncheck(options = {}) {
|
|
369
|
-
return await this._frame.uncheck(this._selector, {
|
|
370
|
-
strict: true,
|
|
371
|
-
...options
|
|
372
|
-
});
|
|
292
|
+
return await this._frame.uncheck(this._selector, { strict: true, ...options });
|
|
373
293
|
}
|
|
374
294
|
async all() {
|
|
375
295
|
return new Array(await this.count()).fill(0).map((e, i) => this.nth(i));
|
|
376
296
|
}
|
|
377
297
|
async allInnerTexts() {
|
|
378
|
-
return await this._frame.$$eval(this._selector, ee => ee.map(e => e.innerText));
|
|
298
|
+
return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.innerText));
|
|
379
299
|
}
|
|
380
300
|
async allTextContents() {
|
|
381
|
-
return await this._frame.$$eval(this._selector, ee => ee.map(e => e.textContent ||
|
|
301
|
+
return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.textContent || ""));
|
|
382
302
|
}
|
|
383
303
|
async waitFor(options) {
|
|
384
|
-
await this._frame._channel.waitForSelector({
|
|
385
|
-
selector: this._selector,
|
|
386
|
-
strict: true,
|
|
387
|
-
omitReturnValue: true,
|
|
388
|
-
...options
|
|
389
|
-
});
|
|
304
|
+
await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options });
|
|
390
305
|
}
|
|
391
306
|
async _expect(expression, options) {
|
|
392
|
-
const params = {
|
|
393
|
-
|
|
394
|
-
expression,
|
|
395
|
-
...options,
|
|
396
|
-
isNot: !!options.isNot
|
|
397
|
-
};
|
|
398
|
-
params.expectedValue = (0, _jsHandle.serializeArgument)(options.expectedValue);
|
|
307
|
+
const params = { selector: this._selector, expression, ...options, isNot: !!options.isNot };
|
|
308
|
+
params.expectedValue = (0, import_jsHandle2.serializeArgument)(options.expectedValue);
|
|
399
309
|
const result = await this._frame._channel.expect(params);
|
|
400
|
-
if (result.received !==
|
|
310
|
+
if (result.received !== void 0)
|
|
311
|
+
result.received = (0, import_jsHandle2.parseResult)(result.received);
|
|
401
312
|
return result;
|
|
402
313
|
}
|
|
403
314
|
_inspect() {
|
|
404
315
|
return this.toString();
|
|
405
316
|
}
|
|
406
317
|
toString() {
|
|
407
|
-
return (0,
|
|
318
|
+
return (0, import_locatorGenerators.asLocator)("javascript", this._selector);
|
|
408
319
|
}
|
|
409
320
|
}
|
|
410
|
-
exports.Locator = Locator;
|
|
411
321
|
class FrameLocator {
|
|
412
322
|
constructor(frame, selector) {
|
|
413
|
-
this._frame = void 0;
|
|
414
|
-
this._frameSelector = void 0;
|
|
415
323
|
this._frame = frame;
|
|
416
324
|
this._frameSelector = selector;
|
|
417
325
|
}
|
|
418
326
|
locator(selectorOrLocator, options) {
|
|
419
|
-
if ((0,
|
|
420
|
-
|
|
421
|
-
|
|
327
|
+
if ((0, import_rtti.isString)(selectorOrLocator))
|
|
328
|
+
return new Locator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selectorOrLocator, options);
|
|
329
|
+
if (selectorOrLocator._frame !== this._frame)
|
|
330
|
+
throw new Error(`Locators must belong to the same frame.`);
|
|
331
|
+
return new Locator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selectorOrLocator._selector, options);
|
|
422
332
|
}
|
|
423
333
|
getByTestId(testId) {
|
|
424
|
-
return this.locator((0,
|
|
334
|
+
return this.locator((0, import_locatorUtils.getByTestIdSelector)(testIdAttributeName(), testId));
|
|
425
335
|
}
|
|
426
336
|
getByAltText(text, options) {
|
|
427
|
-
return this.locator((0,
|
|
337
|
+
return this.locator((0, import_locatorUtils.getByAltTextSelector)(text, options));
|
|
428
338
|
}
|
|
429
339
|
getByLabel(text, options) {
|
|
430
|
-
return this.locator((0,
|
|
340
|
+
return this.locator((0, import_locatorUtils.getByLabelSelector)(text, options));
|
|
431
341
|
}
|
|
432
342
|
getByPlaceholder(text, options) {
|
|
433
|
-
return this.locator((0,
|
|
343
|
+
return this.locator((0, import_locatorUtils.getByPlaceholderSelector)(text, options));
|
|
434
344
|
}
|
|
435
345
|
getByText(text, options) {
|
|
436
|
-
return this.locator((0,
|
|
346
|
+
return this.locator((0, import_locatorUtils.getByTextSelector)(text, options));
|
|
437
347
|
}
|
|
438
348
|
getByTitle(text, options) {
|
|
439
|
-
return this.locator((0,
|
|
349
|
+
return this.locator((0, import_locatorUtils.getByTitleSelector)(text, options));
|
|
440
350
|
}
|
|
441
351
|
getByRole(role, options = {}) {
|
|
442
|
-
return this.locator((0,
|
|
352
|
+
return this.locator((0, import_locatorUtils.getByRoleSelector)(role, options));
|
|
443
353
|
}
|
|
444
354
|
owner() {
|
|
445
355
|
return new Locator(this._frame, this._frameSelector);
|
|
446
356
|
}
|
|
447
357
|
frameLocator(selector) {
|
|
448
|
-
return new FrameLocator(this._frame, this._frameSelector +
|
|
358
|
+
return new FrameLocator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selector);
|
|
449
359
|
}
|
|
450
360
|
first() {
|
|
451
|
-
return new FrameLocator(this._frame, this._frameSelector +
|
|
361
|
+
return new FrameLocator(this._frame, this._frameSelector + " >> nth=0");
|
|
452
362
|
}
|
|
453
363
|
last() {
|
|
454
364
|
return new FrameLocator(this._frame, this._frameSelector + ` >> nth=-1`);
|
|
@@ -457,11 +367,17 @@ class FrameLocator {
|
|
|
457
367
|
return new FrameLocator(this._frame, this._frameSelector + ` >> nth=${index}`);
|
|
458
368
|
}
|
|
459
369
|
}
|
|
460
|
-
|
|
461
|
-
let _testIdAttributeName = 'data-testid';
|
|
370
|
+
let _testIdAttributeName = "data-testid";
|
|
462
371
|
function testIdAttributeName() {
|
|
463
372
|
return _testIdAttributeName;
|
|
464
373
|
}
|
|
465
374
|
function setTestIdAttribute(attributeName) {
|
|
466
375
|
_testIdAttributeName = attributeName;
|
|
467
|
-
}
|
|
376
|
+
}
|
|
377
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
378
|
+
0 && (module.exports = {
|
|
379
|
+
FrameLocator,
|
|
380
|
+
Locator,
|
|
381
|
+
setTestIdAttribute,
|
|
382
|
+
testIdAttributeName
|
|
383
|
+
});
|