File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
src/main/scala/jsenv/playwright Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 11[ ![ Scala CI] ( https://github.com/thijsbroersen/scala-js-env-playwright/actions/workflows/ci.yml/badge.svg )] ( https://github.com/thijsbroersen/scala-js-env-playwright/actions/workflows/ci.yml )
22# scala-js-env-playwright
3- A JavaScript environment for Scala.js (a JSEnv) running playwright
3+ A JavaScript environment for Scala.js (a JSEnv) running playwright. It is only build for Scala 3 (supported by Mill and SBT 2.x)
44## Requirements
55Playwright needs certain system dependencies [ read the docs] ( https://playwright.dev/docs/browsers#install-system-dependencies )
66
77TLDR -> ` npx playwright install-deps `
88
9- ## Usage
9+ ## Usage SBT
1010Add the following line to your ` project/plugins.sbt `
1111``` scala
1212// For Scala.js 1.x
@@ -16,19 +16,30 @@ Add the following line to your `build.sbt`
1616``` scala
1717Test / jsEnv := new PWEnv (
1818 browserName = " chrome" ,
19- headless = true ,
20- showLogs = true
19+ headless = true
2120 )
2221```
22+ ## Usage Mill (not yet part of Mill, tested in locally build Mill version)
23+ ``` scala
24+ override def jsEnvConfig = JsEnvConfig .Playwright (
25+ browserName = " chrome" ,
26+ headless = true
27+ )
28+ ```
2329## Avoid trouble
2430* This is a very early version. It may not work for all projects. It is tested on chrome/chromium and firefox.
2531* Few test cases are failing on webkit. Keep a watch on this space for updates.
2632* It works only with Scala.js 1.x
2733* Make sure the project is set up to use ModuleKind.ESModule in the Scala.js project.
34+ * SBT 2.x
2835 ``` scala
2936 // For Scala.js 1.x
3037 scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind .ESModule ) }
3138 ```
39+ * Mill
40+ ```scala
41+ override def moduleKind = ModuleKind .ESModule
42+ ```
3243* Some projects which may need to use both Selenium and Playwright.
3344If it runs into google exception, add the following line to your ` plugins.sbt `
3445``` scala
Original file line number Diff line number Diff line change @@ -103,9 +103,9 @@ trait Runner {
103103 * This <strong>must</strong> be called to ensure the run's resources are released.
104104 *
105105 * Whether or not this makes the run fail or not is up to the implementation. However, in the
106- * following cases, calling [[close ]] may not fail the run: <ul> <li>[[scala.concurrent.Future
107- * Future]] is already completed when [[close ]] is called. <li>This is a [[CERun ]] and the
108- * event loop inside the VM is empty. </ul>
106+ * following cases, calling [[close ]] may not fail the run: <ul> <li>[[jsRunPrg ]] is already
107+ * completed when [[close ]] is called. <li>This is a [[CERun ]] and the event loop inside the
108+ * VM is empty. </ul>
109109 *
110110 * Idempotent, async, nothrow.
111111 */
You can’t perform that action at this time.
0 commit comments