Skip to content

Commit 7587cf7

Browse files
authored
Updates related to scala-js-env-playwright v0.1.11 release (#626)
1 parent f7f43fa commit 7587cf7

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

doc/project/js-environments.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ jsEnv := PhantomJSEnv(args = Seq("arg1", "arg2")).value
6969
For more options of the PhantomJS environment, see
7070
[the Scaladoc of `PhantomJSEnv`]({{ site.production_url }}/api/sbt-scalajs-env-phantomjs/1.0.0/org/scalajs/jsenv/phantomjs/sbtplugin/PhantomJSEnvPlugin$$autoImport$.html).
7171

72-
## Playwright
73-
[Playwright](https://playwright.dev/) is a comprehensive testing library, enabling automation of Chromium, Firefox, and WebKit browsers.
72+
## Playwright
73+
[Playwright](https://playwright.dev/) is a comprehensive testing library, enabling automation of Chromium, Firefox, and WebKit browsers.
7474

75-
It supports multiple platforms and languages, including Mobile Web, making it an optimal choice for testing JavaScript in real browser environments.
75+
It supports multiple platforms and languages, including Mobile Web, making it an optimal choice for testing JavaScript in real browser environments.
7676

7777
[`scala-js-env-playwright`](https://github.com/gmkumar2005/scala-js-env-playwright) is an independent project that offers a `JSEnv` that uses Playwright for JavaScript execution.
7878

79-
The playwright-based `jsEnv` can be enabled by adding the following settings in `build.sbt`
79+
The playwright-based `jsEnv` can be enabled by adding the following settings in `build.sbt`
8080
```scala
8181
jsEnv := new PWEnv(
8282
browserName = "chrome",
@@ -87,39 +87,35 @@ jsEnv := new PWEnv(
8787
Addtionally it requires the following line in `project/plugins.sbt`:
8888
```scala
8989
// For Scala.js 1.x
90-
libraryDependencies += "io.github.gmkumar2005" %% "scala-js-env-playwright" % "0.1.8"
90+
libraryDependencies += "io.github.gmkumar2005" %% "scala-js-env-playwright" % "0.1.11"
9191
```
92-
93-
The `browserName` parameter accepts `chrome` , `chromium` , `firefox`, and `webkit` as possible options.
94-
92+
The `browserName` parameter accepts `chrome` , `chromium` , `firefox`, and `webkit` as possible options.
9593
Please be aware that webkit support is currently in an experimental stage.
94+
It is fully tested on macOS and your mileage may vary on other platforms.
9695

9796
### In browser debugging
98-
To maintain the browser window open post-execution, add the `withKeepAlive` option into the environment.
97+
`keepAlive` is a work in progress. It is not fully functional yet.
98+
As a workaround introducing delay in the test cases may help to keep the browser alive.
9999

100-
```scala
101-
lazy val pwenvConfig = Def.setting {
102-
jsenv.playwright.PWEnv
103-
.Config()
104-
.withKeepAlive(true)
105-
}
106-
107-
jsEnv := new jsenv.playwright.PWEnv(
108-
browserName = "chrome",
109-
headless = true,
110-
showLogs = true,
111-
pwenvConfig.value,
112-
)
113100

101+
### Debugging
102+
Additional debug information can be enabled by setting `debug` to `true`.
103+
It will also print the version of the browser which is used.
104+
```scala
105+
jsEnv := new PWEnv(
106+
browserName = "chrome",
107+
headless = true,
108+
debug = true
109+
)
114110
```
115111
### Headless Usage
116-
Running in headless mode is crucial for operations within Docker containers and build servers.
112+
Running in headless mode is crucial for operations within Docker containers and build servers.
117113

118114
By default, `scala-js-env-playwright` operates in headless mode.
119115
However, for debugging purposes, you can set headless to `false`.
120116

121-
## Details
122-
For more options of the plawwright environment see the github project [PlayWright-jsEnv](https://github.com/gmkumar2005/scala-js-env-playwright)
117+
### Details
118+
For more options of the playWright environment see the github project [PlayWright-jsEnv](https://github.com/gmkumar2005/scala-js-env-playwright)
123119

124120
## Selenium
125121

0 commit comments

Comments
 (0)