How to use
Add following line to project\plugins.sbt
libraryDependencies += "io.github.gmkumar2005" %% "scala-js-env-playwright" % "0.1.11"
Cats-effects
This release has been re-implemented using cats-effects3. The new design allows for effective resource management and adopts functional programming style. Thread.sleep has been replaced with IO.sleep.
Debugging
New debug parameter is added.
It can be passed to the PWEnv constructor to enable debugging. It will also display the version of the browser which is used.
Test / jsEnv := new PWEnv(
browserName = "chrome",
headless = true,
showLogs = true,
debug = true
)
KeepAlive
Has been removed since PlayWright does not have native support. As a workaround one can add delay in the test cases to simulate keep alive feature.
WebKit support
Webkit is fully supported. However it does not work in the github actions.
References
The following projects contain fully implemented PlayWright-JSenv
- Sample project using this JSEnv: https://github.com/gmkumar2005/scalajs-sbt-vite-laminar-chartjs-example
- Fork of Laminar: https://github.com/gmkumar2005/Laminar