From fbf31d4a7ee245edb497d0e808b9ff240a57b9cd Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 14 Aug 2023 13:29:23 -0400 Subject: [PATCH] Update the documentation --- help_docs/customizing_test_runs.md | 20 +----------------- help_docs/desired_capabilities.md | 21 +------------------ seleniumbase/fixtures/base_case.py | 13 +++++------- seleniumbase/plugins/pytest_plugin.py | 6 ++---- seleniumbase/plugins/selenium_plugin.py | 6 ++---- .../utilities/selenium_grid/ReadMe.md | 18 ---------------- 6 files changed, 11 insertions(+), 73 deletions(-) diff --git a/help_docs/customizing_test_runs.md b/help_docs/customizing_test_runs.md index d6522454868..d68c4a8231f 100644 --- a/help_docs/customizing_test_runs.md +++ b/help_docs/customizing_test_runs.md @@ -426,7 +426,7 @@ pytest --settings-file=custom_settings.py

Running tests on a remote Selenium Grid:

-🌐 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 @@ -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:KEY@ondemand.us-east-1.saucelabs.com --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:KEY@demo.perfectomobile.com/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:KEY@hub.testingbot.com --port=80 -``` - -Here's how to connect to a LambdaTest Selenium Grid server for running tests: - -```bash -pytest test_demo_site.py --server=USERNAME:KEY@hub.lambdatest.com --port=80 -``` - Here's how to connect to a CrossBrowserTesting Selenium Grid server for running tests: ```bash diff --git a/help_docs/desired_capabilities.md b/help_docs/desired_capabilities.md index 6006da8f978..7f69f038e20 100644 --- a/help_docs/desired_capabilities.md +++ b/help_docs/desired_capabilities.md @@ -2,7 +2,7 @@ ## [](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 BrowserStack, LambdaTest, or Sauce Labs. +You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as BrowserStack or Sauce Labs. 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.) @@ -10,10 +10,6 @@ Sample run commands may look like this when run from the [SeleniumBase/examples/ pytest test_demo_site.py --browser=remote --server=USERNAME:KEY@hub.browserstack.com --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:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https --cap_file=capabilities/sample_cap_file_SL.py ``` @@ -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 @@ -65,7 +47,6 @@ capabilities = { diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index b528d03061f..92e941b9ce1 100644 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -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:key@hub.browserstack.com --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#/" ) @@ -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 diff --git a/seleniumbase/plugins/pytest_plugin.py b/seleniumbase/plugins/pytest_plugin.py index 7910f9b275f..fed35fe632a 100644 --- a/seleniumbase/plugins/pytest_plugin.py +++ b/seleniumbase/plugins/pytest_plugin.py @@ -272,8 +272,7 @@ 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", @@ -281,8 +280,7 @@ def pytest_addoption(parser): 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"}'""", diff --git a/seleniumbase/plugins/selenium_plugin.py b/seleniumbase/plugins/selenium_plugin.py index c0c55bce210..bd8f252bae8 100644 --- a/seleniumbase/plugins/selenium_plugin.py +++ b/seleniumbase/plugins/selenium_plugin.py @@ -149,8 +149,7 @@ 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", @@ -158,8 +157,7 @@ def options(self, parser, env): 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"}'""", diff --git a/seleniumbase/utilities/selenium_grid/ReadMe.md b/seleniumbase/utilities/selenium_grid/ReadMe.md index c1a189d8d40..1a2f3c02bad 100644 --- a/seleniumbase/utilities/selenium_grid/ReadMe.md +++ b/seleniumbase/utilities/selenium_grid/ReadMe.md @@ -64,24 +64,6 @@ pytest test_demo_site.py --server=USERNAME:KEY@hub.browserstack.com --port=80 pytest test_demo_site.py --server=USERNAME:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https ``` -* [Perfecto](https://www.perfecto.io/integrations/selenium) Selenium Grid: - -```bash -pytest test_demo_site.py --server=USERNAME:KEY@demo.perfectomobile.com/nexperience/perfectomobile --port=443 -``` - -* [TestingBot](https://testingbot.com/features) Selenium Grid: - -```bash -pytest test_demo_site.py --server=USERNAME:KEY@hub.testingbot.com --port=80 -``` - -* [LambdaTest](https://www.lambdatest.com/selenium-automation) Selenium Grid: - -```bash -pytest test_demo_site.py --server=USERNAME:KEY@hub.lambdatest.com --port=80 -``` - * [CrossBrowserTesting](https://help.crossbrowsertesting.com/selenium-testing/getting-started/python/) Selenium Grid: ```bash