Skip to content

Conversation

@gmkumar2005
Copy link
Contributor

Adding details of Playwright based js environment.

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some remarks mostly on grammar. LGTM otherwise.

[the Scaladoc of `PhantomJSEnv`]({{ site.production_url }}/api/sbt-scalajs-env-phantomjs/1.0.0/org/scalajs/jsenv/phantomjs/sbtplugin/PhantomJSEnvPlugin$$autoImport$.html).

## Playwright
[Playwright](https://playwright.dev/) is a comprehensive testing library, enabling automation of Chromium, Firefox, and WebKit browsers. It supports multiple platforms and languages, including Mobile Web, making it an optimal choice for testing JavaScript in real browser environments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We keep one sentence per line for easier diffs later on:

Suggested change
[Playwright](https://playwright.dev/) is a comprehensive testing library, enabling automation of Chromium, Firefox, and WebKit browsers. It supports multiple platforms and languages, including Mobile Web, making it an optimal choice for testing JavaScript in real browser environments.
[Playwright](https://playwright.dev/) is a comprehensive testing library, enabling automation of Chromium, Firefox, and WebKit browsers.
It supports multiple platforms and languages, including Mobile Web, making it an optimal choice for testing JavaScript in real browser environments.
## Playwright
[Playwright](https://playwright.dev/) is a comprehensive testing library, enabling automation of Chromium, Firefox, and WebKit browsers. It supports multiple platforms and languages, including Mobile Web, making it an optimal choice for testing JavaScript in real browser environments.

[`scala-js-env-playwright`](https://github.com/gmkumar2005/scala-js-env-playwright) is an independent project that offers jsEnv and employs Playwright for JavaScript execution.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`scala-js-env-playwright`](https://github.com/gmkumar2005/scala-js-env-playwright) is an independent project that offers jsEnv and employs Playwright for JavaScript execution.
[`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.
Comment on lines 79 to 83
jsEnv := new PWEnv(
browserName = "chrome",
headless = true,
showLogs = true
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jsEnv := new PWEnv(
browserName = "chrome",
headless = true,
showLogs = true
)
jsEnv := new PWEnv(
browserName = "chrome",
headless = true,
showLogs = true
)

[`scala-js-env-playwright`](https://github.com/gmkumar2005/scala-js-env-playwright) is an independent project that offers jsEnv and employs Playwright for JavaScript execution.

The playwright based `jsEnv` can be enabled by adding following settings in build.sbt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The playwright based `jsEnv` can be enabled by adding following settings in build.sbt
The playwright-based `jsEnv` can be enabled by adding the following settings in `build.sbt`
showLogs = true
)
```
Addtionally it requires following line in `project/plugins.sbt`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Addtionally it requires following line in `project/plugins.sbt`:
Addtionally it requires the following line in `project/plugins.sbt`:
libraryDependencies += "io.github.gmkumar2005" %% "scala-js-env-playwright" % "0.1.8"
```

The `browserName` parameter accepts `chrome` , `chromium` , `firefox`, and `webkit` as possible options. Please be aware that webkit support is currently in an experimental stage.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `browserName` parameter accepts `chrome` , `chromium` , `firefox`, and `webkit` as possible options. Please be aware that webkit support is currently in an experimental stage.
The `browserName` parameter accepts `chrome` , `chromium` , `firefox`, and `webkit` as possible options.
Please be aware that webkit support is currently in an experimental stage.
The `browserName` parameter accepts `chrome` , `chromium` , `firefox`, and `webkit` as possible options. Please be aware that webkit support is currently in an experimental stage.

### In browser debugging
To maintain the browser window open post-execution, simply incorporate the `withKeepAlive` option into the environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"simply" never adds real meaning to a sentence; it should be removed:

Suggested change
To maintain the browser window open post-execution, simply incorporate the `withKeepAlive` option into the environment.
To maintain the browser window open post-execution, add the `withKeepAlive` option into the environment.

```
### Headless Usage
Running in headless mode is crucial for operations within Docker containers and build servers. By default, `scala-js-env-playwright` operates in headless mode. However, for debugging purposes, you can set headless to `false`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Running in headless mode is crucial for operations within Docker containers and build servers. By default, `scala-js-env-playwright` operates in headless mode. However, for debugging purposes, you can set headless to `false`.
Running in headless mode is crucial for operations within Docker containers and build servers.
By default, `scala-js-env-playwright` operates in headless mode.
However, for debugging purposes, you can set headless to `false`.
@gmkumar2005
Copy link
Contributor Author

All recommendations done

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sjrd sjrd merged commit f7f43fa into scala-js:main Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants