-
-
Notifications
You must be signed in to change notification settings - Fork 415
feat: support Playwright testing for Scala-JS #5777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lihaoyi
merged 7 commits into
com-lihaoyi:main
from
ThijsBroersen:feat-support-for-playwright-testing-for-scalajs
Sep 30, 2025
+269
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
99f74f4
feat: support Playwright testing for Scala-JS
ThijsBroersen ad6d65c
bump scala-js-env-playwright version
ThijsBroersen ab83e3a
[autofix.ci] apply automated fixes
autofix-ci[bot] fab181a
bump version
ThijsBroersen 032158d
rework api Playwright JsEnvConfig
ThijsBroersen b80506e
docs: refer to scala-js-env-playwright for derived defaults of launch…
ThijsBroersen a60b382
Merge branch 'main' into feat-support-for-playwright-testing-for-scalajs
ThijsBroersen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
libs/scalajslib/worker/1/src/mill/scalajslib/worker/jsenv/Playwright.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package mill.scalajslib.worker.jsenv | ||
|
||
import mill.scalajslib.worker.api._ | ||
|
||
object Playwright { | ||
def apply(config: JsEnvConfig.Playwright) = config.capabilities match | ||
case options: JsEnvConfig.Playwright.ChromeOptions => | ||
io.github.thijsbroersen.jsenv.playwright.PlaywrightJSEnv.chrome( | ||
headless = options.headless, | ||
showLogs = options.showLogs, | ||
debug = options.debug, | ||
launchOptions = options.launchOptions | ||
) | ||
case options: JsEnvConfig.Playwright.FirefoxOptions => | ||
io.github.thijsbroersen.jsenv.playwright.PlaywrightJSEnv.firefox( | ||
headless = options.headless, | ||
showLogs = options.showLogs, | ||
debug = options.debug, | ||
firefoxUserPrefs = options.firefoxUserPrefs | ||
) | ||
case options: JsEnvConfig.Playwright.WebkitOptions => | ||
io.github.thijsbroersen.jsenv.playwright.PlaywrightJSEnv.webkit( | ||
headless = options.headless, | ||
showLogs = options.showLogs, | ||
debug = options.debug, | ||
launchOptions = options.launchOptions | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do these options come from? Can you link some documentation to ease future maintenence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the defaults we currently have in the plugin. Shall I just add some documentation referring to the plugin repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that helps maintaining them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find any docs related to using the
jsEnvConfig
task. Where shall we add something?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added refs to the plugin repo source in code docs.