├── .credo.exs ├── .envrc ├── .formatter.exs ├── .gitattributes ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .medic ├── _support │ ├── cecho.sh │ ├── check.sh │ ├── confirm.sh │ ├── doctor.sh │ ├── os.sh │ ├── spinner.sh │ └── step.sh ├── doctor.exs ├── require.exs └── update.exs ├── .tool-versions ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── bin └── dev │ ├── audit │ ├── doc │ ├── doctor │ ├── shipit │ ├── test │ └── update ├── config └── config.exs ├── lib ├── mix │ └── tasks │ │ └── playwright.install.ex ├── playwright.ex ├── playwright │ ├── android.ex │ ├── api │ │ └── errors │ │ │ └── web_error.ex │ ├── api_request.ex │ ├── api_request_context.ex │ ├── api_response.ex │ ├── application.ex │ ├── binding_call.ex │ ├── browser.ex │ ├── browser_context.ex │ ├── browser_context │ │ └── tracing.ex │ ├── browser_type.ex │ ├── cdp_session.ex │ ├── console_message.ex │ ├── dialog.ex │ ├── electron.ex │ ├── element_handle.ex │ ├── fetch_request.ex │ ├── frame.ex │ ├── js_handle.ex │ ├── local_utils.ex │ ├── locator.ex │ ├── page.ex │ ├── page │ │ ├── accessibility.ex │ │ ├── coverage.ex │ │ ├── download.ex │ │ ├── file_chooser.ex │ │ ├── frame_locator.ex │ │ ├── keyboard.ex │ │ ├── mouse.ex │ │ ├── touchscreen.ex │ │ └── video.ex │ ├── request.ex │ ├── response.ex │ ├── route.ex │ ├── sdk │ │ ├── channel.ex │ │ ├── channel │ │ │ ├── catalog.ex │ │ │ ├── connection.ex │ │ │ ├── error.ex │ │ │ ├── event.ex │ │ │ ├── message.ex │ │ │ ├── response.ex │ │ │ ├── session.ex │ │ │ └── session_id.ex │ │ ├── channel_owner.ex │ │ ├── cli.ex │ │ ├── config.ex │ │ ├── extra │ │ │ ├── atom.ex │ │ │ ├── map.ex │ │ │ └── uri.ex │ │ ├── helpers │ │ │ ├── error_handling.ex │ │ │ ├── expression.ex │ │ │ ├── route_handler.ex │ │ │ ├── serialization.ex │ │ │ └── url_matcher.ex │ │ ├── transport.ex │ │ └── transport │ │ │ ├── driver.ex │ │ │ ├── driver_message.ex │ │ │ └── websocket.ex │ ├── selectors.ex │ ├── tracing.ex │ ├── websocket.ex │ └── worker.ex └── playwright_test │ └── case.ex ├── man ├── basics │ ├── debugging-tools.md │ ├── getting-started.md │ ├── inspector.md │ ├── release-notes.md │ ├── test-generator.md │ └── trace-viewer.md └── guides │ ├── assertions.md │ ├── authentication.md │ ├── auto-waiting.md │ ├── browser-contexts.md │ ├── browsers.md │ ├── chrome-extensions.md │ ├── command-line-tools.md │ ├── dialogs.md │ ├── downloads.md │ ├── emulation.md │ ├── evaluating-javascript.md │ ├── events.md │ ├── extensibility.md │ ├── frames.md │ ├── handles.md │ ├── input.md │ ├── locators.md │ ├── navigations.md │ ├── network.md │ ├── page-object-models.md │ ├── pages.md │ ├── screenshots.md │ ├── selectors.md │ ├── verification.md │ └── videos.md ├── mix.exs ├── mix.lock ├── priv └── static │ ├── driver.js │ ├── node_modules │ ├── .bin │ │ ├── playwright │ │ └── playwright-core │ ├── .package-lock.json │ ├── fsevents │ │ ├── LICENSE │ │ ├── README.md │ │ ├── fsevents.d.ts │ │ ├── fsevents.js │ │ ├── fsevents.node │ │ └── package.json │ ├── playwright-core │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── ThirdPartyNotices.txt │ │ ├── bin │ │ │ ├── PrintDeps.exe │ │ │ ├── README.md │ │ │ ├── install_media_pack.ps1 │ │ │ ├── reinstall_chrome_beta_linux.sh │ │ │ ├── reinstall_chrome_beta_mac.sh │ │ │ ├── reinstall_chrome_beta_win.ps1 │ │ │ ├── reinstall_chrome_stable_linux.sh │ │ │ ├── reinstall_chrome_stable_mac.sh │ │ │ ├── reinstall_chrome_stable_win.ps1 │ │ │ ├── reinstall_msedge_beta_linux.sh │ │ │ ├── reinstall_msedge_beta_mac.sh │ │ │ ├── reinstall_msedge_beta_win.ps1 │ │ │ ├── reinstall_msedge_dev_linux.sh │ │ │ ├── reinstall_msedge_dev_mac.sh │ │ │ ├── reinstall_msedge_dev_win.ps1 │ │ │ ├── reinstall_msedge_stable_linux.sh │ │ │ ├── reinstall_msedge_stable_mac.sh │ │ │ └── reinstall_msedge_stable_win.ps1 │ │ ├── browsers.json │ │ ├── cli.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.mjs │ │ ├── lib │ │ │ ├── androidServerImpl.js │ │ │ ├── browserServerImpl.js │ │ │ ├── cli │ │ │ │ ├── driver.js │ │ │ │ ├── program.js │ │ │ │ └── programWithTestStub.js │ │ │ ├── client │ │ │ │ ├── accessibility.js │ │ │ │ ├── android.js │ │ │ │ ├── api.js │ │ │ │ ├── artifact.js │ │ │ │ ├── browser.js │ │ │ │ ├── browserContext.js │ │ │ │ ├── browserType.js │ │ │ │ ├── cdpSession.js │ │ │ │ ├── channelOwner.js │ │ │ │ ├── clientHelper.js │ │ │ │ ├── clientInstrumentation.js │ │ │ │ ├── clock.js │ │ │ │ ├── connection.js │ │ │ │ ├── consoleMessage.js │ │ │ │ ├── coverage.js │ │ │ │ ├── dialog.js │ │ │ │ ├── download.js │ │ │ │ ├── electron.js │ │ │ │ ├── elementHandle.js │ │ │ │ ├── errors.js │ │ │ │ ├── eventEmitter.js │ │ │ │ ├── events.js │ │ │ │ ├── fetch.js │ │ │ │ ├── fileChooser.js │ │ │ │ ├── frame.js │ │ │ │ ├── harRouter.js │ │ │ │ ├── input.js │ │ │ │ ├── jsHandle.js │ │ │ │ ├── jsonPipe.js │ │ │ │ ├── localUtils.js │ │ │ │ ├── locator.js │ │ │ │ ├── network.js │ │ │ │ ├── page.js │ │ │ │ ├── playwright.js │ │ │ │ ├── selectors.js │ │ │ │ ├── stream.js │ │ │ │ ├── tracing.js │ │ │ │ ├── types.js │ │ │ │ ├── video.js │ │ │ │ ├── waiter.js │ │ │ │ ├── webError.js │ │ │ │ ├── worker.js │ │ │ │ └── writableStream.js │ │ │ ├── common │ │ │ │ ├── socksProxy.js │ │ │ │ ├── timeoutSettings.js │ │ │ │ └── types.js │ │ │ ├── generated │ │ │ │ ├── clockSource.js │ │ │ │ ├── consoleApiSource.js │ │ │ │ ├── injectedScriptSource.js │ │ │ │ ├── pollingRecorderSource.js │ │ │ │ ├── utilityScriptSource.js │ │ │ │ └── webSocketMockSource.js │ │ │ ├── image_tools │ │ │ │ ├── colorUtils.js │ │ │ │ ├── compare.js │ │ │ │ ├── imageChannel.js │ │ │ │ └── stats.js │ │ │ ├── inProcessFactory.js │ │ │ ├── inprocess.js │ │ │ ├── outofprocess.js │ │ │ ├── protocol │ │ │ │ ├── debug.js │ │ │ │ ├── serializers.js │ │ │ │ ├── transport.js │ │ │ │ ├── validator.js │ │ │ │ └── validatorPrimitives.js │ │ │ ├── remote │ │ │ │ ├── playwrightConnection.js │ │ │ │ └── playwrightServer.js │ │ │ ├── server │ │ │ │ ├── accessibility.js │ │ │ │ ├── android │ │ │ │ │ ├── android.js │ │ │ │ │ └── backendAdb.js │ │ │ │ ├── ariaSnapshot.js │ │ │ │ ├── artifact.js │ │ │ │ ├── bidi │ │ │ │ │ ├── bidiBrowser.js │ │ │ │ │ ├── bidiChromium.js │ │ │ │ │ ├── bidiConnection.js │ │ │ │ │ ├── bidiExecutionContext.js │ │ │ │ │ ├── bidiFirefox.js │ │ │ │ │ ├── bidiInput.js │ │ │ │ │ ├── bidiNetworkManager.js │ │ │ │ │ ├── bidiOverCdp.js │ │ │ │ │ ├── bidiPage.js │ │ │ │ │ ├── bidiPdf.js │ │ │ │ │ └── third_party │ │ │ │ │ │ ├── bidiDeserializer.js │ │ │ │ │ │ ├── bidiKeyboard.js │ │ │ │ │ │ ├── bidiProtocol.js │ │ │ │ │ │ ├── bidiSerializer.js │ │ │ │ │ │ └── firefoxPrefs.js │ │ │ │ ├── browser.js │ │ │ │ ├── browserContext.js │ │ │ │ ├── browserType.js │ │ │ │ ├── chromium │ │ │ │ │ ├── appIcon.png │ │ │ │ │ ├── chromium.js │ │ │ │ │ ├── chromiumSwitches.js │ │ │ │ │ ├── crAccessibility.js │ │ │ │ │ ├── crBrowser.js │ │ │ │ │ ├── crConnection.js │ │ │ │ │ ├── crCoverage.js │ │ │ │ │ ├── crDevTools.js │ │ │ │ │ ├── crDragDrop.js │ │ │ │ │ ├── crExecutionContext.js │ │ │ │ │ ├── crInput.js │ │ │ │ │ ├── crNetworkManager.js │ │ │ │ │ ├── crPage.js │ │ │ │ │ ├── crPdf.js │ │ │ │ │ ├── crProtocolHelper.js │ │ │ │ │ ├── crServiceWorker.js │ │ │ │ │ ├── defaultFontFamilies.js │ │ │ │ │ └── videoRecorder.js │ │ │ │ ├── clock.js │ │ │ │ ├── codegen │ │ │ │ │ ├── csharp.js │ │ │ │ │ ├── java.js │ │ │ │ │ ├── javascript.js │ │ │ │ │ ├── jsonl.js │ │ │ │ │ ├── language.js │ │ │ │ │ ├── languages.js │ │ │ │ │ ├── python.js │ │ │ │ │ └── types.js │ │ │ │ ├── console.js │ │ │ │ ├── cookieStore.js │ │ │ │ ├── debugController.js │ │ │ │ ├── debugger.js │ │ │ │ ├── deviceDescriptors.js │ │ │ │ ├── deviceDescriptorsSource.json │ │ │ │ ├── dialog.js │ │ │ │ ├── dispatchers │ │ │ │ │ ├── androidDispatcher.js │ │ │ │ │ ├── artifactDispatcher.js │ │ │ │ │ ├── browserContextDispatcher.js │ │ │ │ │ ├── browserDispatcher.js │ │ │ │ │ ├── browserTypeDispatcher.js │ │ │ │ │ ├── cdpSessionDispatcher.js │ │ │ │ │ ├── debugControllerDispatcher.js │ │ │ │ │ ├── dialogDispatcher.js │ │ │ │ │ ├── dispatcher.js │ │ │ │ │ ├── electronDispatcher.js │ │ │ │ │ ├── elementHandlerDispatcher.js │ │ │ │ │ ├── frameDispatcher.js │ │ │ │ │ ├── jsHandleDispatcher.js │ │ │ │ │ ├── jsonPipeDispatcher.js │ │ │ │ │ ├── localUtilsDispatcher.js │ │ │ │ │ ├── networkDispatchers.js │ │ │ │ │ ├── pageDispatcher.js │ │ │ │ │ ├── playwrightDispatcher.js │ │ │ │ │ ├── selectorsDispatcher.js │ │ │ │ │ ├── streamDispatcher.js │ │ │ │ │ ├── tracingDispatcher.js │ │ │ │ │ ├── webSocketRouteDispatcher.js │ │ │ │ │ └── writableStreamDispatcher.js │ │ │ │ ├── dom.js │ │ │ │ ├── download.js │ │ │ │ ├── electron │ │ │ │ │ ├── electron.js │ │ │ │ │ └── loader.js │ │ │ │ ├── errors.js │ │ │ │ ├── fetch.js │ │ │ │ ├── fileChooser.js │ │ │ │ ├── fileUploadUtils.js │ │ │ │ ├── firefox │ │ │ │ │ ├── ffAccessibility.js │ │ │ │ │ ├── ffBrowser.js │ │ │ │ │ ├── ffConnection.js │ │ │ │ │ ├── ffExecutionContext.js │ │ │ │ │ ├── ffInput.js │ │ │ │ │ ├── ffNetworkManager.js │ │ │ │ │ ├── ffPage.js │ │ │ │ │ └── firefox.js │ │ │ │ ├── formData.js │ │ │ │ ├── frameSelectors.js │ │ │ │ ├── frames.js │ │ │ │ ├── har │ │ │ │ │ ├── harRecorder.js │ │ │ │ │ └── harTracer.js │ │ │ │ ├── helper.js │ │ │ │ ├── index.js │ │ │ │ ├── input.js │ │ │ │ ├── instrumentation.js │ │ │ │ ├── isomorphic │ │ │ │ │ └── utilityScriptSerializers.js │ │ │ │ ├── javascript.js │ │ │ │ ├── launchApp.js │ │ │ │ ├── macEditingCommands.js │ │ │ │ ├── network.js │ │ │ │ ├── page.js │ │ │ │ ├── pipeTransport.js │ │ │ │ ├── playwright.js │ │ │ │ ├── progress.js │ │ │ │ ├── protocolError.js │ │ │ │ ├── recorder.js │ │ │ │ ├── recorder │ │ │ │ │ ├── contextRecorder.js │ │ │ │ │ ├── recorderApp.js │ │ │ │ │ ├── recorderCollection.js │ │ │ │ │ ├── recorderFrontend.js │ │ │ │ │ ├── recorderInTraceViewer.js │ │ │ │ │ ├── recorderRunner.js │ │ │ │ │ ├── recorderUtils.js │ │ │ │ │ └── throttledFile.js │ │ │ │ ├── registry │ │ │ │ │ ├── browserFetcher.js │ │ │ │ │ ├── dependencies.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── nativeDeps.js │ │ │ │ │ └── oopDownloadBrowserMain.js │ │ │ │ ├── screenshotter.js │ │ │ │ ├── selectors.js │ │ │ │ ├── socksClientCertificatesInterceptor.js │ │ │ │ ├── socksInterceptor.js │ │ │ │ ├── trace │ │ │ │ │ ├── recorder │ │ │ │ │ │ ├── snapshotter.js │ │ │ │ │ │ ├── snapshotterInjected.js │ │ │ │ │ │ └── tracing.js │ │ │ │ │ ├── test │ │ │ │ │ │ └── inMemorySnapshotter.js │ │ │ │ │ └── viewer │ │ │ │ │ │ └── traceViewer.js │ │ │ │ ├── transport.js │ │ │ │ ├── types.js │ │ │ │ ├── usKeyboardLayout.js │ │ │ │ └── webkit │ │ │ │ │ ├── webkit.js │ │ │ │ │ ├── wkAccessibility.js │ │ │ │ │ ├── wkBrowser.js │ │ │ │ │ ├── wkConnection.js │ │ │ │ │ ├── wkExecutionContext.js │ │ │ │ │ ├── wkInput.js │ │ │ │ │ ├── wkInterceptableRequest.js │ │ │ │ │ ├── wkPage.js │ │ │ │ │ ├── wkProvisionalPage.js │ │ │ │ │ └── wkWorkers.js │ │ │ ├── third_party │ │ │ │ └── pixelmatch.js │ │ │ ├── utils │ │ │ │ ├── ascii.js │ │ │ │ ├── comparators.js │ │ │ │ ├── crypto.js │ │ │ │ ├── debug.js │ │ │ │ ├── debugLogger.js │ │ │ │ ├── env.js │ │ │ │ ├── eventsHelper.js │ │ │ │ ├── expectUtils.js │ │ │ │ ├── fileUtils.js │ │ │ │ ├── happy-eyeballs.js │ │ │ │ ├── headers.js │ │ │ │ ├── hostPlatform.js │ │ │ │ ├── httpServer.js │ │ │ │ ├── index.js │ │ │ │ ├── isomorphic │ │ │ │ │ ├── ariaSnapshot.js │ │ │ │ │ ├── cssParser.js │ │ │ │ │ ├── cssTokenizer.js │ │ │ │ │ ├── locatorGenerators.js │ │ │ │ │ ├── locatorParser.js │ │ │ │ │ ├── locatorUtils.js │ │ │ │ │ ├── mimeType.js │ │ │ │ │ ├── recorderUtils.js │ │ │ │ │ ├── selectorParser.js │ │ │ │ │ ├── stringUtils.js │ │ │ │ │ ├── traceUtils.js │ │ │ │ │ └── urlMatch.js │ │ │ │ ├── linuxUtils.js │ │ │ │ ├── manualPromise.js │ │ │ │ ├── multimap.js │ │ │ │ ├── network.js │ │ │ │ ├── processLauncher.js │ │ │ │ ├── profiler.js │ │ │ │ ├── rtti.js │ │ │ │ ├── semaphore.js │ │ │ │ ├── sequence.js │ │ │ │ ├── spawnAsync.js │ │ │ │ ├── stackTrace.js │ │ │ │ ├── task.js │ │ │ │ ├── time.js │ │ │ │ ├── timeoutRunner.js │ │ │ │ ├── traceUtils.js │ │ │ │ ├── userAgent.js │ │ │ │ ├── wsServer.js │ │ │ │ ├── zipFile.js │ │ │ │ └── zones.js │ │ │ ├── utilsBundle.js │ │ │ ├── utilsBundleImpl │ │ │ │ ├── index.js │ │ │ │ └── xdg-open │ │ │ ├── vite │ │ │ │ ├── htmlReport │ │ │ │ │ └── index.html │ │ │ │ ├── recorder │ │ │ │ │ ├── assets │ │ │ │ │ │ ├── codeMirrorModule-C5j27SYZ.js │ │ │ │ │ │ ├── codeMirrorModule-ez37Vkbh.css │ │ │ │ │ │ ├── codicon-DCmgc-ay.ttf │ │ │ │ │ │ ├── index-iA1aAGZg.css │ │ │ │ │ │ └── index-m0XdVJHe.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── playwright-logo.svg │ │ │ │ └── traceViewer │ │ │ │ │ ├── assets │ │ │ │ │ ├── codeMirrorModule-BBCX0spr.js │ │ │ │ │ ├── inspectorTab-B4Iw34Ow.js │ │ │ │ │ ├── testServerConnection-DeE2kSzz.js │ │ │ │ │ ├── workbench-DFlGYqou.js │ │ │ │ │ └── xtermModule-BeNbaIVa.js │ │ │ │ │ ├── codeMirrorModule.ez37Vkbh.css │ │ │ │ │ ├── codicon.DCmgc-ay.ttf │ │ │ │ │ ├── embedded.CmarehFk.js │ │ │ │ │ ├── embedded.html │ │ │ │ │ ├── embedded.w7WN2u1R.css │ │ │ │ │ ├── index.CrbWWHbf.css │ │ │ │ │ ├── index.FBucu_gE.js │ │ │ │ │ ├── index.html │ │ │ │ │ ├── inspectorTab.DEOUW62d.css │ │ │ │ │ ├── playwright-logo.svg │ │ │ │ │ ├── recorder.B_SY1GJM.css │ │ │ │ │ ├── recorder.CW_rzcEp.js │ │ │ │ │ ├── recorder.html │ │ │ │ │ ├── snapshot.html │ │ │ │ │ ├── sw.bundle.js │ │ │ │ │ ├── uiMode.CDUVjusr.js │ │ │ │ │ ├── uiMode.html │ │ │ │ │ ├── uiMode.voC1ZiOQ.css │ │ │ │ │ ├── workbench.C-zR9ysA.css │ │ │ │ │ └── xtermModule.DSXBckUd.css │ │ │ ├── zipBundle.js │ │ │ └── zipBundleImpl.js │ │ ├── package.json │ │ └── types │ │ │ ├── protocol.d.ts │ │ │ ├── structs.d.ts │ │ │ └── types.d.ts │ └── playwright │ │ ├── .eslintrc.js │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── ThirdPartyNotices.txt │ │ ├── cli.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.mjs │ │ ├── jsx-runtime.js │ │ ├── jsx-runtime.mjs │ │ ├── lib │ │ ├── common │ │ │ ├── config.js │ │ │ ├── configLoader.js │ │ │ ├── esmLoaderHost.js │ │ │ ├── expectBundle.js │ │ │ ├── expectBundleImpl.js │ │ │ ├── fixtures.js │ │ │ ├── globals.js │ │ │ ├── ipc.js │ │ │ ├── poolBuilder.js │ │ │ ├── process.js │ │ │ ├── suiteUtils.js │ │ │ ├── test.js │ │ │ ├── testLoader.js │ │ │ └── testType.js │ │ ├── fsWatcher.js │ │ ├── index.js │ │ ├── internalsForTest.js │ │ ├── isomorphic │ │ │ ├── events.js │ │ │ ├── folders.js │ │ │ ├── stringInternPool.js │ │ │ ├── teleReceiver.js │ │ │ ├── teleSuiteUpdater.js │ │ │ ├── testServerConnection.js │ │ │ ├── testServerInterface.js │ │ │ └── testTree.js │ │ ├── loader │ │ │ └── loaderMain.js │ │ ├── matchers │ │ │ ├── expect.js │ │ │ ├── matcherHint.js │ │ │ ├── matchers.js │ │ │ ├── toBeTruthy.js │ │ │ ├── toEqual.js │ │ │ ├── toMatchAriaSnapshot.js │ │ │ ├── toMatchSnapshot.js │ │ │ └── toMatchText.js │ │ ├── plugins │ │ │ ├── gitCommitInfoPlugin.js │ │ │ ├── index.js │ │ │ └── webServerPlugin.js │ │ ├── program.js │ │ ├── reporters │ │ │ ├── base.js │ │ │ ├── blob.js │ │ │ ├── dot.js │ │ │ ├── empty.js │ │ │ ├── github.js │ │ │ ├── html.js │ │ │ ├── internalReporter.js │ │ │ ├── json.js │ │ │ ├── junit.js │ │ │ ├── line.js │ │ │ ├── list.js │ │ │ ├── markdown.js │ │ │ ├── merge.js │ │ │ ├── multiplexer.js │ │ │ ├── reporterV2.js │ │ │ ├── teleEmitter.js │ │ │ └── versions │ │ │ │ └── blobV1.js │ │ ├── runner │ │ │ ├── dispatcher.js │ │ │ ├── failureTracker.js │ │ │ ├── lastRun.js │ │ │ ├── loadUtils.js │ │ │ ├── loaderHost.js │ │ │ ├── processHost.js │ │ │ ├── projectUtils.js │ │ │ ├── rebase.js │ │ │ ├── reporters.js │ │ │ ├── runner.js │ │ │ ├── sigIntWatcher.js │ │ │ ├── taskRunner.js │ │ │ ├── tasks.js │ │ │ ├── testGroups.js │ │ │ ├── testServer.js │ │ │ ├── uiModeReporter.js │ │ │ ├── vcs.js │ │ │ ├── watchMode.js │ │ │ └── workerHost.js │ │ ├── third_party │ │ │ └── tsconfig-loader.js │ │ ├── transform │ │ │ ├── babelBundle.js │ │ │ ├── babelBundleImpl.js │ │ │ ├── compilationCache.js │ │ │ ├── esmLoader.js │ │ │ ├── esmUtils.js │ │ │ ├── portTransport.js │ │ │ └── transform.js │ │ ├── util.js │ │ ├── utilsBundle.js │ │ ├── utilsBundleImpl.js │ │ └── worker │ │ │ ├── fixtureRunner.js │ │ │ ├── testInfo.js │ │ │ ├── testTracing.js │ │ │ ├── timeoutManager.js │ │ │ ├── util.js │ │ │ └── workerMain.js │ │ ├── package.json │ │ ├── test.d.ts │ │ ├── test.js │ │ ├── test.mjs │ │ └── types │ │ ├── test.d.ts │ │ └── testReporter.d.ts │ ├── package-lock.json │ └── package.json └── test ├── api ├── README.md ├── add_init_script_test.exs ├── browser_context │ ├── add_cookies_test.exs │ ├── clear_cookies_test.exs │ ├── cookies_test.exs │ ├── expect_test.exs │ ├── network_test.exs │ ├── permissions_test.exs │ ├── proxy_test.exs │ └── storage_state_test.exs ├── browser_context_test.exs ├── browser_test.exs ├── browser_type │ ├── connect_cdp_test.exs │ └── connect_test.exs ├── check_test.exs ├── chromium │ └── cdp_session_test.exs ├── click_test.exs ├── element_handle_test.exs ├── frame_test.exs ├── js_handle_test.exs ├── launcher_test.exs ├── locator_test.exs ├── navigation_test.exs ├── network_test.exs ├── page │ ├── accessibility_test.exs │ ├── evaluate_handle_test.exs │ ├── expect_test.exs │ ├── keyboard_test.exs │ └── screenshot_test.exs ├── page_test.exs └── response_test.exs ├── playwright_test.exs ├── sdk ├── channel │ ├── catalog_test.exs │ ├── connection_test.exs │ └── message_test.exs ├── extra │ ├── atom_test.exs │ ├── map_test.exs │ └── uri_test.exs ├── helpers │ └── url_matcher_test.exs └── transport │ └── driver_message_test.exs ├── support ├── fixtures │ ├── file-to-upload.txt │ ├── injectedfile.js │ ├── reference.txt │ └── screenshot-element-bounding-box-chromium.png ├── test_case.ex └── unit_test.ex └── test_helper.exs /.envrc: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | source_up_if_exists 4 | export REPO="$(expand_path .)" 5 | export ERL_AFLAGS="-kernel shell_history enabled" # persistent iex history 6 | 7 | # default: true 8 | # export PLAYWRIGHT_HEADLESS=false 9 | 10 | # default transport: driver (websocket is the one alternative) 11 | # export PLAYWRIGHT_TRANSPORT=websocket 12 | # export PLAYWRIGHT_ENDPOINT="ws://localhost:3000/" 13 | 14 | # put your custom/local overrides in here: 15 | source_env_if_exists .local/envrc 16 | 17 | PATH_add bin 18 | -------------------------------------------------------------------------------- /.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], 4 | line_length: 130 5 | ] 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | priv/static/* linguist-vendored 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Playwright-Elixir CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | all: 11 | name: Build & Test 12 | runs-on: ubuntu-latest 13 | env: 14 | MIX_ENV: test 15 | PLAYWRIGHT_TRANSPORT: driver 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Elixir 19 | uses: erlef/setup-beam@v1 20 | with: 21 | elixir-version: '1.16.2' 22 | otp-version: '26.2.5' 23 | - name: Install Elixir dependencies 24 | run: mix deps.get 25 | - name: Install Playwright dependencies (e.g., browsers) 26 | run: mix playwright.install 27 | # NOTE: not needed for now, while assets are 28 | # directly installed to `priv/static`. 29 | # - name: Install Node dependencies 30 | # run: npm install --prefix assets 31 | - name: Run tests 32 | run: mix test 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # The directory Mix will write compiled artifacts to. 2 | /_build/ 3 | 4 | /assets/node_modules/ 5 | 6 | # If you run "mix test --cover", coverage assets end up here. 7 | /cover/ 8 | 9 | # The directory Mix downloads your dependencies sources to. 10 | /deps/ 11 | 12 | # Where third-party dependencies like ExDoc output generated docs. 13 | /doc/ 14 | /priv/plts 15 | /.elixir_ls 16 | /rebar.lock 17 | 18 | # Ignore .fetch files in case you like to edit your project deps locally. 19 | /.fetch 20 | 21 | # Ignore .private files where things 22 | /.local 23 | 24 | # If the VM crashes, it generates a dump, let's ignore it too. 25 | erl_crash.dump 26 | 27 | # Also ignore archive artifacts (built via "mix archive.build"). 28 | *.ez 29 | 30 | # Ignore package tarball (built via "mix hex.build"). 31 | playwright-*.tar 32 | 33 | 34 | # Temporary files for e.g. tests 35 | /tmp 36 | 37 | .medic/skipped/ 38 | .doctor.out 39 | .vscode 40 | *.iml 41 | /.idea/ -------------------------------------------------------------------------------- /.medic/_support/cecho.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # https://github.com/eahanson/bashio 3 | 4 | 5 | cecho() { 6 | string="" 7 | 8 | if [[ $1 == "-n" ]] ; then 9 | line_ending="" 10 | else 11 | line_ending="\n" 12 | fi 13 | 14 | while (( "$#" )); do 15 | case "$1" in 16 | -n) 17 | shift 18 | ;; 19 | 20 | --reset) 21 | string="${string}\033[0m" 22 | shift 23 | ;; 24 | 25 | --*) 26 | color="\033[" 27 | 28 | if [[ $1 == *"-bold"* ]]; then 29 | color="${color}1;" 30 | else 31 | color="${color}0;" 32 | fi 33 | 34 | if [[ $1 == *"-bright"* ]]; then 35 | color="${color}9" 36 | else 37 | color="${color}3" 38 | fi 39 | 40 | case "$1" in 41 | *-blue*) 42 | color="${color}4" 43 | ;; 44 | 45 | *-cyan*) 46 | color="${color}6" 47 | ;; 48 | 49 | *-green*) 50 | color="${color}2" 51 | ;; 52 | 53 | *-magenta*) 54 | color="${color}5" 55 | ;; 56 | 57 | *-red*) 58 | color="${color}1" 59 | ;; 60 | 61 | *-white*) 62 | color="${color}7" 63 | ;; 64 | 65 | *-yellow*) 66 | color="${color}3" 67 | ;; 68 | esac 69 | 70 | color="${color}m" 71 | 72 | string="${string}${color}" 73 | shift 74 | ;; 75 | 76 | *) 77 | string="${string}${1} " 78 | shift 79 | ;; 80 | esac 81 | done 82 | 83 | echo -n -e "${string}\033[0m${line_ending}" 84 | } 85 | 86 | -------------------------------------------------------------------------------- /.medic/_support/check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | localcopy() { 4 | content="$1" 5 | 6 | if command -v pbcopy >/dev/null; then 7 | echo -n ${content} | pbcopy 8 | elif command -v xclip >/dev/null; then 9 | echo "$content" | xclip -selection clipboard 10 | else 11 | cecho -n --yellow "You're missing a suitable copy command; here's the content I tried to copy:" 12 | cecho -n --yellow "$content" 13 | fi 14 | } 15 | 16 | check() { 17 | description=$1 18 | command=$2 19 | remedy=$3 20 | 21 | cecho -n --green "•" --cyan "${description}" 22 | 23 | shell_flags=$- 24 | set +e 25 | 26 | eval "${command} > .doctor.out 2>&1" 27 | command_exit_status=$? 28 | 29 | if [[ $shell_flags =~ e ]] 30 | then set -e 31 | else set +e 32 | fi 33 | 34 | 35 | if [ $command_exit_status -eq 0 ]; then 36 | cecho --bold-green "OK" 37 | return 0 38 | else 39 | cecho --red "FAILED" 40 | cat .doctor.out 41 | cecho --cyan "Possible remedy: " --yellow "${remedy}" 42 | cecho --cyan "(it's in the clipboard)" 43 | localcopy "$remedy" 44 | exit 1 45 | fi 46 | } 47 | 48 | xcheck() { 49 | description=$1 50 | command=$2 51 | remedy=$3 52 | 53 | cecho -n --yellow "[checking] ${description}" --white "... " 54 | cecho --yellow "SKIPPED" 55 | return 0 56 | } 57 | -------------------------------------------------------------------------------- /.medic/_support/confirm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source "bin/_support/cecho.sh" 4 | 5 | confirm() { 6 | description=$1 7 | 8 | cecho -n --green "\n▸" --cyan "${description}?" --yellow "[y/N]" 9 | read CONFIRMATION 10 | CONFIRMATION=$(echo "${CONFIRMATION}" | tr '[:upper:]' '[:lower:]') 11 | 12 | if [[ ! "${CONFIRMATION}" =~ "y" ]]; then 13 | echo 14 | cecho --yellow "Exiting due to confirmation" 15 | exit 0 16 | fi 17 | } 18 | -------------------------------------------------------------------------------- /.medic/_support/doctor.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | #DIR=$(dirname $0); 4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 5 | source "$DIR/os.sh" 6 | source "$DIR/cecho.sh" 7 | source "$DIR/check.sh" 8 | source "$DIR/step.sh" 9 | -------------------------------------------------------------------------------- /.medic/_support/os.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | darwin() { 4 | uname -a | grep "Darwin" 5 | } 6 | -------------------------------------------------------------------------------- /.medic/_support/spinner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source "bin/_support/cecho.sh" 4 | 5 | spin() { 6 | spinner="⣾⣽⣻⢿⡿⣟⣯⣷" 7 | while :; do 8 | for i in $(seq 0 7); do 9 | echo -n "${spinner:$i:1}" 10 | echo -en "\010" 11 | sleep 1 12 | done 13 | done 14 | } 15 | 16 | spin & 17 | SPIN_PID=$! 18 | trap "kill -9 $SPIN_PID" $(seq 0 15) 19 | curl -L http://slowwly.robertomurray.co.uk/delay/15000/url/https://www.shellscript.sh/tips/spinner/test.txt 20 | kill -9 $SPIN_PID 21 | -------------------------------------------------------------------------------- /.medic/_support/step.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | step_header() { 4 | cecho -n --bright-green "•" --bright-cyan "${1}:" --yellow "${2}" --orange "${3:-}" 5 | } 6 | 7 | step() { 8 | description=$1 9 | command=$2 10 | 11 | step_header "${description}" "${command}" 12 | output=$(eval "${command}" 2>&1) 13 | 14 | if [ $? -eq 0 ]; then 15 | cecho --bold-bright-green "OK" 16 | else 17 | cecho --red "FAILED" 18 | cecho --red $output 19 | exit 20 | fi 21 | } 22 | 23 | step_with_output() { 24 | description=$1 25 | command=$2 26 | 27 | echo "" 28 | step_header "${description}" "${command}" 29 | echo "" 30 | eval "${command}" 31 | echo "" 32 | } 33 | 34 | section() { 35 | title=$1 36 | cecho --yellow "\n${title}" 37 | } 38 | 39 | xstep() { 40 | description=$1 41 | command=$2 42 | 43 | step_header "${description}" "${command}" "[SKIPPED]" 44 | 45 | return 0 46 | } 47 | -------------------------------------------------------------------------------- /.medic/doctor.exs: -------------------------------------------------------------------------------- 1 | [ 2 | {Medic.Checks.Hex, :local_hex_installed?}, 3 | {Medic.Checks.Hex, :packages_installed?}, 4 | {Medic.Checks.NPM, :exists?}, 5 | {Medic.Checks.NPM, :require_minimum_version, ["7.8.0"]}, 6 | {Medic.Checks.NPM, :any_packages_installed?}, 7 | {Medic.Checks.NPM, :all_packages_installed?} 8 | ] 9 | -------------------------------------------------------------------------------- /.medic/require.exs: -------------------------------------------------------------------------------- 1 | Mix.install([ 2 | {:medic, force: true} 3 | ]) 4 | -------------------------------------------------------------------------------- /.medic/update.exs: -------------------------------------------------------------------------------- 1 | [:update_code, :update_mix, :update_npm, :doctor] 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | elixir 1.16.2-otp-26 2 | erlang 26.2.5 3 | nodejs 22.2.0 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # Changelog 3 | 4 | All notable changes to this project will be documented in this file. 5 | 6 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). 7 | 8 | --- 9 | 10 | ## [Unreleased] 11 | 12 | ### Changed 13 | 14 | - ... 15 | 16 | --- 17 | 18 | ## [v0.1.17-preview-2] - 2021-12-06 19 | 20 | ### Changed 21 | 22 | - **BREAKING:** No longer return successful API/capability calls with `{:ok, resource}`. This approach was feeling more and more cumbersome to the user of the package, and provided no real value. 23 | 24 | --- 25 | 26 | ## footnotes 27 | 28 | ... 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Mechanical Orchard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bin/dev/audit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | trap "exit" INT 7 | 8 | source ".medic/_support/doctor.sh" 9 | 10 | check "Check formatting" "mix format --check-formatted" "mix format" 11 | check "Checking for unused deps" "mix deps.unlock --check-unused" "mix deps.clean --unused --unlock" 12 | check "Auditing Elixir deps" "mix deps.audit" "# fix audit issues" 13 | check "Credo" "mix credo --strict" "# fix issues" 14 | check "Dialyzer" "mix dialyzer" "# fix dialyzer issues" 15 | -------------------------------------------------------------------------------- /bin/dev/doc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | : ${REPO:?'UNDEFINED - Be sure to `direnv allow` first'} 5 | 6 | pushd ${REPO} > /dev/null 7 | MIX_ENV=dev mix docs 8 | popd > /dev/null 9 | -------------------------------------------------------------------------------- /bin/dev/doctor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -u 5 | set -o pipefail 6 | 7 | source ".medic/_support/doctor.sh" 8 | 9 | # run doctor in home directory if present 10 | if [[ -f "${HOME}/bin/dev/doctor" ]]; then 11 | if ! step "Found a doctor script in home directory" "pushd ${HOME} > /dev/null && ./bin/dev/doctor && popd > /dev/null"; then 12 | exit 1 13 | fi 14 | fi 15 | 16 | cecho --green "\n▸" --bright-bold-cyan "Running initial doctor checks..." 17 | 18 | check "asdf: installed" \ 19 | "command -v asdf" \ 20 | "open 'https://asdf-vm.com/#/core-manage-asdf'" 21 | 22 | check "asdf: erlang plugin installed" \ 23 | "asdf plugin-list | grep erlang" \ 24 | "asdf plugin-add erlang" 25 | 26 | check "asdf: elixir plugin installed" \ 27 | "asdf plugin-list | grep elixir" \ 28 | "asdf plugin-add elixir" 29 | 30 | check "asdf: tools are installed" \ 31 | "asdf which erl > /dev/null && asdf which elixir > /dev/null" \ 32 | "asdf install" 33 | 34 | echo "" 35 | 36 | elixir -r .medic/require.exs -e "Medic.Doctor.run()" $* 37 | -------------------------------------------------------------------------------- /bin/dev/shipit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | trap "exit" INT 7 | 8 | source ".medic/_support/doctor.sh" 9 | 10 | bin/dev/audit 11 | bin/dev/update 12 | bin/dev/test 13 | 14 | step "Pushing" "git push origin HEAD" 15 | -------------------------------------------------------------------------------- /bin/dev/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PLAYWRIGHT_TRANSPORT=driver 4 | elixir -r .medic/require.exs -e "Medic.Test.run()" $* 5 | 6 | # NOTE: it might be nice to check for a running Playwright WebSocket server 7 | # and run the following if so: 8 | # export PLAYWRIGHT_TRANSPORT=websocket 9 | # export PLAYWRIGHT_ENDPOINT="ws://localhost:3000/chromium" 10 | # elixir -r .medic/require.exs -e "Medic.Test.run()" $* 11 | -------------------------------------------------------------------------------- /bin/dev/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | trap "exit" INT 5 | 6 | elixir -r .medic/require.exs -e "Medic.Update.run()" $* 7 | -------------------------------------------------------------------------------- /config/config.exs: -------------------------------------------------------------------------------- 1 | import Config 2 | 3 | config :playwright, ConnectOptions, ws_endpoint: System.get_env("PLAYWRIGHT_ENDPOINT", "ws://localhost:3000/") 4 | 5 | config :playwright, LaunchOptions, 6 | channel: System.get_env("PLAYWRIGHT_CHANNEL", nil), 7 | headless: String.to_atom(System.get_env("PLAYWRIGHT_HEADLESS", "true")) != false, 8 | playwright_cli_path: Path.expand("../priv/static/driver.js", __DIR__) 9 | 10 | config :playwright, PlaywrightTest, transport: String.to_atom(System.get_env("PLAYWRIGHT_TRANSPORT", "driver")) 11 | 12 | if config_env() == :test do 13 | config :logger, level: :info 14 | 15 | config :playwright_assets, 16 | port: 4002 17 | end 18 | -------------------------------------------------------------------------------- /lib/mix/tasks/playwright.install.ex: -------------------------------------------------------------------------------- 1 | defmodule Mix.Tasks.Playwright.Install do 2 | @moduledoc """ 3 | Installs Playwright browsers. 4 | 5 | ```bash 6 | $ mix playwright.install 7 | ``` 8 | """ 9 | 10 | @shortdoc "Installs Playwright browsers in OS specific locations" 11 | use Mix.Task 12 | 13 | @impl true 14 | def run(_args) do 15 | Playwright.SDK.CLI.install() 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/playwright/android.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Android do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | end 5 | -------------------------------------------------------------------------------- /lib/playwright/api/errors/web_error.ex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/lib/playwright/api/errors/web_error.ex -------------------------------------------------------------------------------- /lib/playwright/api_request.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.APIRequest do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | 5 | # @spec new_context(t(), options()) :: APIRequestContext.t() 6 | # def new_context(api_request, options \\ %{}) 7 | end 8 | -------------------------------------------------------------------------------- /lib/playwright/api_response.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.APIResponse do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | alias Playwright.APIResponse 5 | 6 | @property :fetchUid 7 | @property :headers 8 | @property :status 9 | @property :status_text 10 | @property :url 11 | 12 | # @spec body(t()) :: binary() # or, equivalent of `Buffer` 13 | # def body(response) 14 | 15 | # @spec dispose(t()) :: :ok 16 | # def dispose(response) 17 | 18 | # @spec headers(t()) :: map() 19 | # def headers(response) 20 | 21 | # @spec headers(t()) :: map() 22 | # def headers(response) 23 | 24 | # @spec headers_list(APIResponse.t()) :: [map()] 25 | # def headers_list(response) 26 | 27 | # @spec json(t()) :: binary() # "serializable"; so, maybe map()? 28 | # def json(response) 29 | 30 | @spec ok(t()) :: boolean() 31 | def ok(%APIResponse{} = response) do 32 | response.status === 0 || (response.status >= 200 && response.status <= 299) 33 | end 34 | 35 | # @spec status(t()) :: number() 36 | # def status(response) 37 | 38 | # @spec status_text(t()) :: binary() 39 | # def status_text(response) 40 | 41 | # @spec text(t()) :: binary() 42 | # def text(response) 43 | 44 | # @spec url(t()) :: binary() 45 | # def url(response) 46 | end 47 | -------------------------------------------------------------------------------- /lib/playwright/application.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Application do 2 | @moduledoc false 3 | use Application 4 | 5 | @impl Application 6 | def start(_type, _args) do 7 | children = [ 8 | Playwright.SDK.Channel.SessionID, 9 | {DynamicSupervisor, strategy: :one_for_one, name: Playwright.SDK.Channel.Session.Supervisor} 10 | ] 11 | 12 | options = [ 13 | name: Playwright.Supervisor, 14 | strategy: :one_for_one 15 | ] 16 | 17 | Supervisor.start_link(children, options) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/playwright/binding_call.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BindingCall do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | alias Playwright.BindingCall 5 | alias Playwright.SDK.{Channel, Helpers} 6 | 7 | @property :args 8 | @property :frame 9 | @property :handle 10 | @property :name 11 | 12 | def call(%BindingCall{session: session} = binding_call, func) do 13 | Task.start_link(fn -> 14 | frame = Channel.find(session, {:guid, binding_call.frame.guid}) 15 | 16 | source = %{ 17 | context: "TBD", 18 | frame: frame, 19 | page: "TBD" 20 | } 21 | 22 | result = func.(source, Helpers.Serialization.deserialize(binding_call.args)) 23 | Channel.post(session, {:guid, binding_call.guid}, :resolve, %{result: Helpers.Serialization.serialize(result)}) 24 | end) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/playwright/browser_context/tracing.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.Tracing do 2 | @moduledoc false 3 | 4 | # @spec start(Tracing.t(), options()) :: :ok 5 | # def start(tracing, options \\ %{}) 6 | 7 | # @spec start_chunk(Tracing.t(), options()) :: :ok 8 | # def start_chunk(tracing, options \\ %{}) 9 | 10 | # @spec stop(Tracing.t(), options()) :: :ok 11 | # def stop(tracing, options \\ %{}) 12 | 13 | # @spec stop_chunck(Tracing.t(), options()) :: :ok 14 | # def stop_chunck(tracing, options \\ %{}) 15 | end 16 | -------------------------------------------------------------------------------- /lib/playwright/console_message.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.ConsoleMessage do 2 | @moduledoc """ 3 | `Playwright.ConsoleMessage` instances are dispatched by page and handled via 4 | `Playwright.Page.on/3` for the `:console` event type. 5 | """ 6 | use Playwright.SDK.ChannelOwner 7 | alias Playwright.SDK.ChannelOwner 8 | 9 | @property :message_text 10 | # ... from: :text 11 | @property :message_type 12 | # ..., from: :type 13 | 14 | # callbacks 15 | # --------------------------------------------------------------------------- 16 | 17 | @impl ChannelOwner 18 | def init(message, initializer) do 19 | {:ok, %{message | message_text: initializer.text, message_type: initializer.type}} 20 | end 21 | 22 | # API 23 | # --------------------------------------------------------------------------- 24 | 25 | # --- 26 | 27 | # @spec args(ConsoleMessage.t()) :: [JSHandle.t()] 28 | # def args(message) 29 | 30 | # @spec location(ConsoleMessage.t()) :: call_location() 31 | # def location(message) 32 | 33 | # @spec location(ConsoleMessage.t()) :: call_location() 34 | # def location(message) 35 | 36 | # @spec page(ConsoleMessage.t()) :: Page.t() 37 | # def page(message) 38 | 39 | # @spec text(ConsoleMessage.t()) :: String.t() 40 | # def text(message) 41 | 42 | # @spec type(ConsoleMessage.t()) :: String.t() 43 | # def type(message) 44 | 45 | # --- 46 | end 47 | -------------------------------------------------------------------------------- /lib/playwright/dialog.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Dialog do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | 5 | # @spec accept(Dialog.t(), binary()) :: :ok 6 | # def accept(dialog, prompt \\ "") 7 | 8 | # @spec default_value(Dialog.t()) :: binary() 9 | # def default_value(dialog) 10 | 11 | # @spec dismiss(Dialog.t()) :: :ok 12 | # def dismiss(dialog) 13 | 14 | # @spec message(Dialog.t()) :: binary() 15 | # def message(dialog) 16 | 17 | # @spec page(Dialog.t()) :: nil | Page.t() 18 | # def page(dialog) 19 | 20 | # @spec type(Dialog.t()) :: binary() 21 | # def type(dialog) 22 | end 23 | -------------------------------------------------------------------------------- /lib/playwright/electron.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Electron do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | end 5 | -------------------------------------------------------------------------------- /lib/playwright/fetch_request.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.FetchRequest do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | 5 | # obsolete? 6 | end 7 | -------------------------------------------------------------------------------- /lib/playwright/local_utils.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.LocalUtils do 2 | @moduledoc false 3 | use Playwright.SDK.ChannelOwner 4 | 5 | # obsolete? exists in playwright-python; not present in API docs. 6 | end 7 | -------------------------------------------------------------------------------- /lib/playwright/page/coverage.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Coverage do 2 | @moduledoc false 3 | 4 | # @spec start_css_coverage(t(), options()) :: :ok 5 | # def start_css_coverage(coverage, options \\ %{}) 6 | 7 | # @spec start_js_coverage(t(), options()) :: :ok 8 | # def start_js_coverage(coverage, options \\ %{}) 9 | 10 | # @spec stop_css_coverage(t()) :: result() 11 | # def stop_css_coverage(coverage) 12 | 13 | # @spec stop_js_coverage(t()) :: result() 14 | # def stop_js_coverage(coverage) 15 | 16 | end 17 | -------------------------------------------------------------------------------- /lib/playwright/page/download.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Download do 2 | @moduledoc false 3 | 4 | # @spec cancel(t()) :: :ok 5 | # def cancel(download) 6 | 7 | # @spec create_read_stream(t()) :: readable() 8 | # def create_read_stream(download) 9 | 10 | # @spec delete(t()) :: :ok 11 | # def delete(download) 12 | 13 | # @spec failure(t()) :: nil | binary() 14 | # def failure(download) 15 | 16 | # @spec page(t()) :: Page.t() 17 | # def page(download) 18 | 19 | # @spec path(t()) :: binary() 20 | # def path(download) 21 | 22 | # @spec save_as(t(), binary()) :: :ok 23 | # def save_as(download, path) 24 | 25 | # @spec suggested_filename(t()) :: binary() 26 | # def suggested_filename(download) 27 | 28 | # @spec url(t()) :: binary() 29 | # def url(download) 30 | 31 | end 32 | -------------------------------------------------------------------------------- /lib/playwright/page/file_chooser.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.FileChooser do 2 | @moduledoc false 3 | 4 | # @spec element(t()) :: ElementHandle.t() 5 | # def element(file_chooser) 6 | 7 | # @spec is_multiple(t()) :: boolean() 8 | # def is_multiple(file_chooser) 9 | 10 | # @spec page(t()) :: Page.t() 11 | # def page(file_chooser) 12 | 13 | # @spec set_files(t(), any(), options()) :: :ok 14 | # def cancel(file_chooser, files, options \\ %{}) 15 | 16 | end 17 | -------------------------------------------------------------------------------- /lib/playwright/page/frame_locator.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Page.FrameLocator do 2 | @moduledoc false 3 | 4 | # @spec first(t()) :: FrameLocator.t() 5 | # def first(locator) 6 | 7 | # @spec frame_locator(t(), binary()) :: FrameLocator.t() 8 | # def frame_locator(locator, selector) 9 | 10 | # @spec get_by_alt_text(t(), binary(), options()) :: Playwright.Locator.t() | nil 11 | # def get_by_alt_text(locator, text, options \\ %{}) 12 | 13 | # @spec get_by_label(t(), binary(), options()) :: Playwright.Locator.t() | nil 14 | # def get_by_label(locator, text, options \\ %{}) 15 | 16 | # @spec get_by_placeholder(t(), binary(), options()) :: Playwright.Locator.t() | nil 17 | # def get_by_placeholder(locator, text, options \\ %{}) 18 | 19 | # @spec get_by_role(t(), binary(), options()) :: Playwright.Locator.t() | nil 20 | # def get_by_role(locator, text, options \\ %{}) 21 | 22 | # @spec get_by_test_id(t(), binary(), options()) :: Playwright.Locator.t() | nil 23 | # def get_by_test_id(locator, text, options \\ %{}) 24 | 25 | # @spec get_by_text(t(), binary(), options()) :: Playwright.Locator.t() | nil 26 | # def get_by_text(locator, text, options \\ %{}) 27 | 28 | # @spec get_by_title(t(), binary(), options()) :: Playwright.Locator.t() | nil 29 | # def get_by_title(locator, text, options \\ %{}) 30 | 31 | # @spec last(t()) :: FrameLocator.t() 32 | # def last(locator) 33 | 34 | # @spec locator(t(), selector_or_locator(), options()) :: Locator.t() 35 | # def locator(locator, selector, options \\ %{}) 36 | # def locator(locator, locator, options \\ %{}) 37 | 38 | # @spec nth(t(), number()) :: FrameLocator.t() 39 | # def nth(locator, index) 40 | 41 | # @spec owner(t()) :: Locator.t() 42 | # def owner(locator) 43 | end 44 | -------------------------------------------------------------------------------- /lib/playwright/page/keyboard.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Page.Keyboard do 2 | @moduledoc """ 3 | `Keyboard` provides an API for managing a virtual keyboard. The high level API 4 | is `keyboard.type()`, which takes raw characters and generates proper 5 | `keydown`, `keypress`/`input`, and `keyup` events on your page. 6 | 7 | For finer control, you can use `keyboard.down()`, `keyboard.up()`, and 8 | `keyboard.insertText()` to manually fire events as if they were generated 9 | from a real keyboard. 10 | 11 | ## Examples 12 | 13 | ### 14 | """ 15 | 16 | use Playwright.SDK.ChannelOwner 17 | alias Playwright.Page 18 | 19 | # API 20 | # --------------------------------------------------------------------------- 21 | 22 | @spec down(Page.t(), binary()) :: Page.t() 23 | def down(page, key) do 24 | post!(page, :keyboard_down, %{key: key}) 25 | end 26 | 27 | @spec insert_text(Page.t(), binary()) :: Page.t() 28 | def insert_text(page, text) do 29 | post!(page, :keyboard_type, %{text: text}) 30 | end 31 | 32 | @spec press(Page.t(), binary()) :: Page.t() 33 | def press(page, key) do 34 | post!(page, :keyboard_press, %{key: key}) 35 | end 36 | 37 | @spec type(Page.t(), binary()) :: Page.t() 38 | def type(page, text) do 39 | post!(page, :keyboard_type, %{text: text}) 40 | end 41 | 42 | @spec up(Page.t(), binary()) :: Page.t() 43 | def up(page, key) do 44 | post!(page, :keyboard_up, %{key: key}) 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/playwright/page/mouse.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Mouse do 2 | @moduledoc false 3 | 4 | # @spec click(t(), number(), number(), options()) :: :ok 5 | # def click(mouse, x, y, options \\ %{}) 6 | 7 | # @spec dblclick(t(), number(), number(), options()) :: :ok 8 | # def dblclick(mouse, x, y, options \\ %{}) 9 | 10 | # @spec down(t(), options()) :: :ok 11 | # def down(mouse, options \\ %{}) 12 | 13 | # @spec move(t(), number(), number(), options()) :: :ok 14 | # def move(mouse, x, y, options \\ %{}) 15 | 16 | # @spec up(t(), options()) :: :ok 17 | # def up(mouse, options \\ %{}) 18 | 19 | # @spec wheel(t(), number(), number()) :: :ok 20 | # def wheel(mouse, delta_x, delta_y) 21 | 22 | end 23 | -------------------------------------------------------------------------------- /lib/playwright/page/touchscreen.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Touchscreen do 2 | @moduledoc false 3 | 4 | # @spec tap(t(), number(), number()) :: :ok 5 | # def tap(touchscreen, x, y) 6 | 7 | end 8 | -------------------------------------------------------------------------------- /lib/playwright/page/video.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Video do 2 | @moduledoc false 3 | 4 | # @spec delete(t()) :: :ok 5 | # def delete(video) 6 | 7 | # @spec path(t()) :: binary() 8 | # def path(video) 9 | 10 | # @spec save_as(t(), binary()) :: :ok 11 | # def save_as(video, path) 12 | 13 | end 14 | -------------------------------------------------------------------------------- /lib/playwright/sdk/channel/error.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Channel.Error do 2 | @moduledoc false 3 | # `Error` represents an error message received from the Playwright server 4 | # that is in response to a `Message` previously sent. 5 | alias Playwright.SDK.Channel 6 | 7 | @enforce_keys [:type, :message] 8 | defstruct [:type, :message] 9 | 10 | @type t() :: %__MODULE__{ 11 | type: String.t(), 12 | message: String.t() 13 | } 14 | 15 | def new(%{error: %{name: name, message: message} = _error}, _catalog) do 16 | %Channel.Error{ 17 | type: name, 18 | message: String.split(message, "\n") |> List.first() 19 | } 20 | end 21 | 22 | # TODO: determine why we get here... 23 | # DONE: see comment at error_handling.ex:9. 24 | def new(%{error: %{message: message} = _error}, _catalog) do 25 | %Channel.Error{ 26 | type: "NotImplementedError", 27 | message: String.split(message, "\n") |> List.first() 28 | } 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/playwright/sdk/channel/message.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Channel.Message do 2 | @moduledoc false 3 | # `Message` represents communication to and from the Playwright server. 4 | # The `id` is used to match responses and reply to the caller. 5 | 6 | import Playwright.SDK.Extra.Map 7 | alias Playwright.SDK.Channel 8 | 9 | @enforce_keys [:guid, :id, :method, :params] 10 | 11 | @derive [Jason.Encoder] 12 | defstruct [ 13 | :guid, 14 | :id, 15 | :method, 16 | :params, 17 | :metadata 18 | ] 19 | 20 | @type t() :: %__MODULE__{ 21 | guid: binary(), 22 | id: integer(), 23 | method: binary(), 24 | params: map() 25 | } 26 | 27 | # Creates a new `Message` struct. A monotonically-incremented `id` is added. 28 | # This `id` is used to match `Response` messages to the `Message`. `params` 29 | # are optional here and are passed to the Playwright server. They may actually 30 | # be required for the server-side `method` to make sense. 31 | def new(guid, method, params \\ %{}) do 32 | %Channel.Message{ 33 | guid: guid, 34 | id: System.unique_integer([:monotonic, :positive]), 35 | method: camelize(method), 36 | params: deep_camelize_keys(params), 37 | metadata: %{} 38 | } 39 | end 40 | 41 | # private 42 | # ---------------------------------------------------------------------------- 43 | 44 | defp camelize(key) when is_binary(key) do 45 | key 46 | end 47 | 48 | defp camelize(key) when is_atom(key) do 49 | Atom.to_string(key) |> Recase.to_camel() 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /lib/playwright/sdk/channel/session_id.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Channel.SessionID do 2 | @moduledoc false 3 | 4 | use Agent 5 | 6 | def start_link(_arg) do 7 | Agent.start_link(fn -> 0 end, name: __MODULE__) 8 | end 9 | 10 | def next do 11 | Agent.get_and_update(__MODULE__, fn state -> {state + 1, state + 1} end) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/playwright/sdk/cli.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.CLI do 2 | @moduledoc """ 3 | A wrapper to the Playwright Javascript CLI 4 | """ 5 | 6 | require Logger 7 | 8 | def install do 9 | Logger.info("Installing playwright browsers and dependencies") 10 | cli_path = config_cli() || default_cli() 11 | {result, exit_status} = System.cmd(cli_path, ["install", "--with-deps"]) 12 | Logger.info(result) 13 | if exit_status != 0, do: raise("Failed to install playwright browsers") 14 | end 15 | 16 | # private 17 | # ---------------------------------------------------------------------------- 18 | 19 | defp config_cli do 20 | Application.get_env(:playwright, LaunchOptions)[:driver_path] 21 | end 22 | 23 | defp default_cli do 24 | Path.join(:code.priv_dir(:playwright), "static/driver.js") 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/playwright/sdk/extra/atom.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Extra.Atom do 2 | @moduledoc false 3 | def from_string(nil), do: raise(ArgumentError, message: "Unable to convert nil into an atom") 4 | def from_string(s) when is_binary(s), do: String.to_atom(s) 5 | def from_string(a) when is_atom(a), do: a 6 | 7 | def to_string(nil), do: raise(ArgumentError, message: "Unable to convert nil into a string") 8 | def to_string(a) when is_atom(a), do: Atom.to_string(a) 9 | def to_string(s) when is_binary(s), do: s 10 | 11 | def snakecased(s) when is_binary(s), do: Recase.to_snake(s) |> from_string() 12 | end 13 | -------------------------------------------------------------------------------- /lib/playwright/sdk/extra/uri.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Extra.URI do 2 | @moduledoc false 3 | def absolute?(uri) do 4 | uri = URI.parse(uri) 5 | present?(uri.host) && present?(uri.scheme) 6 | end 7 | 8 | defp present?(nil), do: false 9 | defp present?(""), do: false 10 | defp present?(_), do: true 11 | end 12 | -------------------------------------------------------------------------------- /lib/playwright/sdk/helpers/error_handling.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Helpers.ErrorHandling do 2 | @moduledoc false 3 | alias Playwright.SDK.Channel.Error 4 | 5 | def with_timeout(options, action) when is_map(options) and is_function(action) do 6 | timeout = options |> Map.get(:timeout, 30_000) 7 | 8 | try do 9 | # In most cases (as of 20240802), the timeout value provided here is also 10 | # used as a timeout option passed to the Playwright server. As such, there 11 | # is/was a race condition in which the `action` provided here would often 12 | # time out before a response from the server indicated it's own timeout. 13 | # To mitigate this, we add an additional 100ms to the timeout value to give 14 | # the browser server a chance to timeout before the awaiting process times out. 15 | action.(timeout + 100) 16 | catch 17 | :exit, {:timeout, _} = _reason -> 18 | {:error, Error.new(%{error: %{message: "Timeout #{inspect(timeout)}ms exceeded."}}, nil)} 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/playwright/sdk/helpers/expression.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Helpers.Expression do 2 | @moduledoc false 3 | 4 | # Page.evaluate(page, "function () { return 'lala'; }") 5 | # Page.evaluate(page, "() => { return 'lala'; }") 6 | # Page.evaluate(page, "() => 'lala'") 7 | # Page.evaluate(page, "(thing) => { return thing; }") 8 | # Page.evaluate(page, "(thing) => thing;") 9 | # Page.evaluate(page, "thing => thing;") 10 | 11 | def function?("function" <> _) do 12 | true 13 | end 14 | 15 | def function?("() =>" <> _) do 16 | true 17 | end 18 | 19 | def function?(expression) do 20 | String.match?(expression, ~r/^[^=]+ =>/) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/playwright/sdk/helpers/route_handler.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Helpers.RouteHandler do 2 | @moduledoc false 3 | 4 | alias Playwright.SDK.Helpers.{RouteHandler, URLMatcher} 5 | 6 | defstruct([:matcher, :callback, :times, :count]) 7 | 8 | def new(%URLMatcher{} = matcher, callback, times \\ :infinity) do 9 | %__MODULE__{ 10 | matcher: matcher, 11 | callback: callback, 12 | times: times, 13 | count: 0 14 | } 15 | end 16 | 17 | def handle(%RouteHandler{} = handler, %{request: request, route: route}) do 18 | Task.start_link(fn -> 19 | handler.callback.(route, request) 20 | end) 21 | end 22 | 23 | def matches(%RouteHandler{} = handler, url) do 24 | URLMatcher.matches(handler.matcher, url) 25 | end 26 | 27 | # def prepare([%RouteHandler{}] = handlers) do 28 | def prepare(handlers) when is_list(handlers) do 29 | Enum.into(handlers, [], fn handler -> 30 | prepare_matcher(handler.matcher) 31 | end) 32 | end 33 | 34 | # private 35 | # ---------------------------------------------------------------------------- 36 | 37 | defp prepare_matcher(%URLMatcher{match: match}) when is_binary(match) do 38 | %{glob: match} 39 | end 40 | 41 | defp prepare_matcher(%URLMatcher{regex: %Regex{} = regex}) do 42 | %{ 43 | regex_source: Regex.source(regex), 44 | regex_flags: Regex.opts(regex) 45 | } 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /lib/playwright/sdk/helpers/url_matcher.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Helpers.URLMatcher do 2 | @moduledoc false 3 | 4 | defstruct([:match, :mode, :regex]) 5 | 6 | def new(base_url, match) when is_binary(match) do 7 | new(Enum.join([Regex.replace(~r/\/$/, base_url, ""), match], "/")) 8 | end 9 | 10 | def new(%Regex{} = match) do 11 | %__MODULE__{ 12 | match: nil, 13 | mode: "regex", 14 | regex: match 15 | } 16 | end 17 | 18 | def new(match) when is_binary(match) do 19 | %__MODULE__{ 20 | match: match, 21 | mode: "glob", 22 | regex: Regex.compile!(glob_to_regex(match)) 23 | } 24 | end 25 | 26 | def new(match) when is_function(match) do 27 | %__MODULE__{ 28 | match: match, 29 | mode: "callback", 30 | regex: nil 31 | } 32 | end 33 | 34 | # --- 35 | 36 | def matches(%__MODULE__{mode: "callback", match: match}, url) do 37 | match.(url) 38 | end 39 | 40 | def matches(%__MODULE__{regex: regex}, url) do 41 | String.match?(url, regex) 42 | end 43 | 44 | # private 45 | # --------------------------------------------------------------------------- 46 | 47 | # WARN: `translate` implementations are super naïve at the moment... 48 | # "**" -> ".*" 49 | # TODO: replace with something like https://github.com/jonleighton/path_glob 50 | defp glob_to_regex(pattern) do 51 | String.replace(pattern, ~r/\*{2,}/, ".*") 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /lib/playwright/sdk/transport/driver.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Transport.Driver do 2 | @moduledoc false 3 | # A transport for negotiating messages with the embedded Playwright `driver` 4 | # CLI. 5 | 6 | alias Playwright.SDK.Transport.DriverMessage 7 | 8 | defstruct([ 9 | :port, 10 | :remaining, 11 | :buffer 12 | ]) 13 | 14 | # module API 15 | # ---------------------------------------------------------------------------- 16 | 17 | def setup(config) do 18 | cli = Map.get(config, :driver_path, default_cli()) 19 | cmd = "run-driver" 20 | port = Port.open({:spawn, "#{cli} #{cmd}"}, [:binary]) 21 | 22 | %__MODULE__{ 23 | port: port, 24 | remaining: 0, 25 | buffer: "" 26 | } 27 | end 28 | 29 | def post(message, %{port: port}) do 30 | length = byte_size(message) 31 | padding = <> 32 | Port.command(port, padding <> message) 33 | end 34 | 35 | def parse({_port, {:data, data}}, %{buffer: buffer, remaining: remaining}) do 36 | %{ 37 | frames: frames, 38 | buffer: buffer, 39 | remaining: remaining 40 | } = DriverMessage.parse(data, remaining, buffer, []) 41 | 42 | {frames, %{buffer: buffer, remaining: remaining}} 43 | end 44 | 45 | # private 46 | # ---------------------------------------------------------------------------- 47 | 48 | defp default_cli do 49 | Path.join(:code.priv_dir(:playwright), "static/driver.js") 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /lib/playwright/selectors.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Selectors do 2 | @moduledoc """ 3 | ... 4 | """ 5 | use Playwright.SDK.ChannelOwner 6 | 7 | @type options :: map() 8 | 9 | # --- 10 | 11 | # @spec register(Selectors.t(), binary(), any(), options()) :: :ok 12 | # def register(selectors, name, script, options \\ %{}) 13 | 14 | # @spec set_testid_attribute(Selectors.t(), binary()) :: :ok 15 | # def set_testid_attribute(selectors, attribute_name) 16 | 17 | # --- 18 | end 19 | -------------------------------------------------------------------------------- /lib/playwright/tracing.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Tracing do 2 | @moduledoc """ 3 | ... 4 | """ 5 | use Playwright.SDK.ChannelOwner 6 | end 7 | -------------------------------------------------------------------------------- /lib/playwright/websocket.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.WebSocket do 2 | @moduledoc """ 3 | ... 4 | """ 5 | use Playwright.SDK.ChannelOwner 6 | 7 | @property :is_closed 8 | @property :url 9 | 10 | # --- 11 | 12 | # @spec expect_event(t(), binary(), function(), options()) :: map() 13 | # def expect_event(web_socket, event, predicate \\ nil, options \\ %{}) 14 | # ...delegate wait_for_event -> expect_event 15 | 16 | # on(...): 17 | # - close 18 | # - framereceived 19 | # - framesent 20 | # - socketerror 21 | # @spec on(t(), binary(), function()) :: nil 22 | # def on(web_socket, event, callback) 23 | 24 | # --- 25 | end 26 | -------------------------------------------------------------------------------- /lib/playwright/worker.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.Worker do 2 | @moduledoc """ 3 | ... 4 | """ 5 | use Playwright.SDK.ChannelOwner 6 | 7 | # @spec evaluate(Worker.t(), function() | binary(), EvaluationArgument.t()) :: Serializable.t() 8 | # def evaluate(worker, page_function, arg \\ nil) 9 | 10 | # @spec evaluate_handle(Worker.t(), function() | binary(), EvaluationArgument.t()) :: JSHandle.t() 11 | # def evaluate_handle(worker, page_function, arg \\ nil) 12 | 13 | # @spec expect_event(t(), binary(), function(), options()) :: map() 14 | # def expect_event(worker, event, predicate \\ nil, options \\ %{}) 15 | # ...delegate wait_for_event -> expect_event 16 | 17 | # on(...): 18 | # - close 19 | # @spec on(t(), binary(), function()) :: nil 20 | # def on(worker, event, callback) 21 | 22 | # @spec url(Worker.t()) :: binary() 23 | # def url(worker) 24 | end 25 | -------------------------------------------------------------------------------- /man/basics/debugging-tools.md: -------------------------------------------------------------------------------- 1 | # Debugging Tools 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/basics/getting-started.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | - [Release Notes](/basics-release-notes.html) 4 | - [System Requirements](#system-requirements) 5 | 6 | ## Installation 7 | 8 | The package can be installed by adding `playwright` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:playwright, "~> 1.18.0-alpha.1"} 14 | ] 15 | end 16 | ``` 17 | 18 | To ensure Playwright's runtime dependencies (e.g., browsers) are available, execute the following: 19 | 20 | ```bash 21 | $ mix playwright.install 22 | ``` 23 | 24 | ## Usage 25 | 26 | Once installed, you can `alias` and/or `import` Playwright in your Elixir module, and launch any of the 3 browsers (`chromium`, `firefox` and `webkit`). 27 | 28 | ```elixir 29 | {:ok, browser} = Playwright.launch(:chromium) 30 | page = 31 | browser |> Playwright.Browser.new_page() 32 | 33 | page 34 | |> Playwright.Page.goto("http://example.com") 35 | 36 | page 37 | |> Playwright.Page.title() 38 | |> IO.puts() 39 | 40 | browser 41 | |> Playwright.Browser.close() 42 | ``` 43 | 44 | ## System requirements 45 | 46 | TBD 47 | -------------------------------------------------------------------------------- /man/basics/inspector.md: -------------------------------------------------------------------------------- 1 | # Inspector 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/basics/release-notes.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | TBD (still in preview at the moment) 4 | -------------------------------------------------------------------------------- /man/basics/test-generator.md: -------------------------------------------------------------------------------- 1 | # Test Generator 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/basics/trace-viewer.md: -------------------------------------------------------------------------------- 1 | # Trace Viewer 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/assertions.md: -------------------------------------------------------------------------------- 1 | # Assertions 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/authentication.md: -------------------------------------------------------------------------------- 1 | # Authentication 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/auto-waiting.md: -------------------------------------------------------------------------------- 1 | # Auto-waiting 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/browser-contexts.md: -------------------------------------------------------------------------------- 1 | # Browser Contexts 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/browsers.md: -------------------------------------------------------------------------------- 1 | # Browsers 2 | 3 | ## Setting a custom user agent 4 | 5 | It's possible to set the user agent to a custom value via `BrowserContext` or `Browser` 6 | ### With Browser 7 | 8 | ```elixir 9 | page = Playwright.Browser.new_page(browser, %{"userAgent" => "My Custom Agent"}) 10 | ``` 11 | 12 | ### With BrowserContext 13 | 14 | ```elixir 15 | context = Browser.new_context(browser, %{"userAgent" => "Special Agent"}) 16 | ``` 17 | 18 | ## Custom Agent and Phoenix / Ecto 19 | 20 | Setting a custom agent can be particularly useful when running Playwright in tests with the database involved. 21 | 22 | Follow https://hexdocs.pm/phoenix_ecto/Phoenix.Ecto.SQL.Sandbox.html and set the `userAgent` to the result of `Phoenix.Ecto.SQL.Sandbox.metadata_for(YourApp.Repo, pid)` 23 | 24 | 25 | -------------------------------------------------------------------------------- /man/guides/chrome-extensions.md: -------------------------------------------------------------------------------- 1 | # Chrome Extensions 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/command-line-tools.md: -------------------------------------------------------------------------------- 1 | # Command-line Tools 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/dialogs.md: -------------------------------------------------------------------------------- 1 | # Dialogs 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/downloads.md: -------------------------------------------------------------------------------- 1 | # Downloads 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/emulation.md: -------------------------------------------------------------------------------- 1 | # Emulation 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/evaluating-javascript.md: -------------------------------------------------------------------------------- 1 | # Evaluating JavaScript 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/events.md: -------------------------------------------------------------------------------- 1 | # Events 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/extensibility.md: -------------------------------------------------------------------------------- 1 | # Extensibility 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/frames.md: -------------------------------------------------------------------------------- 1 | # Frames 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/handles.md: -------------------------------------------------------------------------------- 1 | # Handles 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/input.md: -------------------------------------------------------------------------------- 1 | # Input 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/locators.md: -------------------------------------------------------------------------------- 1 | # Locators 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/navigations.md: -------------------------------------------------------------------------------- 1 | # Navigations 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/network.md: -------------------------------------------------------------------------------- 1 | # Network 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/page-object-models.md: -------------------------------------------------------------------------------- 1 | # Page Object Models 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/pages.md: -------------------------------------------------------------------------------- 1 | # Pages 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/screenshots.md: -------------------------------------------------------------------------------- 1 | # Screenshots 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/selectors.md: -------------------------------------------------------------------------------- 1 | # Selectors 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/verification.md: -------------------------------------------------------------------------------- 1 | # Verification 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /man/guides/videos.md: -------------------------------------------------------------------------------- 1 | # Videos 2 | 3 | ... 4 | -------------------------------------------------------------------------------- /priv/static/driver.js: -------------------------------------------------------------------------------- 1 | node_modules/playwright/cli.js -------------------------------------------------------------------------------- /priv/static/node_modules/.bin/playwright: -------------------------------------------------------------------------------- 1 | ../playwright/cli.js -------------------------------------------------------------------------------- /priv/static/node_modules/.bin/playwright-core: -------------------------------------------------------------------------------- 1 | ../playwright-core/cli.js -------------------------------------------------------------------------------- /priv/static/node_modules/.package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "static", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": { 6 | "node_modules/fsevents": { 7 | "version": "2.3.2", 8 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 9 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 10 | "hasInstallScript": true, 11 | "optional": true, 12 | "os": [ 13 | "darwin" 14 | ], 15 | "engines": { 16 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 17 | } 18 | }, 19 | "node_modules/playwright": { 20 | "version": "1.49.1", 21 | "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", 22 | "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", 23 | "dependencies": { 24 | "playwright-core": "1.49.1" 25 | }, 26 | "bin": { 27 | "playwright": "cli.js" 28 | }, 29 | "engines": { 30 | "node": ">=18" 31 | }, 32 | "optionalDependencies": { 33 | "fsevents": "2.3.2" 34 | } 35 | }, 36 | "node_modules/playwright-core": { 37 | "version": "1.49.1", 38 | "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", 39 | "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", 40 | "bin": { 41 | "playwright-core": "cli.js" 42 | }, 43 | "engines": { 44 | "node": ">=18" 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /priv/static/node_modules/fsevents/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | ----------- 3 | 4 | Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /priv/static/node_modules/fsevents/fsevents.d.ts: -------------------------------------------------------------------------------- 1 | declare type Event = "created" | "cloned" | "modified" | "deleted" | "moved" | "root-changed" | "unknown"; 2 | declare type Type = "file" | "directory" | "symlink"; 3 | declare type FileChanges = { 4 | inode: boolean; 5 | finder: boolean; 6 | access: boolean; 7 | xattrs: boolean; 8 | }; 9 | declare type Info = { 10 | event: Event; 11 | path: string; 12 | type: Type; 13 | changes: FileChanges; 14 | flags: number; 15 | }; 16 | declare type WatchHandler = (path: string, flags: number, id: string) => void; 17 | export declare function watch(path: string, handler: WatchHandler): () => Promise; 18 | export declare function watch(path: string, since: number, handler: WatchHandler): () => Promise; 19 | export declare function getInfo(path: string, flags: number): Info; 20 | export declare const constants: { 21 | None: 0x00000000; 22 | MustScanSubDirs: 0x00000001; 23 | UserDropped: 0x00000002; 24 | KernelDropped: 0x00000004; 25 | EventIdsWrapped: 0x00000008; 26 | HistoryDone: 0x00000010; 27 | RootChanged: 0x00000020; 28 | Mount: 0x00000040; 29 | Unmount: 0x00000080; 30 | ItemCreated: 0x00000100; 31 | ItemRemoved: 0x00000200; 32 | ItemInodeMetaMod: 0x00000400; 33 | ItemRenamed: 0x00000800; 34 | ItemModified: 0x00001000; 35 | ItemFinderInfoMod: 0x00002000; 36 | ItemChangeOwner: 0x00004000; 37 | ItemXattrMod: 0x00008000; 38 | ItemIsFile: 0x00010000; 39 | ItemIsDir: 0x00020000; 40 | ItemIsSymlink: 0x00040000; 41 | ItemIsHardlink: 0x00100000; 42 | ItemIsLastHardlink: 0x00200000; 43 | OwnEvent: 0x00080000; 44 | ItemCloned: 0x00400000; 45 | }; 46 | export {}; 47 | -------------------------------------------------------------------------------- /priv/static/node_modules/fsevents/fsevents.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/priv/static/node_modules/fsevents/fsevents.node -------------------------------------------------------------------------------- /priv/static/node_modules/fsevents/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fsevents", 3 | "version": "2.3.2", 4 | "description": "Native Access to MacOS FSEvents", 5 | "main": "fsevents.js", 6 | "types": "fsevents.d.ts", 7 | "os": [ 8 | "darwin" 9 | ], 10 | "files": [ 11 | "fsevents.d.ts", 12 | "fsevents.js", 13 | "fsevents.node" 14 | ], 15 | "engines": { 16 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 17 | }, 18 | "scripts": { 19 | "clean": "node-gyp clean && rm -f fsevents.node", 20 | "build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean", 21 | "test": "/bin/bash ./test.sh 2>/dev/null", 22 | "prepublishOnly": "npm run build" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/fsevents/fsevents.git" 27 | }, 28 | "keywords": [ 29 | "fsevents", 30 | "mac" 31 | ], 32 | "contributors": [ 33 | { 34 | "name": "Philipp Dunkel", 35 | "email": "pip@pipobscure.com" 36 | }, 37 | { 38 | "name": "Ben Noordhuis", 39 | "email": "info@bnoordhuis.nl" 40 | }, 41 | { 42 | "name": "Elan Shankar", 43 | "email": "elan.shanker@gmail.com" 44 | }, 45 | { 46 | "name": "Miroslav Bajtoš", 47 | "email": "mbajtoss@gmail.com" 48 | }, 49 | { 50 | "name": "Paul Miller", 51 | "url": "https://paulmillr.com" 52 | } 53 | ], 54 | "license": "MIT", 55 | "bugs": { 56 | "url": "https://github.com/fsevents/fsevents/issues" 57 | }, 58 | "homepage": "https://github.com/fsevents/fsevents", 59 | "devDependencies": { 60 | "node-gyp": "^6.1.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/NOTICE: -------------------------------------------------------------------------------- 1 | Playwright 2 | Copyright (c) Microsoft Corporation 3 | 4 | This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), 5 | available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). 6 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/README.md: -------------------------------------------------------------------------------- 1 | # playwright-core 2 | 3 | This package contains the no-browser flavor of [Playwright](http://github.com/microsoft/playwright). 4 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/PrintDeps.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/priv/static/node_modules/playwright-core/bin/PrintDeps.exe -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/README.md: -------------------------------------------------------------------------------- 1 | See building instructions at [`/browser_patches/winldd/README.md`](../../../browser_patches/winldd/README.md) 2 | 3 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/install_media_pack.ps1: -------------------------------------------------------------------------------- 1 | $osInfo = Get-WmiObject -Class Win32_OperatingSystem 2 | # check if running on Windows Server 3 | if ($osInfo.ProductType -eq 3) { 4 | Install-WindowsFeature Server-Media-Foundation 5 | } 6 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | if [[ $(arch) == "aarch64" ]]; then 6 | echo "ERROR: not supported on Linux Arm64" 7 | exit 1 8 | fi 9 | 10 | if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then 11 | if [[ ! -f "/etc/os-release" ]]; then 12 | echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" 13 | exit 1 14 | fi 15 | 16 | ID=$(bash -c 'source /etc/os-release && echo $ID') 17 | if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then 18 | echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" 19 | exit 1 20 | fi 21 | fi 22 | 23 | # 1. make sure to remove old beta if any. 24 | if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then 25 | apt-get remove -y google-chrome-beta 26 | fi 27 | 28 | # 2. Update apt lists (needed to install curl and chrome dependencies) 29 | apt-get update 30 | 31 | # 3. Install curl to download chrome 32 | if ! command -v curl >/dev/null; then 33 | apt-get install -y curl 34 | fi 35 | 36 | # 4. download chrome beta from dl.google.com and install it. 37 | cd /tmp 38 | curl -O https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb 39 | apt-get install -y ./google-chrome-beta_current_amd64.deb 40 | rm -rf ./google-chrome-beta_current_amd64.deb 41 | cd - 42 | google-chrome-beta --version 43 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | rm -rf "/Applications/Google Chrome Beta.app" 6 | cd /tmp 7 | curl -o ./googlechromebeta.dmg -k https://dl.google.com/chrome/mac/universal/beta/googlechromebeta.dmg 8 | hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechromebeta.dmg ./googlechromebeta.dmg 9 | cp -pR "/Volumes/googlechromebeta.dmg/Google Chrome Beta.app" /Applications 10 | hdiutil detach /Volumes/googlechromebeta.dmg 11 | rm -rf /tmp/googlechromebeta.dmg 12 | 13 | /Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version 14 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | 3 | $url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi' 4 | 5 | Write-Host "Downloading Google Chrome Beta" 6 | $wc = New-Object net.webclient 7 | $msiInstaller = "$env:temp\google-chrome-beta.msi" 8 | $wc.Downloadfile($url, $msiInstaller) 9 | 10 | Write-Host "Installing Google Chrome Beta" 11 | $arguments = "/i `"$msiInstaller`" /quiet" 12 | Start-Process msiexec.exe -ArgumentList $arguments -Wait 13 | Remove-Item $msiInstaller 14 | 15 | $suffix = "\\Google\\Chrome Beta\\Application\\chrome.exe" 16 | if (Test-Path "${env:ProgramFiles(x86)}$suffix") { 17 | (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo 18 | } elseif (Test-Path "${env:ProgramFiles}$suffix") { 19 | (Get-Item "${env:ProgramFiles}$suffix").VersionInfo 20 | } else { 21 | Write-Host "ERROR: Failed to install Google Chrome Beta." 22 | Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | if [[ $(arch) == "aarch64" ]]; then 6 | echo "ERROR: not supported on Linux Arm64" 7 | exit 1 8 | fi 9 | 10 | if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then 11 | if [[ ! -f "/etc/os-release" ]]; then 12 | echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" 13 | exit 1 14 | fi 15 | 16 | ID=$(bash -c 'source /etc/os-release && echo $ID') 17 | if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then 18 | echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" 19 | exit 1 20 | fi 21 | fi 22 | 23 | # 1. make sure to remove old stable if any. 24 | if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then 25 | apt-get remove -y google-chrome 26 | fi 27 | 28 | # 2. Update apt lists (needed to install curl and chrome dependencies) 29 | apt-get update 30 | 31 | # 3. Install curl to download chrome 32 | if ! command -v curl >/dev/null; then 33 | apt-get install -y curl 34 | fi 35 | 36 | # 4. download chrome stable from dl.google.com and install it. 37 | cd /tmp 38 | curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 39 | apt-get install -y ./google-chrome-stable_current_amd64.deb 40 | rm -rf ./google-chrome-stable_current_amd64.deb 41 | cd - 42 | google-chrome --version 43 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | rm -rf "/Applications/Google Chrome.app" 6 | cd /tmp 7 | curl -o ./googlechrome.dmg -k https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg 8 | hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechrome.dmg ./googlechrome.dmg 9 | cp -pR "/Volumes/googlechrome.dmg/Google Chrome.app" /Applications 10 | hdiutil detach /Volumes/googlechrome.dmg 11 | rm -rf /tmp/googlechrome.dmg 12 | /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version 13 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | $url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi' 3 | 4 | $wc = New-Object net.webclient 5 | $msiInstaller = "$env:temp\google-chrome.msi" 6 | Write-Host "Downloading Google Chrome" 7 | $wc.Downloadfile($url, $msiInstaller) 8 | 9 | Write-Host "Installing Google Chrome" 10 | $arguments = "/i `"$msiInstaller`" /quiet" 11 | Start-Process msiexec.exe -ArgumentList $arguments -Wait 12 | Remove-Item $msiInstaller 13 | 14 | 15 | $suffix = "\\Google\\Chrome\\Application\\chrome.exe" 16 | if (Test-Path "${env:ProgramFiles(x86)}$suffix") { 17 | (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo 18 | } elseif (Test-Path "${env:ProgramFiles}$suffix") { 19 | (Get-Item "${env:ProgramFiles}$suffix").VersionInfo 20 | } else { 21 | Write-Host "ERROR: Failed to install Google Chrome." 22 | Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | if [[ $(arch) == "aarch64" ]]; then 7 | echo "ERROR: not supported on Linux Arm64" 8 | exit 1 9 | fi 10 | 11 | if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then 12 | if [[ ! -f "/etc/os-release" ]]; then 13 | echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" 14 | exit 1 15 | fi 16 | 17 | ID=$(bash -c 'source /etc/os-release && echo $ID') 18 | if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then 19 | echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" 20 | exit 1 21 | fi 22 | fi 23 | 24 | # 1. make sure to remove old beta if any. 25 | if dpkg --get-selections | grep -q "^microsoft-edge-beta[[:space:]]*install$" >/dev/null; then 26 | apt-get remove -y microsoft-edge-beta 27 | fi 28 | 29 | # 2. Install curl to download Microsoft gpg key 30 | if ! command -v curl >/dev/null; then 31 | apt-get update 32 | apt-get install -y curl 33 | fi 34 | 35 | # 3. Add the GPG key, the apt repo, update the apt cache, and install the package 36 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg 37 | install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ 38 | sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' 39 | rm /tmp/microsoft.gpg 40 | apt-get update && apt-get install -y microsoft-edge-beta 41 | 42 | microsoft-edge-beta --version 43 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | cd /tmp 6 | curl -o ./msedge_beta.pkg -k "$1" 7 | # Note: there's no way to uninstall previously installed MSEdge. 8 | # However, running PKG again seems to update installation. 9 | sudo installer -pkg /tmp/msedge_beta.pkg -target / 10 | rm -rf /tmp/msedge_beta.pkg 11 | /Applications/Microsoft\ Edge\ Beta.app/Contents/MacOS/Microsoft\ Edge\ Beta --version 12 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | $url = $args[0] 3 | 4 | Write-Host "Downloading Microsoft Edge Beta" 5 | $wc = New-Object net.webclient 6 | $msiInstaller = "$env:temp\microsoft-edge-beta.msi" 7 | $wc.Downloadfile($url, $msiInstaller) 8 | 9 | Write-Host "Installing Microsoft Edge Beta" 10 | $arguments = "/i `"$msiInstaller`" /quiet" 11 | Start-Process msiexec.exe -ArgumentList $arguments -Wait 12 | Remove-Item $msiInstaller 13 | 14 | $suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe" 15 | if (Test-Path "${env:ProgramFiles(x86)}$suffix") { 16 | (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo 17 | } elseif (Test-Path "${env:ProgramFiles}$suffix") { 18 | (Get-Item "${env:ProgramFiles}$suffix").VersionInfo 19 | } else { 20 | Write-Host "ERROR: Failed to install Microsoft Edge Beta." 21 | Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." 22 | exit 1 23 | } 24 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | if [[ $(arch) == "aarch64" ]]; then 7 | echo "ERROR: not supported on Linux Arm64" 8 | exit 1 9 | fi 10 | 11 | if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then 12 | if [[ ! -f "/etc/os-release" ]]; then 13 | echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" 14 | exit 1 15 | fi 16 | 17 | ID=$(bash -c 'source /etc/os-release && echo $ID') 18 | if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then 19 | echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" 20 | exit 1 21 | fi 22 | fi 23 | 24 | # 1. make sure to remove old dev if any. 25 | if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then 26 | apt-get remove -y microsoft-edge-dev 27 | fi 28 | 29 | # 2. Install curl to download Microsoft gpg key 30 | if ! command -v curl >/dev/null; then 31 | apt-get update 32 | apt-get install -y curl 33 | fi 34 | 35 | # 3. Add the GPG key, the apt repo, update the apt cache, and install the package 36 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg 37 | install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ 38 | sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' 39 | rm /tmp/microsoft.gpg 40 | apt-get update && apt-get install -y microsoft-edge-dev 41 | 42 | microsoft-edge-dev --version 43 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | cd /tmp 6 | curl -o ./msedge_dev.pkg -k "$1" 7 | # Note: there's no way to uninstall previously installed MSEdge. 8 | # However, running PKG again seems to update installation. 9 | sudo installer -pkg /tmp/msedge_dev.pkg -target / 10 | rm -rf /tmp/msedge_dev.pkg 11 | /Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev --version 12 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | $url = $args[0] 3 | 4 | Write-Host "Downloading Microsoft Edge Dev" 5 | $wc = New-Object net.webclient 6 | $msiInstaller = "$env:temp\microsoft-edge-dev.msi" 7 | $wc.Downloadfile($url, $msiInstaller) 8 | 9 | Write-Host "Installing Microsoft Edge Dev" 10 | $arguments = "/i `"$msiInstaller`" /quiet" 11 | Start-Process msiexec.exe -ArgumentList $arguments -Wait 12 | Remove-Item $msiInstaller 13 | 14 | $suffix = "\\Microsoft\\Edge Dev\\Application\\msedge.exe" 15 | if (Test-Path "${env:ProgramFiles(x86)}$suffix") { 16 | (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo 17 | } elseif (Test-Path "${env:ProgramFiles}$suffix") { 18 | (Get-Item "${env:ProgramFiles}$suffix").VersionInfo 19 | } else { 20 | Write-Host "ERROR: Failed to install Microsoft Edge Dev." 21 | Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." 22 | exit 1 23 | } 24 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | if [[ $(arch) == "aarch64" ]]; then 7 | echo "ERROR: not supported on Linux Arm64" 8 | exit 1 9 | fi 10 | 11 | if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then 12 | if [[ ! -f "/etc/os-release" ]]; then 13 | echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" 14 | exit 1 15 | fi 16 | 17 | ID=$(bash -c 'source /etc/os-release && echo $ID') 18 | if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then 19 | echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" 20 | exit 1 21 | fi 22 | fi 23 | 24 | # 1. make sure to remove old stable if any. 25 | if dpkg --get-selections | grep -q "^microsoft-edge-stable[[:space:]]*install$" >/dev/null; then 26 | apt-get remove -y microsoft-edge-stable 27 | fi 28 | 29 | # 2. Install curl to download Microsoft gpg key 30 | if ! command -v curl >/dev/null; then 31 | apt-get update 32 | apt-get install -y curl 33 | fi 34 | 35 | # 3. Add the GPG key, the apt repo, update the apt cache, and install the package 36 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg 37 | install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ 38 | sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list' 39 | rm /tmp/microsoft.gpg 40 | apt-get update && apt-get install -y microsoft-edge-stable 41 | 42 | microsoft-edge-stable --version 43 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | cd /tmp 6 | curl -o ./msedge_stable.pkg -k "$1" 7 | # Note: there's no way to uninstall previously installed MSEdge. 8 | # However, running PKG again seems to update installation. 9 | sudo installer -pkg /tmp/msedge_stable.pkg -target / 10 | rm -rf /tmp/msedge_stable.pkg 11 | /Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version 12 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | 3 | $url = $args[0] 4 | 5 | Write-Host "Downloading Microsoft Edge" 6 | $wc = New-Object net.webclient 7 | $msiInstaller = "$env:temp\microsoft-edge-stable.msi" 8 | $wc.Downloadfile($url, $msiInstaller) 9 | 10 | Write-Host "Installing Microsoft Edge" 11 | $arguments = "/i `"$msiInstaller`" /quiet" 12 | Start-Process msiexec.exe -ArgumentList $arguments -Wait 13 | Remove-Item $msiInstaller 14 | 15 | $suffix = "\\Microsoft\\Edge\\Application\\msedge.exe" 16 | if (Test-Path "${env:ProgramFiles(x86)}$suffix") { 17 | (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo 18 | } elseif (Test-Path "${env:ProgramFiles}$suffix") { 19 | (Get-Item "${env:ProgramFiles}$suffix").VersionInfo 20 | } else { 21 | Write-Host "ERROR: Failed to install Microsoft Edge." 22 | Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." 23 | exit 1 24 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/browsers.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "Do not edit this file, use utils/roll_browser.js", 3 | "browsers": [ 4 | { 5 | "name": "chromium", 6 | "revision": "1148", 7 | "installByDefault": true, 8 | "browserVersion": "131.0.6778.33" 9 | }, 10 | { 11 | "name": "chromium-headless-shell", 12 | "revision": "1148", 13 | "installByDefault": true, 14 | "browserVersion": "131.0.6778.33" 15 | }, 16 | { 17 | "name": "chromium-tip-of-tree", 18 | "revision": "1277", 19 | "installByDefault": false, 20 | "browserVersion": "132.0.6834.0" 21 | }, 22 | { 23 | "name": "firefox", 24 | "revision": "1466", 25 | "installByDefault": true, 26 | "browserVersion": "132.0" 27 | }, 28 | { 29 | "name": "firefox-beta", 30 | "revision": "1465", 31 | "installByDefault": false, 32 | "browserVersion": "132.0b8" 33 | }, 34 | { 35 | "name": "webkit", 36 | "revision": "2104", 37 | "installByDefault": true, 38 | "revisionOverrides": { 39 | "mac10.14": "1446", 40 | "mac10.15": "1616", 41 | "mac11": "1816", 42 | "mac11-arm64": "1816", 43 | "mac12": "2009", 44 | "mac12-arm64": "2009", 45 | "ubuntu20.04-x64": "2092", 46 | "ubuntu20.04-arm64": "2092" 47 | }, 48 | "browserVersion": "18.2" 49 | }, 50 | { 51 | "name": "ffmpeg", 52 | "revision": "1010", 53 | "installByDefault": true, 54 | "revisionOverrides": { 55 | "mac12": "1010", 56 | "mac12-arm64": "1010" 57 | } 58 | }, 59 | { 60 | "name": "android", 61 | "revision": "1001", 62 | "installByDefault": false 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | const { program } = require('./lib/cli/programWithTestStub'); 18 | program.parse(process.argv); 19 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export * from './types/types'; 18 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | const minimumMajorNodeVersion = 14; 17 | const currentNodeVersion = process.versions.node; 18 | const semver = currentNodeVersion.split('.'); 19 | const [major] = [+semver[0]]; 20 | 21 | if (major < minimumMajorNodeVersion) { 22 | // eslint-disable-next-line no-console 23 | console.error( 24 | 'You are running Node.js ' + 25 | currentNodeVersion + 26 | '.\n' + 27 | `Playwright requires Node.js ${minimumMajorNodeVersion} or higher. \n` + 28 | 'Please update your version of Node.js.' 29 | ); 30 | process.exit(1); 31 | } 32 | 33 | module.exports = require('./lib/inprocess'); 34 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/index.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import playwright from './index.js'; 18 | 19 | export const chromium = playwright.chromium; 20 | export const firefox = playwright.firefox; 21 | export const webkit = playwright.webkit; 22 | export const selectors = playwright.selectors; 23 | export const devices = playwright.devices; 24 | export const errors = playwright.errors; 25 | export const request = playwright.request; 26 | export const _electron = playwright._electron; 27 | export const _android = playwright._android; 28 | export default playwright; 29 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/accessibility.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Accessibility = void 0; 7 | /** 8 | * Copyright 2017 Google Inc. All rights reserved. 9 | * Modifications copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | function axNodeFromProtocol(axNode) { 25 | const result = { 26 | ...axNode, 27 | value: axNode.valueNumber !== undefined ? axNode.valueNumber : axNode.valueString, 28 | checked: axNode.checked === 'checked' ? true : axNode.checked === 'unchecked' ? false : axNode.checked, 29 | pressed: axNode.pressed === 'pressed' ? true : axNode.pressed === 'released' ? false : axNode.pressed, 30 | children: axNode.children ? axNode.children.map(axNodeFromProtocol) : undefined 31 | }; 32 | delete result.valueNumber; 33 | delete result.valueString; 34 | return result; 35 | } 36 | class Accessibility { 37 | constructor(channel) { 38 | this._channel = void 0; 39 | this._channel = channel; 40 | } 41 | async snapshot(options = {}) { 42 | const root = options.root ? options.root._elementChannel : undefined; 43 | const result = await this._channel.accessibilitySnapshot({ 44 | interestingOnly: options.interestingOnly, 45 | root 46 | }); 47 | return result.rootAXNode ? axNodeFromProtocol(result.rootAXNode) : null; 48 | } 49 | } 50 | exports.Accessibility = Accessibility; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/cdpSession.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.CDPSession = void 0; 7 | var _channelOwner = require("./channelOwner"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class CDPSession extends _channelOwner.ChannelOwner { 25 | static from(cdpSession) { 26 | return cdpSession._object; 27 | } 28 | constructor(parent, type, guid, initializer) { 29 | super(parent, type, guid, initializer); 30 | this._channel.on('event', ({ 31 | method, 32 | params 33 | }) => { 34 | this.emit(method, params); 35 | }); 36 | this.on = super.on; 37 | this.addListener = super.addListener; 38 | this.off = super.removeListener; 39 | this.removeListener = super.removeListener; 40 | this.once = super.once; 41 | } 42 | async send(method, params) { 43 | const result = await this._channel.send({ 44 | method, 45 | params 46 | }); 47 | return result.result; 48 | } 49 | async detach() { 50 | return await this._channel.detach(); 51 | } 52 | } 53 | exports.CDPSession = CDPSession; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/clientInstrumentation.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.createInstrumentation = createInstrumentation; 7 | /** 8 | * Copyright (c) Microsoft Corporation. All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | function createInstrumentation() { 24 | const listeners = []; 25 | return new Proxy({}, { 26 | get: (obj, prop) => { 27 | if (typeof prop !== 'string') return obj[prop]; 28 | if (prop === 'addListener') return listener => listeners.push(listener); 29 | if (prop === 'removeListener') return listener => listeners.splice(listeners.indexOf(listener), 1); 30 | if (prop === 'removeAllListeners') return () => listeners.splice(0, listeners.length); 31 | if (prop.startsWith('run')) { 32 | return async (...params) => { 33 | for (const listener of listeners) { 34 | var _prop, _ref; 35 | await ((_prop = (_ref = listener)[prop]) === null || _prop === void 0 ? void 0 : _prop.call(_ref, ...params)); 36 | } 37 | }; 38 | } 39 | if (prop.startsWith('on')) { 40 | return (...params) => { 41 | for (const listener of listeners) { 42 | var _prop2, _ref2; 43 | (_prop2 = (_ref2 = listener)[prop]) === null || _prop2 === void 0 || _prop2.call(_ref2, ...params); 44 | } 45 | }; 46 | } 47 | return obj[prop]; 48 | } 49 | }); 50 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/coverage.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Coverage = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class Coverage { 24 | constructor(channel) { 25 | this._channel = void 0; 26 | this._channel = channel; 27 | } 28 | async startJSCoverage(options = {}) { 29 | await this._channel.startJSCoverage(options); 30 | } 31 | async stopJSCoverage() { 32 | return (await this._channel.stopJSCoverage()).entries; 33 | } 34 | async startCSSCoverage(options = {}) { 35 | await this._channel.startCSSCoverage(options); 36 | } 37 | async stopCSSCoverage() { 38 | return (await this._channel.stopCSSCoverage()).entries; 39 | } 40 | } 41 | exports.Coverage = Coverage; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/dialog.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Dialog = void 0; 7 | var _channelOwner = require("./channelOwner"); 8 | var _page = require("./page"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | class Dialog extends _channelOwner.ChannelOwner { 26 | static from(dialog) { 27 | return dialog._object; 28 | } 29 | constructor(parent, type, guid, initializer) { 30 | super(parent, type, guid, initializer); 31 | // Note: dialogs that open early during page initialization block it. 32 | // Therefore, we must report the dialog without a page to be able to handle it. 33 | this._page = void 0; 34 | this._page = _page.Page.fromNullable(initializer.page); 35 | } 36 | page() { 37 | return this._page; 38 | } 39 | type() { 40 | return this._initializer.type; 41 | } 42 | message() { 43 | return this._initializer.message; 44 | } 45 | defaultValue() { 46 | return this._initializer.defaultValue; 47 | } 48 | async accept(promptText) { 49 | await this._channel.accept({ 50 | promptText 51 | }); 52 | } 53 | async dismiss() { 54 | await this._channel.dismiss(); 55 | } 56 | } 57 | exports.Dialog = Dialog; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/download.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Download = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class Download { 24 | constructor(page, url, suggestedFilename, artifact) { 25 | this._page = void 0; 26 | this._url = void 0; 27 | this._suggestedFilename = void 0; 28 | this._artifact = void 0; 29 | this._page = page; 30 | this._url = url; 31 | this._suggestedFilename = suggestedFilename; 32 | this._artifact = artifact; 33 | } 34 | page() { 35 | return this._page; 36 | } 37 | url() { 38 | return this._url; 39 | } 40 | suggestedFilename() { 41 | return this._suggestedFilename; 42 | } 43 | async path() { 44 | return await this._artifact.pathAfterFinished(); 45 | } 46 | async saveAs(path) { 47 | return await this._artifact.saveAs(path); 48 | } 49 | async failure() { 50 | return await this._artifact.failure(); 51 | } 52 | async createReadStream() { 53 | return await this._artifact.createReadStream(); 54 | } 55 | async cancel() { 56 | return await this._artifact.cancel(); 57 | } 58 | async delete() { 59 | return await this._artifact.delete(); 60 | } 61 | } 62 | exports.Download = Download; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/fileChooser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.FileChooser = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class FileChooser { 24 | constructor(page, elementHandle, isMultiple) { 25 | this._page = void 0; 26 | this._elementHandle = void 0; 27 | this._isMultiple = void 0; 28 | this._page = page; 29 | this._elementHandle = elementHandle; 30 | this._isMultiple = isMultiple; 31 | } 32 | element() { 33 | return this._elementHandle; 34 | } 35 | isMultiple() { 36 | return this._isMultiple; 37 | } 38 | page() { 39 | return this._page; 40 | } 41 | async setFiles(files, options) { 42 | return await this._elementHandle.setInputFiles(files, options); 43 | } 44 | } 45 | exports.FileChooser = FileChooser; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/jsonPipe.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.JsonPipe = void 0; 7 | var _channelOwner = require("./channelOwner"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class JsonPipe extends _channelOwner.ChannelOwner { 25 | static from(jsonPipe) { 26 | return jsonPipe._object; 27 | } 28 | constructor(parent, type, guid, initializer) { 29 | super(parent, type, guid, initializer); 30 | } 31 | channel() { 32 | return this._channel; 33 | } 34 | } 35 | exports.JsonPipe = JsonPipe; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/localUtils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.LocalUtils = void 0; 7 | var _channelOwner = require("./channelOwner"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class LocalUtils extends _channelOwner.ChannelOwner { 25 | constructor(parent, type, guid, initializer) { 26 | super(parent, type, guid, initializer); 27 | this.devices = void 0; 28 | this.markAsInternalType(); 29 | this.devices = {}; 30 | for (const { 31 | name, 32 | descriptor 33 | } of initializer.deviceDescriptors) this.devices[name] = descriptor; 34 | } 35 | } 36 | exports.LocalUtils = LocalUtils; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/stream.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Stream = void 0; 7 | var _stream = require("stream"); 8 | var _channelOwner = require("./channelOwner"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | class Stream extends _channelOwner.ChannelOwner { 26 | static from(Stream) { 27 | return Stream._object; 28 | } 29 | constructor(parent, type, guid, initializer) { 30 | super(parent, type, guid, initializer); 31 | } 32 | stream() { 33 | return new StreamImpl(this._channel); 34 | } 35 | } 36 | exports.Stream = Stream; 37 | class StreamImpl extends _stream.Readable { 38 | constructor(channel) { 39 | super(); 40 | this._channel = void 0; 41 | this._channel = channel; 42 | } 43 | async _read() { 44 | const result = await this._channel.read({ 45 | size: 1024 * 1024 46 | }); 47 | if (result.binary.byteLength) this.push(result.binary);else this.push(null); 48 | } 49 | _destroy(error, callback) { 50 | // Stream might be destroyed after the connection was closed. 51 | this._channel.close().catch(e => null); 52 | super._destroy(error, callback); 53 | } 54 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.kLifecycleEvents = void 0; 7 | /** 8 | * Copyright 2018 Google Inc. All rights reserved. 9 | * Modifications copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | const kLifecycleEvents = exports.kLifecycleEvents = new Set(['load', 'domcontentloaded', 'networkidle', 'commit']); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/video.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Video = void 0; 7 | var _utils = require("../utils"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class Video { 25 | constructor(page, connection) { 26 | this._artifact = null; 27 | this._artifactReadyPromise = new _utils.ManualPromise(); 28 | this._isRemote = false; 29 | this._isRemote = connection.isRemote(); 30 | this._artifact = page._closedOrCrashedScope.safeRace(this._artifactReadyPromise); 31 | } 32 | _artifactReady(artifact) { 33 | this._artifactReadyPromise.resolve(artifact); 34 | } 35 | async path() { 36 | if (this._isRemote) throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`); 37 | const artifact = await this._artifact; 38 | if (!artifact) throw new Error('Page did not produce any video frames'); 39 | return artifact._initializer.absolutePath; 40 | } 41 | async saveAs(path) { 42 | const artifact = await this._artifact; 43 | if (!artifact) throw new Error('Page did not produce any video frames'); 44 | return await artifact.saveAs(path); 45 | } 46 | async delete() { 47 | const artifact = await this._artifact; 48 | if (artifact) await artifact.delete(); 49 | } 50 | } 51 | exports.Video = Video; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/webError.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.WebError = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class WebError { 24 | constructor(page, error) { 25 | this._page = void 0; 26 | this._error = void 0; 27 | this._page = page; 28 | this._error = error; 29 | } 30 | page() { 31 | return this._page; 32 | } 33 | error() { 34 | return this._error; 35 | } 36 | } 37 | exports.WebError = WebError; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/client/writableStream.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.WritableStream = void 0; 7 | var _stream = require("stream"); 8 | var _channelOwner = require("./channelOwner"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | class WritableStream extends _channelOwner.ChannelOwner { 26 | static from(Stream) { 27 | return Stream._object; 28 | } 29 | constructor(parent, type, guid, initializer) { 30 | super(parent, type, guid, initializer); 31 | } 32 | stream() { 33 | return new WritableStreamImpl(this._channel); 34 | } 35 | } 36 | exports.WritableStream = WritableStream; 37 | class WritableStreamImpl extends _stream.Writable { 38 | constructor(channel) { 39 | super(); 40 | this._channel = void 0; 41 | this._channel = channel; 42 | } 43 | async _write(chunk, encoding, callback) { 44 | const error = await this._channel.write({ 45 | binary: typeof chunk === 'string' ? Buffer.from(chunk) : chunk 46 | }).catch(e => e); 47 | callback(error || null); 48 | } 49 | async _final(callback) { 50 | // Stream might be destroyed after the connection was closed. 51 | const error = await this._channel.close().catch(e => e); 52 | callback(error || null); 53 | } 54 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/common/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/inprocess.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _inProcessFactory = require("./inProcessFactory"); 4 | /** 5 | * Copyright (c) Microsoft Corporation. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the 'License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | module.exports = (0, _inProcessFactory.createInProcessPlaywright)(); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/ariaSnapshot.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.parseAriaSnapshot = parseAriaSnapshot; 7 | exports.parseYamlForAriaSnapshot = parseYamlForAriaSnapshot; 8 | var _ariaSnapshot = require("../utils/isomorphic/ariaSnapshot"); 9 | var _utilsBundle = require("../utilsBundle"); 10 | /** 11 | * Copyright (c) Microsoft Corporation. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | function parseAriaSnapshot(text) { 27 | return (0, _ariaSnapshot.parseYamlTemplate)(parseYamlForAriaSnapshot(text)); 28 | } 29 | function parseYamlForAriaSnapshot(text) { 30 | const parsed = _utilsBundle.yaml.parse(text); 31 | if (!Array.isArray(parsed)) throw new Error('Expected object key starting with "- ":\n\n' + text + '\n'); 32 | return parsed; 33 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/chromium/appIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/priv/static/node_modules/playwright-core/lib/server/chromium/appIcon.png -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/codegen/jsonl.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.JsonlLanguageGenerator = void 0; 7 | var _utils = require("../../utils"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class JsonlLanguageGenerator { 25 | constructor() { 26 | this.id = 'jsonl'; 27 | this.groupName = ''; 28 | this.name = 'JSONL'; 29 | this.highlighter = 'javascript'; 30 | } 31 | generateAction(actionInContext) { 32 | const locator = actionInContext.action.selector ? JSON.parse((0, _utils.asLocator)('jsonl', actionInContext.action.selector)) : undefined; 33 | const entry = { 34 | ...actionInContext.action, 35 | pageAlias: actionInContext.frame.pageAlias, 36 | locator 37 | }; 38 | return JSON.stringify(entry); 39 | } 40 | generateHeader(options) { 41 | return JSON.stringify(options); 42 | } 43 | generateFooter(saveStorage) { 44 | return ''; 45 | } 46 | } 47 | exports.JsonlLanguageGenerator = JsonlLanguageGenerator; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/codegen/languages.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.languageSet = languageSet; 7 | var _java = require("./java"); 8 | var _javascript = require("./javascript"); 9 | var _jsonl = require("./jsonl"); 10 | var _csharp = require("./csharp"); 11 | var _python = require("./python"); 12 | /** 13 | * Copyright (c) Microsoft Corporation. 14 | * 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * 19 | * http://www.apache.org/licenses/LICENSE-2.0 20 | * 21 | * Unless required by applicable law or agreed to in writing, software 22 | * distributed under the License is distributed on an "AS IS" BASIS, 23 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | * See the License for the specific language governing permissions and 25 | * limitations under the License. 26 | */ 27 | 28 | function languageSet() { 29 | return new Set([new _java.JavaLanguageGenerator('junit'), new _java.JavaLanguageGenerator('library'), new _javascript.JavaScriptLanguageGenerator( /* isPlaywrightTest */false), new _javascript.JavaScriptLanguageGenerator( /* isPlaywrightTest */true), new _python.PythonLanguageGenerator( /* isAsync */false, /* isPytest */true), new _python.PythonLanguageGenerator( /* isAsync */false, /* isPytest */false), new _python.PythonLanguageGenerator( /* isAsync */true, /* isPytest */false), new _csharp.CSharpLanguageGenerator('mstest'), new _csharp.CSharpLanguageGenerator('nunit'), new _csharp.CSharpLanguageGenerator('library'), new _jsonl.JsonlLanguageGenerator()]); 30 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/codegen/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/console.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.ConsoleMessage = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class ConsoleMessage { 24 | constructor(page, type, text, args, location) { 25 | this._type = void 0; 26 | this._text = void 0; 27 | this._args = void 0; 28 | this._location = void 0; 29 | this._page = void 0; 30 | this._page = page; 31 | this._type = type; 32 | this._text = text; 33 | this._args = args; 34 | this._location = location || { 35 | url: '', 36 | lineNumber: 0, 37 | columnNumber: 0 38 | }; 39 | } 40 | page() { 41 | return this._page; 42 | } 43 | type() { 44 | return this._type; 45 | } 46 | text() { 47 | if (this._text === undefined) this._text = this._args.map(arg => arg.preview()).join(' '); 48 | return this._text; 49 | } 50 | args() { 51 | return this._args; 52 | } 53 | location() { 54 | return this._location; 55 | } 56 | } 57 | exports.ConsoleMessage = ConsoleMessage; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/deviceDescriptors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.deviceDescriptors = void 0; 7 | var _deviceDescriptorsSource = _interopRequireDefault(require("./deviceDescriptorsSource.json")); 8 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 9 | /** 10 | * Copyright 2017 Google Inc. All rights reserved. 11 | * Modifications copyright (c) Microsoft Corporation. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | const deviceDescriptors = exports.deviceDescriptors = _deviceDescriptorsSource.default; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.CDPSessionDispatcher = void 0; 7 | var _crConnection = require("../chromium/crConnection"); 8 | var _dispatcher = require("./dispatcher"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the 'License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | class CDPSessionDispatcher extends _dispatcher.Dispatcher { 26 | constructor(scope, cdpSession) { 27 | super(scope, cdpSession, 'CDPSession', {}); 28 | this._type_CDPSession = true; 29 | this.addObjectListener(_crConnection.CDPSession.Events.Event, ({ 30 | method, 31 | params 32 | }) => this._dispatchEvent('event', { 33 | method, 34 | params 35 | })); 36 | this.addObjectListener(_crConnection.CDPSession.Events.Closed, () => this._dispose()); 37 | } 38 | async send(params) { 39 | return { 40 | result: await this._object.send(params.method, params.params) 41 | }; 42 | } 43 | async detach(_, metadata) { 44 | metadata.potentiallyClosesScope = true; 45 | await this._object.detach(); 46 | } 47 | } 48 | exports.CDPSessionDispatcher = CDPSessionDispatcher; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.DialogDispatcher = void 0; 7 | var _dispatcher = require("./dispatcher"); 8 | var _pageDispatcher = require("./pageDispatcher"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the 'License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | class DialogDispatcher extends _dispatcher.Dispatcher { 26 | constructor(scope, dialog) { 27 | const page = _pageDispatcher.PageDispatcher.fromNullable(scope, dialog.page().initializedOrUndefined()); 28 | // Prefer scoping to the page, unless we don't have one. 29 | super(page || scope, dialog, 'Dialog', { 30 | page, 31 | type: dialog.type(), 32 | message: dialog.message(), 33 | defaultValue: dialog.defaultValue() 34 | }); 35 | this._type_Dialog = true; 36 | } 37 | async accept(params) { 38 | await this._object.accept(params.promptText); 39 | } 40 | async dismiss() { 41 | await this._object.dismiss(); 42 | } 43 | } 44 | exports.DialogDispatcher = DialogDispatcher; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.JsonPipeDispatcher = void 0; 7 | var _dispatcher = require("./dispatcher"); 8 | var _utils = require("../../utils"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the 'License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | class JsonPipeDispatcher extends _dispatcher.Dispatcher { 26 | constructor(scope) { 27 | super(scope, { 28 | guid: 'jsonPipe@' + (0, _utils.createGuid)() 29 | }, 'JsonPipe', {}); 30 | this._type_JsonPipe = true; 31 | } 32 | async send(params) { 33 | this.emit('message', params.message); 34 | } 35 | async close() { 36 | this.emit('close'); 37 | if (!this._disposed) { 38 | this._dispatchEvent('closed', {}); 39 | this._dispose(); 40 | } 41 | } 42 | dispatch(message) { 43 | if (!this._disposed) this._dispatchEvent('message', { 44 | message 45 | }); 46 | } 47 | wasClosed(reason) { 48 | if (!this._disposed) { 49 | this._dispatchEvent('closed', { 50 | reason 51 | }); 52 | this._dispose(); 53 | } 54 | } 55 | dispose() { 56 | this._dispose(); 57 | } 58 | } 59 | exports.JsonPipeDispatcher = JsonPipeDispatcher; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/dispatchers/selectorsDispatcher.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.SelectorsDispatcher = void 0; 7 | var _dispatcher = require("./dispatcher"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the 'License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class SelectorsDispatcher extends _dispatcher.Dispatcher { 25 | constructor(scope, selectors) { 26 | super(scope, selectors, 'Selectors', {}); 27 | this._type_Selectors = true; 28 | } 29 | async register(params) { 30 | await this._object.register(params.name, params.source, params.contentScript); 31 | } 32 | async setTestIdAttributeName(params) { 33 | this._object.setTestIdAttributeName(params.testIdAttributeName); 34 | } 35 | } 36 | exports.SelectorsDispatcher = SelectorsDispatcher; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/fileChooser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.FileChooser = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class FileChooser { 24 | constructor(page, elementHandle, isMultiple) { 25 | this._page = void 0; 26 | this._elementHandle = void 0; 27 | this._isMultiple = void 0; 28 | this._page = page; 29 | this._elementHandle = elementHandle; 30 | this._isMultiple = isMultiple; 31 | } 32 | element() { 33 | return this._elementHandle; 34 | } 35 | isMultiple() { 36 | return this._isMultiple; 37 | } 38 | page() { 39 | return this._page; 40 | } 41 | } 42 | exports.FileChooser = FileChooser; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/protocolError.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.ProtocolError = void 0; 7 | exports.isProtocolError = isProtocolError; 8 | exports.isSessionClosedError = isSessionClosedError; 9 | var _stackTrace = require("../utils/stackTrace"); 10 | /** 11 | * Copyright (c) Microsoft Corporation. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | class ProtocolError extends Error { 27 | constructor(type, method, logs) { 28 | super(); 29 | this.type = void 0; 30 | this.method = void 0; 31 | this.logs = void 0; 32 | this.type = type; 33 | this.method = method; 34 | this.logs = logs; 35 | } 36 | setMessage(message) { 37 | (0, _stackTrace.rewriteErrorMessage)(this, `Protocol error (${this.method}): ${message}`); 38 | } 39 | browserLogMessage() { 40 | return this.logs ? '\nBrowser logs:\n' + this.logs : ''; 41 | } 42 | } 43 | exports.ProtocolError = ProtocolError; 44 | function isProtocolError(e) { 45 | return e instanceof ProtocolError; 46 | } 47 | function isSessionClosedError(e) { 48 | return e instanceof ProtocolError && (e.type === 'closed' || e.type === 'crashed'); 49 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/recorder/recorderFrontend.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/server/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.kLifecycleEvents = void 0; 7 | /** 8 | * Copyright 2018 Google Inc. All rights reserved. 9 | * Modifications copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | const kLifecycleEvents = exports.kLifecycleEvents = new Set(['load', 'domcontentloaded', 'networkidle', 'commit']); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/ascii.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.jsonStringifyForceASCII = jsonStringifyForceASCII; 7 | exports.wrapInASCIIBox = wrapInASCIIBox; 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | function wrapInASCIIBox(text, padding = 0) { 25 | const lines = text.split('\n'); 26 | const maxLength = Math.max(...lines.map(line => line.length)); 27 | return ['╔' + '═'.repeat(maxLength + padding * 2) + '╗', ...lines.map(line => '║' + ' '.repeat(padding) + line + ' '.repeat(maxLength - line.length + padding) + '║'), '╚' + '═'.repeat(maxLength + padding * 2) + '╝'].join('\n'); 28 | } 29 | function jsonStringifyForceASCII(object) { 30 | return JSON.stringify(object).replace(/[\u007f-\uffff]/g, c => '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4)); 31 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/debug.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.assert = assert; 7 | exports.debugAssert = debugAssert; 8 | exports.debugMode = debugMode; 9 | exports.isUnderTest = isUnderTest; 10 | exports.setUnderTest = setUnderTest; 11 | var _env = require("./env"); 12 | /** 13 | * Copyright (c) Microsoft Corporation. 14 | * 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * 19 | * http://www.apache.org/licenses/LICENSE-2.0 20 | * 21 | * Unless required by applicable law or agreed to in writing, software 22 | * distributed under the License is distributed on an "AS IS" BASIS, 23 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | * See the License for the specific language governing permissions and 25 | * limitations under the License. 26 | */ 27 | 28 | function assert(value, message) { 29 | if (!value) throw new Error(message || 'Assertion error'); 30 | } 31 | function debugAssert(value, message) { 32 | if (isUnderTest() && !value) throw new Error(message); 33 | } 34 | const debugEnv = (0, _env.getFromENV)('PWDEBUG') || ''; 35 | function debugMode() { 36 | if (debugEnv === 'console') return 'console'; 37 | if (debugEnv === '0' || debugEnv === 'false') return ''; 38 | return debugEnv ? 'inspector' : ''; 39 | } 40 | let _isUnderTest = !!process.env.PWTEST_UNDER_TEST; 41 | function setUnderTest() { 42 | _isUnderTest = true; 43 | } 44 | function isUnderTest() { 45 | return _isUnderTest; 46 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/env.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.getAsBooleanFromENV = getAsBooleanFromENV; 7 | exports.getFromENV = getFromENV; 8 | exports.getPackageManager = getPackageManager; 9 | exports.getPackageManagerExecCommand = getPackageManagerExecCommand; 10 | /** 11 | * Copyright (c) Microsoft Corporation. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | function getFromENV(name) { 27 | let value = process.env[name]; 28 | value = value === undefined ? process.env[`npm_config_${name.toLowerCase()}`] : value; 29 | value = value === undefined ? process.env[`npm_package_config_${name.toLowerCase()}`] : value; 30 | return value; 31 | } 32 | function getAsBooleanFromENV(name, defaultValue) { 33 | const value = getFromENV(name); 34 | if (value === 'false' || value === '0') return false; 35 | if (value) return true; 36 | return !!defaultValue; 37 | } 38 | function getPackageManager() { 39 | const env = process.env.npm_config_user_agent || ''; 40 | if (env.includes('yarn')) return 'yarn'; 41 | if (env.includes('pnpm')) return 'pnpm'; 42 | return 'npm'; 43 | } 44 | function getPackageManagerExecCommand() { 45 | const packageManager = getPackageManager(); 46 | if (packageManager === 'yarn') return 'yarn'; 47 | if (packageManager === 'pnpm') return 'pnpm exec'; 48 | return 'npx'; 49 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/eventsHelper.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.eventsHelper = void 0; 7 | /** 8 | * Copyright 2017 Google Inc. All rights reserved. 9 | * Modifications copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class EventsHelper { 25 | static addEventListener(emitter, eventName, handler) { 26 | emitter.on(eventName, handler); 27 | return { 28 | emitter, 29 | eventName, 30 | handler 31 | }; 32 | } 33 | static removeEventListeners(listeners) { 34 | for (const listener of listeners) listener.emitter.removeListener(listener.eventName, listener.handler); 35 | listeners.splice(0, listeners.length); 36 | } 37 | } 38 | const eventsHelper = exports.eventsHelper = EventsHelper; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/expectUtils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.serializeExpectedTextValues = serializeExpectedTextValues; 7 | var _rtti = require("./rtti"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | function serializeExpectedTextValues(items, options = {}) { 25 | return items.map(i => ({ 26 | string: (0, _rtti.isString)(i) ? i : undefined, 27 | regexSource: (0, _rtti.isRegExp)(i) ? i.source : undefined, 28 | regexFlags: (0, _rtti.isRegExp)(i) ? i.flags : undefined, 29 | matchSubstring: options.matchSubstring, 30 | ignoreCase: options.ignoreCase, 31 | normalizeWhiteSpace: options.normalizeWhiteSpace 32 | })); 33 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/headers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.headersArrayToObject = headersArrayToObject; 7 | exports.headersObjectToArray = headersObjectToArray; 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | function headersObjectToArray(headers, separator, setCookieSeparator) { 25 | if (!setCookieSeparator) setCookieSeparator = separator; 26 | const result = []; 27 | for (const name in headers) { 28 | const values = headers[name]; 29 | if (values === undefined) continue; 30 | if (separator) { 31 | const sep = name.toLowerCase() === 'set-cookie' ? setCookieSeparator : separator; 32 | for (const value of values.split(sep)) result.push({ 33 | name, 34 | value: value.trim() 35 | }); 36 | } else { 37 | result.push({ 38 | name, 39 | value: values 40 | }); 41 | } 42 | } 43 | return result; 44 | } 45 | function headersArrayToObject(headers, lowerCase) { 46 | const result = {}; 47 | for (const { 48 | name, 49 | value 50 | } of headers) result[lowerCase ? name.toLowerCase() : name] = value; 51 | return result; 52 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.isJsonMimeType = isJsonMimeType; 7 | exports.isTextualMimeType = isTextualMimeType; 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | function isJsonMimeType(mimeType) { 25 | return !!mimeType.match(/^(application\/json|application\/.*?\+json|text\/(x-)?json)(;\s*charset=.*)?$/); 26 | } 27 | function isTextualMimeType(mimeType) { 28 | return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/); 29 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.parseClientSideCallMetadata = parseClientSideCallMetadata; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | function parseClientSideCallMetadata(data) { 24 | const result = new Map(); 25 | const { 26 | files, 27 | stacks 28 | } = data; 29 | for (const s of stacks) { 30 | const [id, ff] = s; 31 | result.set(`call@${id}`, ff.map(f => ({ 32 | file: files[f[0]], 33 | line: f[1], 34 | column: f[2], 35 | function: f[3] 36 | }))); 37 | } 38 | return result; 39 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/rtti.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.isError = isError; 7 | exports.isLikelyNpxGlobal = void 0; 8 | exports.isObject = isObject; 9 | exports.isRegExp = isRegExp; 10 | Object.defineProperty(exports, "isString", { 11 | enumerable: true, 12 | get: function () { 13 | return _stringUtils.isString; 14 | } 15 | }); 16 | var _stringUtils = require("./isomorphic/stringUtils"); 17 | /** 18 | * Copyright (c) Microsoft Corporation. 19 | * 20 | * Licensed under the Apache License, Version 2.0 (the "License"); 21 | * you may not use this file except in compliance with the License. 22 | * You may obtain a copy of the License at 23 | * 24 | * http://www.apache.org/licenses/LICENSE-2.0 25 | * 26 | * Unless required by applicable law or agreed to in writing, software 27 | * distributed under the License is distributed on an "AS IS" BASIS, 28 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | * See the License for the specific language governing permissions and 30 | * limitations under the License. 31 | */ 32 | 33 | function isRegExp(obj) { 34 | return obj instanceof RegExp || Object.prototype.toString.call(obj) === '[object RegExp]'; 35 | } 36 | function isObject(obj) { 37 | return typeof obj === 'object' && obj !== null; 38 | } 39 | function isError(obj) { 40 | var _Object$getPrototypeO; 41 | return obj instanceof Error || obj && ((_Object$getPrototypeO = Object.getPrototypeOf(obj)) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name) === 'Error'; 42 | } 43 | const isLikelyNpxGlobal = () => process.argv.length >= 2 && process.argv[1].includes('_npx'); 44 | exports.isLikelyNpxGlobal = isLikelyNpxGlobal; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/semaphore.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Semaphore = void 0; 7 | var _manualPromise = require("./manualPromise"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class Semaphore { 25 | constructor(max) { 26 | this._max = void 0; 27 | this._acquired = 0; 28 | this._queue = []; 29 | this._max = max; 30 | } 31 | setMax(max) { 32 | this._max = max; 33 | } 34 | acquire() { 35 | const lock = new _manualPromise.ManualPromise(); 36 | this._queue.push(lock); 37 | this._flush(); 38 | return lock; 39 | } 40 | release() { 41 | --this._acquired; 42 | this._flush(); 43 | } 44 | _flush() { 45 | while (this._acquired < this._max && this._queue.length) { 46 | ++this._acquired; 47 | this._queue.shift().resolve(); 48 | } 49 | } 50 | } 51 | exports.Semaphore = Semaphore; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/spawnAsync.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.spawnAsync = spawnAsync; 7 | var _child_process = require("child_process"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | function spawnAsync(cmd, args, options = {}) { 25 | const process = (0, _child_process.spawn)(cmd, args, Object.assign({ 26 | windowsHide: true 27 | }, options)); 28 | return new Promise(resolve => { 29 | let stdout = ''; 30 | let stderr = ''; 31 | if (process.stdout) process.stdout.on('data', data => stdout += data.toString()); 32 | if (process.stderr) process.stderr.on('data', data => stderr += data.toString()); 33 | process.on('close', code => resolve({ 34 | stdout, 35 | stderr, 36 | code 37 | })); 38 | process.on('error', error => resolve({ 39 | stdout, 40 | stderr, 41 | code: 0, 42 | error 43 | })); 44 | }); 45 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/time.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.monotonicTime = monotonicTime; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | // The `process.hrtime()` returns a time from some arbitrary 24 | // date in the past; on certain systems, this is the time from the system boot. 25 | // The `monotonicTime()` converts this to milliseconds. 26 | // 27 | // For a Linux server with uptime of 36 days, the `monotonicTime()` value 28 | // will be 36 * 86400 * 1000 = 3_110_400_000, which is larger than 29 | // the maximum value that `setTimeout` accepts as an argument: 2_147_483_647. 30 | // 31 | // To make the `monotonicTime()` a reasonable value, we anchor 32 | // it to the time of the first import of this utility. 33 | const initialTime = process.hrtime(); 34 | function monotonicTime() { 35 | const [seconds, nanoseconds] = process.hrtime(initialTime); 36 | return seconds * 1000 + (nanoseconds / 1000 | 0) / 1000; 37 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/utils/traceUtils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.serializeClientSideCallMetadata = serializeClientSideCallMetadata; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | function serializeClientSideCallMetadata(metadatas) { 24 | const fileNames = new Map(); 25 | const stacks = []; 26 | for (const m of metadatas) { 27 | if (!m.stack || !m.stack.length) continue; 28 | const stack = []; 29 | for (const frame of m.stack) { 30 | let ordinal = fileNames.get(frame.file); 31 | if (typeof ordinal !== 'number') { 32 | ordinal = fileNames.size; 33 | fileNames.set(frame.file, ordinal); 34 | } 35 | const stackFrame = [ordinal, frame.line || 0, frame.column || 0, frame.function || '']; 36 | stack.push(stackFrame); 37 | } 38 | stacks.push([m.id, stack]); 39 | } 40 | return { 41 | files: [...fileNames.keys()], 42 | stacks 43 | }; 44 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/recorder/index.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Playwright Inspector 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/priv/static/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/embedded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Playwright Trace Viewer for VS Code 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/embedded.w7WN2u1R.css: -------------------------------------------------------------------------------- 1 | .empty-state{display:flex;align-items:center;justify-content:center;flex:auto;flex-direction:column;background-color:var(--vscode-editor-background);position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;line-height:24px}body .empty-state{background:#fffc}body.dark-mode .empty-state{background:#000c}.empty-state .title{font-size:24px;font-weight:700;margin-bottom:30px}.progress{flex:none;width:100%;height:3px;z-index:10}.inner-progress{background-color:var(--vscode-progressBar-background);height:100%}.workbench-loader{contain:size}html,body{min-width:550px;min-height:450px;overflow:auto} 2 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/index.CrbWWHbf.css: -------------------------------------------------------------------------------- 1 | .drop-target{display:flex;align-items:center;justify-content:center;flex:auto;flex-direction:column;background-color:var(--vscode-editor-background);position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;line-height:24px}body .drop-target{background:#fffc}body.dark-mode .drop-target{background:#000c}.drop-target .title{font-size:24px;font-weight:700;margin-bottom:30px}.drop-target .processing-error{font-size:24px;color:#e74c3c;font-weight:700;text-align:center;margin:30px}.drop-target input{margin-top:50px}.drop-target button{color:#fff;background-color:#007acc;padding:8px 12px;border:none;margin:30px 0;cursor:pointer}.progress{flex:none;width:100%;height:3px;margin-top:-3px;z-index:10}.inner-progress{background-color:var(--vscode-progressBar-background);height:100%}.header{display:flex;background-color:#000;flex:none;flex-basis:48px;line-height:48px;font-size:16px;color:#ccc}.workbench-loader{contain:size}.workbench-loader .header .toolbar-button{margin:12px;padding:8px 4px}.workbench-loader .logo{margin-left:16px;display:flex;align-items:center}.workbench-loader .logo img{height:32px;width:32px;pointer-events:none;flex:none}.workbench-loader .product{font-weight:600;margin-left:16px;flex:none}.workbench-loader .header .title{margin-left:16px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}html,body{min-width:550px;min-height:450px;overflow:auto} 2 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/recorder.B_SY1GJM.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/priv/static/node_modules/playwright-core/lib/vite/traceViewer/recorder.B_SY1GJM.css -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/recorder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Playwright Recorder 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Playwright Test 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/lib/zipBundle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.yazl = exports.yauzl = exports.extract = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | const yazl = exports.yazl = require('./zipBundleImpl').yazl; 24 | const yauzl = exports.yauzl = require('./zipBundleImpl').yauzl; 25 | const extract = exports.extract = require('./zipBundleImpl').extract; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "playwright-core", 3 | "version": "1.49.1", 4 | "description": "A high-level API to automate web browsers", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/microsoft/playwright.git" 8 | }, 9 | "homepage": "https://playwright.dev", 10 | "engines": { 11 | "node": ">=18" 12 | }, 13 | "author": { 14 | "name": "Microsoft Corporation" 15 | }, 16 | "license": "Apache-2.0", 17 | "exports": { 18 | ".": { 19 | "types": "./index.d.ts", 20 | "import": "./index.mjs", 21 | "require": "./index.js", 22 | "default": "./index.js" 23 | }, 24 | "./package.json": "./package.json", 25 | "./lib/outofprocess": "./lib/outofprocess.js", 26 | "./lib/image_tools/stats": "./lib/image_tools/stats.js", 27 | "./lib/image_tools/compare": "./lib/image_tools/compare.js", 28 | "./lib/image_tools/imageChannel": "./lib/image_tools/imageChannel.js", 29 | "./lib/image_tools/colorUtils": "./lib/image_tools/colorUtils.js", 30 | "./lib/cli/program": "./lib/cli/program.js", 31 | "./lib/server/registry/index": "./lib/server/registry/index.js", 32 | "./lib/remote/playwrightServer": "./lib/remote/playwrightServer.js", 33 | "./lib/server": "./lib/server/index.js", 34 | "./lib/utils": "./lib/utils/index.js", 35 | "./lib/utilsBundle": "./lib/utilsBundle.js", 36 | "./lib/zipBundle": "./lib/zipBundle.js", 37 | "./types/protocol": "./types/protocol.d.ts", 38 | "./types/structs": "./types/structs.d.ts" 39 | }, 40 | "bin": { 41 | "playwright-core": "cli.js" 42 | }, 43 | "types": "types/types.d.ts" 44 | } 45 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc-with-ts-config.js', 3 | rules: { 4 | '@typescript-eslint/no-floating-promises': 'error', 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/NOTICE: -------------------------------------------------------------------------------- 1 | Playwright 2 | Copyright (c) Microsoft Corporation 3 | 4 | This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), 5 | available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). 6 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /** 3 | * Copyright (c) Microsoft Corporation. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | const { program } = require('./lib/program'); 19 | program.parse(process.argv); 20 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export * from 'playwright-core'; 18 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | module.exports = require('playwright-core'); 18 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/index.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export * from 'playwright-core'; 17 | import playwright from 'playwright-core'; 18 | export default playwright; 19 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/jsx-runtime.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | function jsx(type, props, key) { 18 | return { 19 | __pw_type: 'jsx', 20 | type, 21 | props, 22 | key, 23 | }; 24 | } 25 | 26 | function jsxs(type, props, key) { 27 | return { 28 | __pw_type: 'jsx', 29 | type, 30 | props, 31 | key, 32 | }; 33 | } 34 | 35 | // this is used in <> notation 36 | const Fragment = { __pw_jsx_fragment: true }; 37 | 38 | module.exports = { 39 | Fragment, 40 | jsx, 41 | jsxs, 42 | }; 43 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/jsx-runtime.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import jsxRuntime from './jsx-runtime.js'; 18 | 19 | export const jsx = jsxRuntime.jsx; 20 | export const jsxs = jsxRuntime.jsxs; 21 | export const Fragment = jsxRuntime.Fragment; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/common/expectBundle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.printReceived = exports.mock = exports.matcherUtils = exports.expect = exports.asymmetricMatchers = exports.RECEIVED_COLOR = exports.INVERTED_COLOR = exports.EXPECTED_COLOR = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | const expect = exports.expect = require('./expectBundleImpl').expect; 24 | const mock = exports.mock = require('./expectBundleImpl').mock; 25 | const asymmetricMatchers = exports.asymmetricMatchers = require('./expectBundleImpl').asymmetricMatchers; 26 | const matcherUtils = exports.matcherUtils = require('./expectBundleImpl').matcherUtils; 27 | const EXPECTED_COLOR = exports.EXPECTED_COLOR = require('./expectBundleImpl').EXPECTED_COLOR; 28 | const INVERTED_COLOR = exports.INVERTED_COLOR = require('./expectBundleImpl').INVERTED_COLOR; 29 | const RECEIVED_COLOR = exports.RECEIVED_COLOR = require('./expectBundleImpl').RECEIVED_COLOR; 30 | const printReceived = exports.printReceived = require('./expectBundleImpl').printReceived; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/common/globals.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.currentTestInfo = currentTestInfo; 7 | exports.currentlyLoadingFileSuite = currentlyLoadingFileSuite; 8 | exports.isWorkerProcess = isWorkerProcess; 9 | exports.setCurrentTestInfo = setCurrentTestInfo; 10 | exports.setCurrentlyLoadingFileSuite = setCurrentlyLoadingFileSuite; 11 | exports.setIsWorkerProcess = setIsWorkerProcess; 12 | /** 13 | * Copyright Microsoft Corporation. All rights reserved. 14 | * 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * 19 | * http://www.apache.org/licenses/LICENSE-2.0 20 | * 21 | * Unless required by applicable law or agreed to in writing, software 22 | * distributed under the License is distributed on an "AS IS" BASIS, 23 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | * See the License for the specific language governing permissions and 25 | * limitations under the License. 26 | */ 27 | 28 | let currentTestInfoValue = null; 29 | function setCurrentTestInfo(testInfo) { 30 | currentTestInfoValue = testInfo; 31 | } 32 | function currentTestInfo() { 33 | return currentTestInfoValue; 34 | } 35 | let currentFileSuite; 36 | function setCurrentlyLoadingFileSuite(suite) { 37 | currentFileSuite = suite; 38 | } 39 | function currentlyLoadingFileSuite() { 40 | return currentFileSuite; 41 | } 42 | let _isWorkerProcess = false; 43 | function setIsWorkerProcess() { 44 | _isWorkerProcess = true; 45 | } 46 | function isWorkerProcess() { 47 | return _isWorkerProcess; 48 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/common/ipc.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.serializeConfig = serializeConfig; 7 | exports.stdioChunkToParams = stdioChunkToParams; 8 | var _util = _interopRequireDefault(require("util")); 9 | var _compilationCache = require("../transform/compilationCache"); 10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 11 | /** 12 | * Copyright Microsoft Corporation. All rights reserved. 13 | * 14 | * Licensed under the Apache License, Version 2.0 (the "License"); 15 | * you may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at 17 | * 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | function serializeConfig(config, passCompilationCache) { 28 | const result = { 29 | location: { 30 | configDir: config.configDir, 31 | resolvedConfigFile: config.config.configFile 32 | }, 33 | configCLIOverrides: config.configCLIOverrides, 34 | compilationCache: passCompilationCache ? (0, _compilationCache.serializeCompilationCache)() : undefined 35 | }; 36 | return result; 37 | } 38 | function stdioChunkToParams(chunk) { 39 | if (chunk instanceof Uint8Array) return { 40 | buffer: Buffer.from(chunk).toString('base64') 41 | }; 42 | if (typeof chunk !== 'string') return { 43 | text: _util.default.inspect(chunk) 44 | }; 45 | return { 46 | text: chunk 47 | }; 48 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/internalsForTest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.fileDependencies = fileDependencies; 7 | var _path = _interopRequireDefault(require("path")); 8 | var _compilationCache = require("./transform/compilationCache"); 9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10 | /** 11 | * Copyright (c) Microsoft Corporation. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | function fileDependencies() { 27 | return Object.fromEntries([...(0, _compilationCache.fileDependenciesForTest)().entries()].map(entry => [_path.default.basename(entry[0]), [...entry[1]].map(f => _path.default.basename(f)).sort()])); 28 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/isomorphic/folders.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.artifactsFolderName = artifactsFolderName; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | function artifactsFolderName(workerIndex) { 24 | return `.playwright-artifacts-${workerIndex}`; 25 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/isomorphic/stringInternPool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.StringInternPool = exports.JsonStringInternalizer = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class StringInternPool { 24 | constructor() { 25 | this._stringCache = new Map(); 26 | } 27 | internString(s) { 28 | let result = this._stringCache.get(s); 29 | if (!result) { 30 | this._stringCache.set(s, s); 31 | result = s; 32 | } 33 | return result; 34 | } 35 | } 36 | exports.StringInternPool = StringInternPool; 37 | class JsonStringInternalizer { 38 | constructor(pool) { 39 | this._pool = void 0; 40 | this._pool = pool; 41 | } 42 | traverse(value) { 43 | if (typeof value !== 'object') return; 44 | if (Array.isArray(value)) { 45 | for (let i = 0; i < value.length; i++) { 46 | if (typeof value[i] === 'string') value[i] = this.intern(value[i]);else this.traverse(value[i]); 47 | } 48 | } else { 49 | for (const name in value) { 50 | if (typeof value[name] === 'string') value[name] = this.intern(value[name]);else this.traverse(value[name]); 51 | } 52 | } 53 | } 54 | intern(value) { 55 | return this._pool.internString(value); 56 | } 57 | } 58 | exports.JsonStringInternalizer = JsonStringInternalizer; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/isomorphic/testServerInterface.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/plugins/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | Object.defineProperty(exports, "gitCommitInfo", { 7 | enumerable: true, 8 | get: function () { 9 | return _gitCommitInfoPlugin.gitCommitInfo; 10 | } 11 | }); 12 | Object.defineProperty(exports, "webServer", { 13 | enumerable: true, 14 | get: function () { 15 | return _webServerPlugin.webServer; 16 | } 17 | }); 18 | var _webServerPlugin = require("./webServerPlugin"); 19 | var _gitCommitInfoPlugin = require("./gitCommitInfoPlugin"); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/reporters/empty.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | class EmptyReporter { 24 | version() { 25 | return 'v2'; 26 | } 27 | printsToStdio() { 28 | return false; 29 | } 30 | } 31 | var _default = exports.default = EmptyReporter; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/reporters/versions/blobV1.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/runner/uiModeReporter.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | var _teleEmitter = require("../reporters/teleEmitter"); 8 | /** 9 | * Copyright (c) Microsoft Corporation. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | class UIModeReporter extends _teleEmitter.TeleReporterEmitter { 25 | constructor(options) { 26 | super(options._send, { 27 | omitBuffers: true 28 | }); 29 | } 30 | } 31 | var _default = exports.default = UIModeReporter; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/transform/babelBundle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.types = exports.traverse = exports.declare = exports.codeFrameColumns = exports.babelTransform = exports.babelParse = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | const codeFrameColumns = exports.codeFrameColumns = require('./babelBundleImpl').codeFrameColumns; 24 | const declare = exports.declare = require('./babelBundleImpl').declare; 25 | const types = exports.types = require('./babelBundleImpl').types; 26 | const traverse = exports.traverse = require('./babelBundleImpl').traverse; 27 | const babelTransform = exports.babelTransform = require('./babelBundleImpl').babelTransform; 28 | const babelParse = exports.babelParse = require('./babelBundleImpl').babelParse; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/transform/esmUtils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.execArgvWithExperimentalLoaderOptions = execArgvWithExperimentalLoaderOptions; 7 | exports.execArgvWithoutExperimentalLoaderOptions = execArgvWithoutExperimentalLoaderOptions; 8 | var _url = _interopRequireDefault(require("url")); 9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10 | /** 11 | * Copyright (c) Microsoft Corporation. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | const kExperimentalLoaderOptions = ['--no-warnings', `--experimental-loader=${_url.default.pathToFileURL(require.resolve('playwright/lib/transform/esmLoader')).toString()}`]; 27 | function execArgvWithExperimentalLoaderOptions() { 28 | return [...process.execArgv, ...kExperimentalLoaderOptions]; 29 | } 30 | function execArgvWithoutExperimentalLoaderOptions() { 31 | return process.execArgv.filter(arg => !kExperimentalLoaderOptions.includes(arg)); 32 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/utilsBundle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.stoppable = exports.sourceMapSupport = exports.pirates = exports.json5 = exports.getEastAsianWidth = exports.enquirer = exports.chokidar = void 0; 7 | /** 8 | * Copyright (c) Microsoft Corporation. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | const json5 = exports.json5 = require('./utilsBundleImpl').json5; 24 | const pirates = exports.pirates = require('./utilsBundleImpl').pirates; 25 | const sourceMapSupport = exports.sourceMapSupport = require('./utilsBundleImpl').sourceMapSupport; 26 | const stoppable = exports.stoppable = require('./utilsBundleImpl').stoppable; 27 | const enquirer = exports.enquirer = require('./utilsBundleImpl').enquirer; 28 | const chokidar = exports.chokidar = require('./utilsBundleImpl').chokidar; 29 | const getEastAsianWidth = exports.getEastAsianWidth = require('./utilsBundleImpl').getEastAsianWidth; -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/lib/worker/util.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.testInfoError = testInfoError; 7 | var _matcherHint = require("../matchers/matcherHint"); 8 | var _util = require("../util"); 9 | /** 10 | * Copyright (c) Microsoft Corporation. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | function testInfoError(error) { 26 | const result = (0, _util.serializeError)(error); 27 | if (error instanceof _matcherHint.ExpectError) result.matcherResult = error.matcherResult; 28 | return result; 29 | } -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "playwright", 3 | "version": "1.49.1", 4 | "description": "A high-level API to automate web browsers", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/microsoft/playwright.git" 8 | }, 9 | "homepage": "https://playwright.dev", 10 | "engines": { 11 | "node": ">=18" 12 | }, 13 | "main": "index.js", 14 | "exports": { 15 | ".": { 16 | "types": "./index.d.ts", 17 | "import": "./index.mjs", 18 | "require": "./index.js", 19 | "default": "./index.js" 20 | }, 21 | "./package.json": "./package.json", 22 | "./lib/common/configLoader": "./lib/common/configLoader.js", 23 | "./lib/fsWatcher": "./lib/fsWatcher.js", 24 | "./lib/program": "./lib/program.js", 25 | "./lib/transform/babelBundle": "./lib/transform/babelBundle.js", 26 | "./lib/transform/compilationCache": "./lib/transform/compilationCache.js", 27 | "./lib/transform/esmLoader": "./lib/transform/esmLoader.js", 28 | "./lib/transform/transform": "./lib/transform/transform.js", 29 | "./lib/internalsForTest": "./lib/internalsForTest.js", 30 | "./lib/plugins": "./lib/plugins/index.js", 31 | "./jsx-runtime": { 32 | "import": "./jsx-runtime.mjs", 33 | "require": "./jsx-runtime.js", 34 | "default": "./jsx-runtime.js" 35 | }, 36 | "./lib/util": "./lib/util.js", 37 | "./lib/utilsBundle": "./lib/utilsBundle.js", 38 | "./types/test": { 39 | "types": "./types/test.d.ts" 40 | }, 41 | "./types/testReporter": { 42 | "types": "./types/testReporter.d.ts" 43 | }, 44 | "./test": { 45 | "types": "./test.d.ts", 46 | "import": "./test.mjs", 47 | "require": "./test.js", 48 | "default": "./test.js" 49 | } 50 | }, 51 | "bin": { 52 | "playwright": "cli.js" 53 | }, 54 | "author": { 55 | "name": "Microsoft Corporation" 56 | }, 57 | "license": "Apache-2.0", 58 | "dependencies": { 59 | "playwright-core": "1.49.1" 60 | }, 61 | "optionalDependencies": { 62 | "fsevents": "2.3.2" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/test.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export * from './types/test'; 18 | export { default } from './types/test'; 19 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const pwt = require('./lib/index'); 18 | const playwright = require('./index'); 19 | const combinedExports = { 20 | ...playwright, 21 | ...pwt, 22 | }; 23 | 24 | module.exports = Object.assign(combinedExports.test, combinedExports); 25 | -------------------------------------------------------------------------------- /priv/static/node_modules/playwright/test.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import playwright from './test.js'; 18 | 19 | export const chromium = playwright.chromium; 20 | export const firefox = playwright.firefox; 21 | export const webkit = playwright.webkit; 22 | export const selectors = playwright.selectors; 23 | export const devices = playwright.devices; 24 | export const errors = playwright.errors; 25 | export const request = playwright.request; 26 | export const _electron = playwright._electron; 27 | export const _android = playwright._android; 28 | export const test = playwright.test; 29 | export const expect = playwright.expect; 30 | export const defineConfig = playwright.defineConfig; 31 | export const mergeTests = playwright.mergeTests; 32 | export const mergeExpects = playwright.mergeExpects; 33 | export default playwright.test; 34 | -------------------------------------------------------------------------------- /priv/static/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "static", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "dependencies": { 8 | "playwright": "1.49.1" 9 | }, 10 | "engines": { 11 | "node": ">=16" 12 | } 13 | }, 14 | "node_modules/fsevents": { 15 | "version": "2.3.2", 16 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 17 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 18 | "hasInstallScript": true, 19 | "optional": true, 20 | "os": [ 21 | "darwin" 22 | ], 23 | "engines": { 24 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 25 | } 26 | }, 27 | "node_modules/playwright": { 28 | "version": "1.49.1", 29 | "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", 30 | "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", 31 | "dependencies": { 32 | "playwright-core": "1.49.1" 33 | }, 34 | "bin": { 35 | "playwright": "cli.js" 36 | }, 37 | "engines": { 38 | "node": ">=18" 39 | }, 40 | "optionalDependencies": { 41 | "fsevents": "2.3.2" 42 | } 43 | }, 44 | "node_modules/playwright-core": { 45 | "version": "1.49.1", 46 | "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", 47 | "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", 48 | "bin": { 49 | "playwright-core": "cli.js" 50 | }, 51 | "engines": { 52 | "node": ">=18" 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /priv/static/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines": { 3 | "node": ">=16" 4 | }, 5 | "dependencies": { 6 | "playwright": "1.49.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/api/README.md: -------------------------------------------------------------------------------- 1 | # On API Tests 2 | 3 | These generally follow the structure and definitions as found in the playwright-python package. 4 | 5 | ## An Optimistic List of Exceptions 6 | -------------------------------------------------------------------------------- /test/api/browser_context/add_cookies_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.AddCookiesTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{BrowserContext, Page} 4 | 5 | describe "BrowserContext.add_cookies/2" do 6 | test "adds cookies, readable by Page", %{assets: assets, page: page} do 7 | context = Page.owned_context(page) 8 | page |> Page.goto(assets.empty) 9 | 10 | context 11 | |> BrowserContext.add_cookies([ 12 | %{url: assets.empty, name: "password", value: "123456"} 13 | ]) 14 | 15 | assert Page.evaluate(page, "() => document.cookie") == "password=123456" 16 | end 17 | 18 | # test_should_roundtrip_cookie 19 | # test_should_send_cookie_header 20 | # test_should_isolate_cookies_in_browser_contexts 21 | # test_should_isolate_session_cookies 22 | # test_should_isolate_persistent_cookies 23 | # test_should_isolate_send_cookie_header 24 | # test_should_isolate_cookies_between_launches 25 | # test_should_set_multiple_cookies 26 | # test_should_have_expires_set_to_neg_1_for_session_cookies 27 | # test_should_set_cookie_with_reasonable_defaults 28 | # test_should_set_a_cookie_with_a_path 29 | # test_should_not_set_a_cookie_with_blank_page_url 30 | # test_should_not_set_a_cookie_on_a_data_url_page 31 | # test_should_default_to_setting_secure_cookie_for_https_websites 32 | # test_should_be_able_to_set_unsecure_cookie_for_http_website 33 | # test_should_set_a_cookie_on_a_different_domain 34 | # test_should_set_cookies_for_a_frame 35 | # test_should_not_block_third_party_cookies 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/api/browser_context/clear_cookies_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.ClearCookiesTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{BrowserContext, Page} 4 | 5 | describe "BrowserContext.clear_cookies/1" do 6 | test "clears cookies for the context", %{assets: assets, page: page} do 7 | context = Page.owned_context(page) 8 | page |> Page.goto(assets.empty) 9 | 10 | BrowserContext.add_cookies(context, [%{url: assets.empty, name: "cookie1", value: "one"}]) 11 | assert Page.evaluate(page, "document.cookie") == "cookie1=one" 12 | 13 | BrowserContext.clear_cookies(context) 14 | assert BrowserContext.cookies(context) == [] 15 | 16 | Page.reload(page) 17 | assert Page.evaluate(page, "document.cookie") == "" 18 | end 19 | 20 | # test_should_isolate_cookies_when_clearing 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/api/browser_context/cookies_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.CookiesTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{BrowserContext, Page} 4 | 5 | describe "BrowserContext.cookies/1" do 6 | test "retrieves no cookies from a pristine context", %{page: page} do 7 | cookies = BrowserContext.cookies(page.owned_context) 8 | assert cookies == [] 9 | end 10 | 11 | test "retrieves cookies for the context", %{assets: assets, page: page} do 12 | context = Page.owned_context(page) 13 | page |> Page.goto(assets.empty) 14 | 15 | cookie = 16 | page 17 | |> Page.evaluate(""" 18 | () => { 19 | document.cookie = "username=Jane"; 20 | return document.cookie; 21 | } 22 | """) 23 | 24 | assert cookie == "username=Jane" 25 | 26 | assert BrowserContext.cookies(context) == [ 27 | %{ 28 | domain: "localhost", 29 | expires: -1, 30 | httpOnly: false, 31 | name: "username", 32 | path: "/assets", 33 | sameSite: "Lax", 34 | secure: false, 35 | value: "Jane" 36 | } 37 | ] 38 | end 39 | 40 | # test_should_get_a_non_session_cookie 41 | # test_should_properly_report_httpOnly_cookie 42 | # test_should_properly_report_strict_sameSite_cookie 43 | # test_should_properly_report_lax_sameSite_cookie 44 | # test_should_get_multiple_cookies 45 | # test_should_get_cookies_from_multiple_urls 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /test/api/browser_context/expect_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.ExpectTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{Browser, BrowserContext, Page} 4 | 5 | describe "BrowserContext.expect_*/*" do 6 | # NOTE: skipping while everything is in transition 7 | @tag exclude: [:page] 8 | @tag :skip 9 | test ".expect_page/3", %{assets: assets, browser: browser} do 10 | context = Browser.new_context(browser) 11 | page = BrowserContext.new_page(context) 12 | 13 | %{params: params} = 14 | BrowserContext.expect_page(context, fn -> 15 | Page.evaluate(page, "url => window.open(url)", assets.empty) 16 | end) 17 | 18 | assert Page.url(params.page) == assets.empty 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/api/browser_context/network_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.NetworkTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{Browser, BrowserContext, Page} 4 | 5 | describe "BrowserContext network events" do 6 | @tag without: [:page] 7 | test "on :request", %{assets: assets, browser: browser} do 8 | this = self() 9 | 10 | context = Browser.new_context(browser) 11 | page = BrowserContext.new_page(context) 12 | 13 | BrowserContext.on(context, "request", fn %{params: %{request: request}} -> 14 | send(this, request.url) 15 | end) 16 | 17 | page |> Page.goto(assets.prefix <> "/empty.html") 18 | page |> Page.set_content("yo") 19 | 20 | BrowserContext.expect_event(context, "page", fn -> 21 | page |> Page.click("a") 22 | end) 23 | 24 | assert %Page{} = Page.wait_for_load_state(page) 25 | 26 | recv_1 = assets.empty 27 | recv_2 = assets.prefix <> "/one-style.html" 28 | # recv_3 = assets.prefix <> "/one-style.css" 29 | 30 | assert_received(^recv_1) 31 | assert_received(^recv_2) 32 | # assert_received(^recv_3) 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /test/api/browser_context/proxy_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.ProxyTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{Browser, BrowserContext, Page, Response} 4 | 5 | describe "BrowserContext created with a proxy" do 6 | @tag exclude: [:page] 7 | test "uses the proxy", %{assets: assets, browser: browser} do 8 | context = 9 | Browser.new_context(browser, %{ 10 | proxy: %{server: assets.prefix} 11 | }) 12 | 13 | page = BrowserContext.new_page(context) 14 | response = Page.goto(page, "http://non-existent.com/assets/dom.html") 15 | 16 | assert Response.ok(response) 17 | assert Page.text_content(page, "#inner") == "Text,\nmore text" 18 | end 19 | 20 | # test_should_use_proxy_for_second_page 21 | # test_should_work_with_ip_port_notion 22 | # test_should_authenticate 23 | # test_should_authenticate_with_empty_password 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/api/browser_context/storage_state_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserContext.StorageStateTest do 2 | use Playwright.TestCase, async: true 3 | 4 | # test_should_capture_local_storage 5 | # test_should_set_local_storage 6 | # test_should_round_trip_through_the_file 7 | end 8 | -------------------------------------------------------------------------------- /test/api/browser_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{Browser, BrowserContext, Page} 4 | 5 | describe "Browser.close/1" do 6 | @tag exclude: [:page] 7 | test "is callable twice", %{transport: transport} do 8 | {_session, inline_browser} = setup_browser(transport) 9 | assert :ok = Browser.close(inline_browser) 10 | assert :ok = Browser.close(inline_browser) 11 | end 12 | end 13 | 14 | describe "Browser.new_page/1" do 15 | @tag exclude: [:page] 16 | test "builds a new Page, incl. context", %{browser: browser} do 17 | assert [] = Browser.contexts(browser) 18 | 19 | page1 = Browser.new_page(browser) 20 | assert [%BrowserContext{}] = Browser.contexts(browser) 21 | 22 | page2 = Browser.new_page(browser) 23 | assert [%BrowserContext{}, %BrowserContext{}] = Browser.contexts(browser) 24 | 25 | Page.close(page1) 26 | assert [%BrowserContext{}] = Browser.contexts(browser) 27 | 28 | Page.close(page2) 29 | assert [] = Browser.contexts(browser) 30 | end 31 | 32 | test "raises an exception upon additional call to `new_page`", %{page: page} do 33 | assert_raise RuntimeError, "Please use Playwright.Browser.new_context/1", fn -> 34 | page 35 | |> Playwright.Page.context() 36 | |> Playwright.BrowserContext.new_page() 37 | end 38 | end 39 | end 40 | 41 | describe "Browser.version/1" do 42 | test "returns the expected version", %{browser: browser} do 43 | case browser.name do 44 | "chromium" -> 45 | assert %{major: major, minor: _, patch: _} = Version.parse!(browser.version) 46 | assert major >= 90 47 | 48 | _name -> 49 | assert %{major: _, minor: _} = Version.parse!(browser.version) 50 | end 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /test/api/browser_type/connect_cdp_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserType.ConnectCDPTest do 2 | use Playwright.TestCase, async: true 3 | 4 | # test_connect_to_an_existing_cdp_session 5 | # test_connect_to_an_existing_cdp_session_twice 6 | # test_conect_over_a_ws_endpoint 7 | end 8 | -------------------------------------------------------------------------------- /test/api/browser_type/connect_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.BrowserType.ConnectTest do 2 | use Playwright.TestCase, async: true 3 | 4 | # test_browser_type_connect_should_be_able_to_reconnect_to_a_browser 5 | # test_browser_type_connect_should_be_able_to_connect_two_browsers_at_the_same_time 6 | # test_browser_type_connect_disconnected_event_should_be_emitted_when_browser_is_closed_or_server_is_closed 7 | # test_browser_type_connect_disconnected_event_should_be_emitted_when_remote_killed_connection 8 | # test_browser_type_disconnected_event_should_have_browser_as_argument 9 | # test_browser_type_connect_set_browser_connected_state 10 | # test_browser_type_connect_should_throw_when_used_after_is_connected_returns_false 11 | # test_browser_type_connect_should_reject_navigation_when_browser_closes 12 | # test_should_not_allow_getting_the_path 13 | # test_prevent_getting_video_path 14 | # test_connect_to_closed_server_without_hangs 15 | end 16 | -------------------------------------------------------------------------------- /test/api/check_test.exs: -------------------------------------------------------------------------------- 1 | # test_check_the_box(page): 2 | # test_not_check_the_checked_box(page): 3 | # test_uncheck_the_box(page): 4 | # test_not_uncheck_the_unchecked_box(page): 5 | # test_check_the_box_by_label(page): 6 | # test_check_the_box_outside_label(page): 7 | # test_check_the_box_inside_label_without_id(page): 8 | # test_check_radio(page): 9 | # test_check_the_box_by_aria_role(page): 10 | -------------------------------------------------------------------------------- /test/api/frame_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.FrameTest do 2 | use Playwright.TestCase, async: true 3 | 4 | alias Playwright.{Frame, Locator, Page} 5 | 6 | describe "Frame.get_by_text/3" do 7 | test "returns a locator that contains the given text", %{page: page} do 8 | Page.set_content(page, "
first
second
\nthird
") 9 | frame = Page.main_frame(page) 10 | assert frame |> Frame.get_by_text("first") |> Locator.count() == 1 11 | 12 | assert frame |> Frame.get_by_text("third") |> Locator.evaluate("e => e.outerHTML") == "
\nthird
" 13 | Page.set_content(page, "
first
first
") 14 | 15 | assert frame |> Frame.get_by_text("first", %{exact: true}) |> Locator.first() |> Locator.evaluate("e => e.outerHTML") == 16 | "
first
" 17 | 18 | Page.set_content(page, "
first and more
first
") 19 | 20 | assert frame |> Frame.get_by_text("first", %{exact: true}) |> Locator.first() |> Locator.evaluate("e => e.outerHTML") == 21 | "
first
" 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /test/api/js_handle_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.JSHandleTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.{ElementHandle, JSHandle, Page} 4 | 5 | describe "JSHandle.as_element/1" do 6 | test "returns `nil` for non-elements", %{page: page} do 7 | handle = Page.evaluate_handle(page, "function() { return 2; }") 8 | result = JSHandle.as_element(handle) 9 | refute result 10 | end 11 | 12 | test "returns an ElementHandle for DOM elements", %{page: page} do 13 | handle = Page.evaluate_handle(page, "function() { return document.body; }") 14 | result = JSHandle.as_element(handle) 15 | assert is_struct(result, ElementHandle) 16 | end 17 | 18 | # NOTE: review description 19 | test "returns an ElementHandle for DOM elements (take 2)", %{page: page} do 20 | handle = Page.evaluate_handle(page, "document.body") 21 | result = JSHandle.as_element(handle) 22 | assert is_struct(result, ElementHandle) 23 | end 24 | 25 | test "returns an ElementHandle for text nodes", %{page: page} do 26 | Page.set_content(page, "
lala!
") 27 | handle = Page.evaluate_handle(page, "function() { return document.querySelector('div').firstChild; }") 28 | result = JSHandle.as_element(handle) 29 | assert is_struct(result, ElementHandle) 30 | 31 | assert Page.evaluate(page, "function(e) { return e.nodeType === Node.TEXT_NODE; }", result) == true 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/api/launcher_test.exs: -------------------------------------------------------------------------------- 1 | # test_browser_type_launch_should_reject_all_promises_when_browser_is_closed 2 | # test_browser_type_launch_should_throw_if_page_argument_is_passed 3 | # test_browser_type_launch_should_reject_if_launched_browser_fails_immediately 4 | # test_browser_type_launch_should_reject_if_executable_path_is_invalid 5 | # test_browser_type_executable_path_should_work 6 | # test_browser_type_name_should_work 7 | # test_browser_close_should_fire_close_event_for_all_contexts 8 | # test_browser_close_should_be_callable_twice 9 | # test_browser_launch_should_return_background_pages 10 | -------------------------------------------------------------------------------- /test/api/network_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.NetworkTest do 2 | use Playwright.TestCase, async: true 3 | alias Playwright.Page 4 | 5 | describe "Page network events" do 6 | test "events are fired in the proper order", %{assets: assets, page: page} do 7 | pid = self() 8 | url = assets.empty 9 | 10 | Page.on(page, :request, fn %{params: %{request: request}} -> 11 | send(pid, {:request, request.url}) 12 | end) 13 | 14 | Page.on(page, :response, fn %{params: %{response: response}} -> 15 | send(pid, {:response, response.url}) 16 | end) 17 | 18 | Page.on(page, :request_finished, fn %{params: %{request: request}} -> 19 | send(pid, {:finished, request.url}) 20 | end) 21 | 22 | Page.goto(page, url) 23 | assert_next_receive({:request, ^url}) 24 | assert_next_receive({:response, ^url}) 25 | assert_next_receive({:finished, ^url}) 26 | end 27 | 28 | test "request/response event info includes :page", %{assets: assets, page: page} do 29 | pid = self() 30 | url = assets.empty 31 | 32 | Page.on(page, :request, fn %{params: %{page: page}} -> 33 | send(pid, {:request, page}) 34 | end) 35 | 36 | Page.on(page, :response, fn %{params: %{page: page}} -> 37 | send(pid, {:response, page}) 38 | end) 39 | 40 | Page.goto(page, url) 41 | assert_next_receive({:request, %Page{}}) 42 | assert_next_receive({:response, %Page{}}) 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /test/api/response_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.ResponseTest do 2 | use Playwright.TestCase, async: true 3 | 4 | alias Playwright.Page 5 | alias Playwright.Response 6 | 7 | describe "Response.ok/1" do 8 | test "works", %{assets: assets, page: page} do 9 | response = Page.goto(page, assets.prefix <> "/dom.html") 10 | assert Response.ok(response) 11 | end 12 | end 13 | 14 | describe "Response.body/1" do 15 | test "for a simple HTML page", %{assets: assets, page: page} do 16 | response = Page.goto(page, assets.prefix <> "/title.html") 17 | assert Response.body(response) == "\nWoof-Woof\n" 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /test/sdk/channel/message_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Channel.MessageTest do 2 | use ExUnit.Case, async: true 3 | alias Playwright.SDK.Channel.Message 4 | 5 | describe "new/3" do 6 | test "returns a Message struct" do 7 | assert Message.new("guid", "click") |> is_struct(Message) 8 | end 9 | 10 | test "returns a Message struct with a monotonically-incrementing ID" do 11 | one = Message.new("element-handle", "click") 12 | two = Message.new("element-handle", "click") 13 | 14 | assert one |> is_struct(Message) 15 | assert two |> is_struct(Message) 16 | 17 | assert two.id > one.id 18 | end 19 | 20 | test "accepts optional params" do 21 | is_default = Message.new("guid", "method") 22 | has_params = Message.new("guid", "method", %{key: "value"}) 23 | 24 | assert is_default.params == %{} 25 | assert has_params.params == %{"key" => "value"} 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /test/sdk/extra/atom_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Extra.AtomTest do 2 | use ExUnit.Case, async: true 3 | 4 | alias Playwright.SDK.Extra 5 | 6 | describe "from_string" do 7 | test "string", do: assert(Extra.Atom.from_string("banana") == :banana) 8 | test "already an atom", do: assert(Extra.Atom.from_string(:banana) == :banana) 9 | test "nil", do: assert_raise(ArgumentError, fn -> Extra.Atom.from_string(nil) end) 10 | end 11 | 12 | describe "to_string" do 13 | test "atom", do: assert(Extra.Atom.to_string(:banana) == "banana") 14 | test "already a string", do: assert(Extra.Atom.to_string("banana") == "banana") 15 | test "nil", do: assert_raise(ArgumentError, fn -> Extra.Atom.to_string(nil) end) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/sdk/extra/map_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Extra.MapTest do 2 | use ExUnit.Case, async: true 3 | 4 | alias Playwright.SDK.Extra 5 | 6 | describe "deep_atomize_keys" do 7 | test "deeply converts keys from strings to atoms" do 8 | map = %{"item1" => "chapstick", "item2" => %{"item3" => "mask"}} 9 | assert map |> Extra.Map.deep_atomize_keys() == %{item1: "chapstick", item2: %{item3: "mask"}} 10 | end 11 | 12 | test "handles keys that are already atoms" do 13 | map = %{:item1 => %{"item3" => "mask"}, "item2" => 2} 14 | assert map |> Extra.Map.deep_atomize_keys() == %{item1: %{item3: "mask"}, item2: 2} 15 | end 16 | 17 | test "handles values that are lists" do 18 | map = %{"item1" => "chapstick", "item2" => %{"item3" => ["mask", "altoids"]}} 19 | assert map |> Extra.Map.deep_atomize_keys() == %{item1: "chapstick", item2: %{item3: ["mask", "altoids"]}} 20 | end 21 | end 22 | 23 | describe "deep_camelize_keys" do 24 | test "deeply converts keys from atoms" do 25 | map = %{key: "value", key_with_converted_case: %{nested_pair: "value"}} 26 | 27 | assert map |> Extra.Map.deep_camelize_keys() == %{ 28 | "key" => "value", 29 | "keyWithConvertedCase" => %{"nestedPair" => "value"} 30 | } 31 | end 32 | 33 | test "deeply converts keys from strings" do 34 | map = %{"key" => "value", "key_with_converted_case" => %{"nested_pair" => "value"}} 35 | 36 | assert map |> Extra.Map.deep_camelize_keys() == %{ 37 | "key" => "value", 38 | "keyWithConvertedCase" => %{"nestedPair" => "value"} 39 | } 40 | end 41 | 42 | test "retains special-case, already camelized strings" do 43 | map = %{"camelizedKey" => "value", "CamelizedKey" => %{"nestedAPIKey" => "value"}} 44 | 45 | assert map |> Extra.Map.deep_camelize_keys() == map 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /test/sdk/extra/uri_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Extra.URITest do 2 | use ExUnit.Case, async: true 3 | 4 | alias Playwright.SDK.Extra 5 | 6 | describe "absolute?" do 7 | test "returns true if the URI has a scheme and a host" do 8 | assert Extra.URI.absolute?("http://example.com/foo/bar") 9 | assert Extra.URI.absolute?("wss://example.org:2345") 10 | end 11 | 12 | test "returns false if the URI does not have a scheme" do 13 | refute Extra.URI.absolute?("//example.com:2345/foo/bar") 14 | end 15 | 16 | test "returns false if the URI does not have a host" do 17 | refute Extra.URI.absolute?("/foo/bar") 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /test/sdk/helpers/url_matcher_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Playwright.SDK.Helpers.URLMatcherTest do 2 | use ExUnit.Case, async: true 3 | alias Playwright.SDK.Helpers.URLMatcher 4 | 5 | describe "new/1" do 6 | test "returns a URLMatcher struct, with a compiled :regex" do 7 | assert %URLMatcher{regex: ~r/.*\/path/} = URLMatcher.new(".*/path") 8 | end 9 | 10 | test "given a path-glob style match" do 11 | assert %URLMatcher{regex: ~r/.*\/path/} = URLMatcher.new("**/path") 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/support/fixtures/file-to-upload.txt: -------------------------------------------------------------------------------- 1 | contents of the file -------------------------------------------------------------------------------- /test/support/fixtures/injectedfile.js: -------------------------------------------------------------------------------- 1 | window.__injected = 42; 2 | window.injected = 123; 3 | window.__injectedError = new Error('hi'); -------------------------------------------------------------------------------- /test/support/fixtures/screenshot-element-bounding-box-chromium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mechanical-orchard/playwright-elixir/51d943014b3cfef602242e8033cd57504779668e/test/support/fixtures/screenshot-element-bounding-box-chromium.png -------------------------------------------------------------------------------- /test/support/unit_test.ex: -------------------------------------------------------------------------------- 1 | defmodule Playwright.UnitTest do 2 | @moduledoc """ 3 | `UnitTest` is a helper module intended for use by the tests *of* Playwright. 4 | """ 5 | use ExUnit.CaseTemplate 6 | 7 | using do 8 | quote do 9 | defp pass(true) do 10 | assert true 11 | end 12 | 13 | defp pass(false) do 14 | assert false 15 | end 16 | 17 | defp pass(:pass) do 18 | assert true 19 | end 20 | 21 | defp pass(:fail) do 22 | assert false 23 | end 24 | 25 | defp pass({:ok, _}) do 26 | assert true 27 | end 28 | 29 | defp pass({:error, _}) do 30 | assert false 31 | end 32 | 33 | require Logger 34 | 35 | defp pass(other) do 36 | Logger.warning("pass/1 not implemented for: #{inspect(other)}") 37 | assert true 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /test/test_helper.exs: -------------------------------------------------------------------------------- 1 | :erlang.system_flag(:backtrace_depth, 20) 2 | ExUnit.configure(exclude: [:headed, :ws]) 3 | ExUnit.start() 4 | --------------------------------------------------------------------------------