You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-17
Original file line number
Diff line number
Diff line change
@@ -5,34 +5,30 @@
5
5
## Usage
6
6
Simply add the following line to your `project/plugins.sbt` (note that this line must be placed before `addSbtPlugin("org.scala-js" % "sbt-scalajs" % <scalajs-version>)`; otherwise you may get errors such as `java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState` when you run tests):
It is recommend to use this with a `run` and not `test` because the latter tends
@@ -53,14 +49,38 @@ to leave too many browser windows open.
53
49
#### Debugging tests on a single window
54
50
By default tests are executed in their own window for parallelism.
55
51
When debugging tests with `withKeepAlive` it is possible to disable this option
56
-
using the `sbt` setting `parallelExecution in Test := false`.
52
+
using the `sbt` setting `(Test / parallelExecution) := false`.
57
53
58
54
### Headless Usage
59
55
It is often desirable to run Selenium headlessly.
60
56
This could be to run tests on a server without graphics, or to just prevent browser
61
57
windows popping up when running locally.
62
58
63
-
##### xvfb
59
+
#### Driver options
60
+
**Note:** the availability and behavior of this configuration depends on the driver you choose. See the [noteworthy post from Selenium developers themselves][selenium-headless-going-away].
61
+
62
+
When creating a driver in your `DriverFactory`, you can provide additional options to specify behavior
63
+
such as headless mode.
64
+
65
+
For example, when using Firefox:
66
+
67
+
```scala
68
+
newFirefoxDriver(
69
+
newFirefoxOptions()
70
+
.addArguments("--headless")
71
+
)
72
+
```
73
+
74
+
For Chrome:
75
+
76
+
```scala
77
+
newChromeDriver(
78
+
newChromeOptions()
79
+
.addArguments("--headless")
80
+
)
81
+
```
82
+
83
+
#### xvfb
64
84
A common approach on Linux and Mac OSX, is to use `xvfb`, "X Virtual FrameBuffer".
65
85
It starts an X server headlessly, without the need for a graphics driver.
66
86
@@ -82,3 +102,5 @@ long as there isn't another X server running that's already associated with it.
82
102
## Contributing
83
103
84
104
Follow the [contributing guide](./CONTRIBUTING.md).
0 commit comments