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 1
1
[ ![ 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 )
2
2
# 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)
4
4
## Requirements
5
5
Playwright needs certain system dependencies [ read the docs] ( https://playwright.dev/docs/browsers#install-system-dependencies )
6
6
7
7
TLDR -> ` npx playwright install-deps `
8
8
9
- ## Usage
9
+ ## Usage SBT
10
10
Add the following line to your ` project/plugins.sbt `
11
11
``` scala
12
12
// For Scala.js 1.x
@@ -16,19 +16,30 @@ Add the following line to your `build.sbt`
16
16
``` scala
17
17
Test / jsEnv := new PWEnv (
18
18
browserName = " chrome" ,
19
- headless = true ,
20
- showLogs = true
19
+ headless = true
21
20
)
22
21
```
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
+ ```
23
29
## Avoid trouble
24
30
* This is a very early version. It may not work for all projects. It is tested on chrome/chromium and firefox.
25
31
* Few test cases are failing on webkit. Keep a watch on this space for updates.
26
32
* It works only with Scala.js 1.x
27
33
* Make sure the project is set up to use ModuleKind.ESModule in the Scala.js project.
34
+ * SBT 2.x
28
35
``` scala
29
36
// For Scala.js 1.x
30
37
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind .ESModule ) }
31
38
```
39
+ * Mill
40
+ ```scala
41
+ override def moduleKind = ModuleKind .ESModule
42
+ ```
32
43
* Some projects which may need to use both Selenium and Playwright.
33
44
If it runs into google exception, add the following line to your ` plugins.sbt `
34
45
``` scala
Original file line number Diff line number Diff line change @@ -103,9 +103,9 @@ trait Runner {
103
103
* This <strong>must</strong> be called to ensure the run's resources are released.
104
104
*
105
105
* 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>
109
109
*
110
110
* Idempotent, async, nothrow.
111
111
*/
You can’t perform that action at this time.
0 commit comments