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
This attempts to resolve a few issues:
Make it simpler to run local tests - no extra requirements upon
disabling BS. BS is disabled by default and only activated by:
* Specifying an MSBuild property
* Providing a config
Attempt to fix BS test duplicationg by switching off NUnit
parallelism when BS is enabled.
Activate all seven build configs for the CBT CI build.
This should demonstrate whether I get improved CBT
by using the SDK.
Add README files to signpost this configuration to devs.
This directory contains tests for the Selenium extension.
4
+
Note that (for CI/Cross Browser Testing reasons) this test project includes an integration with [the BrowserStack SDK].
5
+
BrowserStack is primarily used by the **Cross-browser testing GitHub action** configuration; see `.github\workflows\crossBrowserTesting.yml` in the root of this repository.
6
+
7
+
## Testing locally (without BrowserStack)
8
+
9
+
The BrowserStack integration is _disabled by default_ to make local testing as simple as possible.
10
+
11
+
The WebDriver for local testing is chosen via the `appsettings.json` file.
12
+
This file is a configuration for [a universal WebDriver factory].
13
+
You may add/adjust WebDrivers present there, to your requirements.
14
+
The default configuration is to test with a locally-installed Google Chrome browser.
15
+
You may select a different browser/WebDriver for tests by either:
16
+
17
+
* Setting an environment variable `WebDriverFactory__SelectedConfiguration` to the name of your chosen configuration, for example `VerboseChrome`
18
+
* Using a command-line parameter for `dotnet test`:
19
+
20
+
```cmd
21
+
dotnet test ---WebDriverFactory::SelectedConfiguration VerboseChrome
When using `dotnet build` or `dotnet test`, include the property `BrowserStack` with a value of `true`.
36
+
For example:
37
+
38
+
```cmd
39
+
dotnet test -p:BrowserStack=true
40
+
```
41
+
42
+
This will activate two changes in the `.csproj` file in this directory:
43
+
44
+
* It will install the BrowserStack SDK NuGet package: `BrowserStack.TestAdapter`
45
+
* It will disable NUnit's parallelism feature
46
+
*_When NUnit parallelism is enabled, it interferes with BrowserStack's own parallelism, creating confusing results_
47
+
48
+
### Add a `browserstack.yml` configuration
49
+
50
+
To use the BrowserStack SDK, you must provide a configuration file.
51
+
The configuration file must be named `browserstack.yml` and it must be in the directory which contains the tests `.csproj` file _(IE: this directory, which contains this README file)_.
52
+
53
+
There are seven sample configuration files available in the `Tools/` directory, which target seven different web browser/OS combinations.
54
+
These happen to be the targets for the CBT CI run.
55
+
You are welcome to copy one of these YAML files into the `CSF.Screenplay.Selenium.Tests` directory and rename it to `browserstack.yml`.
56
+
Alternatively [you may craft your own BrowserStack configuration file].
57
+
58
+
If you use one of the sample configurations, note that the `userName` and `accessKey` properties are omitted.
59
+
_You will need to provide your own BrowserStack credentials_.
60
+
61
+
[you may craft your own BrowserStack configuration file]: https://www.browserstack.com/docs/automate/capabilities
0 commit comments