Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmintz committed Aug 14, 2023
1 parent e151571 commit fbf31d4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 73 deletions.
20 changes: 1 addition & 19 deletions help_docs/customizing_test_runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ pytest --settings-file=custom_settings.py

<h3><img src="https://seleniumbase.github.io/img/green_logo.png" title="SeleniumBase" width="32" /> Running tests on a remote Selenium Grid:</h3>

🌐 SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, [LambdaTest](https://www.lambdatest.com/selenium-automation)'s Selenium Grid, [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium)'s Selenium Grid, other Grids, and even your own Grid:
🌐 SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium)'s Selenium Grid, other Grids, and even your own Grid:

🌐 For setting browser desired capabilities while running Selenium remotely, see the ReadMe located here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities

Expand All @@ -442,24 +442,6 @@ Here's how to connect to a Sauce Labs Selenium Grid server for running tests:
pytest test_demo_site.py --server=USERNAME:[email protected] --port=443 --protocol=https
```

Here's how to connect to a Perfecto Selenium Grid server for running tests:

```bash
pytest test_demo_site.py --server=USERNAME:[email protected]/nexperience/perfectomobile --port=443
```

Here's how to connect to a TestingBot Selenium Grid server for running tests:

```bash
pytest test_demo_site.py --server=USERNAME:[email protected] --port=80
```

Here's how to connect to a LambdaTest Selenium Grid server for running tests:

```bash
pytest test_demo_site.py --server=USERNAME:[email protected] --port=80
```

Here's how to connect to a CrossBrowserTesting Selenium Grid server for running tests:

```bash
Expand Down
21 changes: 1 addition & 20 deletions help_docs/desired_capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Using Desired Capabilities

You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as <a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack</a>, <a href="https://www.lambdatest.com/capabilities-generator/" target="_blank">LambdaTest</a>, or <a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs</a>.
You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as <a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack</a> or <a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs</a>.

Sample run commands may look like this when run from the [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder: (The browser is now specified in the capabilities file.)

```bash
pytest test_demo_site.py --browser=remote --server=USERNAME:[email protected] --port=80 --cap_file=capabilities/sample_cap_file_BS.py
```

```bash
pytest test_demo_site.py --browser=remote --server=USERNAME:KEY@https://@hub.lambdatest.com --port=80 --protocol=https --cap_file=capabilities/sample_cap_file_LT.py
```

```bash
pytest test_demo_site.py --browser=remote --server=USERNAME:[email protected] --port=443 --protocol=https --cap_file=capabilities/sample_cap_file_SL.py
```
Expand All @@ -34,20 +30,6 @@ desired_cap = {
}
```

Here's an example desired capabilities file for LambdaTest:

```python
capabilities = {
"build" : "your build name",
"name" : "your test name",
"platform" : "Windows 11",
"browserName" : "Chrome",
"version" : "101.0",
"timezone" : "UTC+05:30",
"geoLocation" : "IN",
}
```

Here's an example desired capabilities file for Sauce Labs:

```python
Expand All @@ -65,7 +47,6 @@ capabilities = {

<ul>
<li><a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack desired capabilities</a></li>
<li><a href="https://www.lambdatest.com/capabilities-generator/" target="_blank">LambdaTest desired capabilities</a></li>
<li><a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs desired capabilities</a></li>
</ul>

Expand Down
13 changes: 5 additions & 8 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -3698,14 +3698,13 @@ def get_new_driver(
raise Exception(
'Cannot use "remote" browser driver on localhost!'
" Did you mean to connect to a remote Grid server"
" such as BrowserStack, LambdaTest, or Sauce Labs?"
" such as BrowserStack or Sauce Labs?"
' If so, you must specify the "server" and "port"'
" parameters on the command line! "
"Example: "
"--server=user:[email protected] --port=80"
)
browserstack_ref = "https://browserstack.com/automate/capabilities"
lambdatest_ref = "https://www.lambdatest.com/capabilities-generator"
sauce_labs_ref = (
"https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/"
)
Expand All @@ -3714,13 +3713,11 @@ def get_new_driver(
"Need to specify a desired capabilities file when "
'using "--browser=remote". Add "--cap_file=FILE". '
"File should be in the Python format used by: "
"%s, "
"%s, OR "
"%s "
"See SeleniumBase/examples/capabilities/sample_cap_file_BS.py,"
" SeleniumBase/examples/capabilities/sample_cap_file_LT.py,"
"%s OR %s \n"
"(See SeleniumBase/examples/capabilities/sample_cap_file_BS.py"
" and SeleniumBase/examples/capabilities/sample_cap_file_SL.py"
% (browserstack_ref, lambdatest_ref, sauce_labs_ref)
" for examples!)"
% (browserstack_ref, sauce_labs_ref)
)
if browser is None:
browser = self.browser
Expand Down
6 changes: 2 additions & 4 deletions seleniumbase/plugins/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,15 @@ def pytest_addoption(parser):
dest="cap_file",
default=None,
help="""The file that stores browser desired capabilities
for BrowserStack, LambdaTest, Sauce Labs,
and other remote web drivers to use.""",
for BrowserStack, Sauce Labs, or other grids.""",
)
parser.addoption(
"--cap_string",
"--cap-string",
dest="cap_string",
default=None,
help="""The string that stores browser desired capabilities
for BrowserStack, LambdaTest, Sauce Labs,
and other remote web drivers to use.
for BrowserStack, Sauce Labs, or other grids.
Enclose cap-string in single quotes.
Enclose parameter keys in double quotes.
Example: --cap-string='{"name":"test1","v":"42"}'""",
Expand Down
6 changes: 2 additions & 4 deletions seleniumbase/plugins/selenium_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,15 @@ def options(self, parser, env):
dest="cap_file",
default=None,
help="""The file that stores browser desired capabilities
for BrowserStack, LambdaTest, Sauce Labs,
and other remote web drivers to use.""",
for BrowserStack, Sauce Labs, or other grids.""",
)
parser.addoption(
"--cap_string",
"--cap-string",
dest="cap_string",
default=None,
help="""The string that stores browser desired capabilities
for BrowserStack, LambdaTest, Sauce Labs,
and other remote web drivers to use.
for BrowserStack, Sauce Labs, or other grids.
Enclose cap-string in single quotes.
Enclose parameter keys in double quotes.
Example: --cap-string='{"name":"test1","v":"42"}'""",
Expand Down
18 changes: 0 additions & 18 deletions seleniumbase/utilities/selenium_grid/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,6 @@ pytest test_demo_site.py --server=USERNAME:[email protected] --port=80
pytest test_demo_site.py --server=USERNAME:[email protected] --port=443 --protocol=https
```

* [Perfecto](https://www.perfecto.io/integrations/selenium) Selenium Grid:

```bash
pytest test_demo_site.py --server=USERNAME:[email protected]/nexperience/perfectomobile --port=443
```

* [TestingBot](https://testingbot.com/features) Selenium Grid:

```bash
pytest test_demo_site.py --server=USERNAME:[email protected] --port=80
```

* [LambdaTest](https://www.lambdatest.com/selenium-automation) Selenium Grid:

```bash
pytest test_demo_site.py --server=USERNAME:[email protected] --port=80
```

* [CrossBrowserTesting](https://help.crossbrowsertesting.com/selenium-testing/getting-started/python/) Selenium Grid:

```bash
Expand Down

0 comments on commit fbf31d4

Please sign in to comment.