Skip to content

Commit 3162f85

Browse files
committed
Update the docs
1 parent 309711a commit 3162f85

File tree

5 files changed

+57
-37
lines changed

5 files changed

+57
-37
lines changed

help_docs/customizing_test_runs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ If you're using ``pytest`` for running tests outside of the SeleniumBase repo, y
7878
Here are some useful command-line options that come with ``pytest``:
7979

8080
```bash
81-
-v # Verbose mode. Print the full name of each test run.
81+
-v # Verbose mode. Prints the full name of each test run.
8282
-q # Quiet mode. Print fewer details in the console output when running tests.
8383
-x # Stop running the tests after the first failure is reached.
8484
--html=report.html # Creates a detailed pytest-html report after tests finish.
@@ -93,7 +93,7 @@ Here are some useful command-line options that come with ``pytest``:
9393
SeleniumBase provides additional ``pytest`` command-line options for tests:
9494

9595
```bash
96-
--browser=BROWSER # (The web browser to use. Default: "chrome")
96+
--browser=BROWSER # (The web browser to use. Default: "chrome".)
9797
--cap-file=FILE # (The web browser's desired capabilities to use.)
9898
--cap-string=STRING # (The web browser's desired capabilities to use.)
9999
--settings-file=FILE # (Override default SeleniumBase settings.)
@@ -103,10 +103,10 @@ SeleniumBase provides additional ``pytest`` command-line options for tests:
103103
--var2=DATA # (Extra test data. Access with "self.var2" in tests.)
104104
--var3=DATA # (Extra test data. Access with "self.var3" in tests.)
105105
--user-data-dir=DIR # (Set the Chrome user data directory to use.)
106-
--server=SERVER # (The server / IP address used by the tests.)
107-
--port=PORT # (The port that's used by the test server.)
108-
--proxy=SERVER:PORT # (This is the proxy server:port combo used by tests.)
109-
--agent=STRING # (Modify the web browser's User-Agent string.)
106+
--server=SERVER # (The Selenium Grid server/IP used for tests.)
107+
--port=PORT # (The Selenium Grid port used by the test server.)
108+
--proxy=SERVER:PORT # (Connect to a proxy server:port for tests.)
109+
--proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
110110
--mobile # (Use the mobile device emulator while running tests.)
111111
--metrics=STRING # (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
112112
--extension-zip=ZIP # (Load a Chrome Extension .zip file, comma-separated.)

seleniumbase/console_scripts/run.py

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,14 @@ def show_options():
443443
c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
444444
c3 = colorama.Fore.BLUE + colorama.Back.LIGHTYELLOW_EX
445445
cr = colorama.Style.RESET_ALL
446-
sc = ("\n " + c2 + "** " + c3 + "pytest cmd options" + c2 + " **" + cr)
446+
sc = ("\n " + c2 + " ** " + c3 + " pytest CMD Options " + c2 + " ** " + cr)
447447
print(sc)
448448
print("")
449449
line = "Here are some common pytest options to use with SeleniumBase:"
450450
line = c1 + line + cr
451451
print(line)
452452
print("")
453-
print('--browser=BROWSER (The web browser to use. Default: "chrome")')
453+
print('--browser=BROWSER (The web browser to use. Default: "chrome".)')
454454
print('--headless (Run tests headlessly. Default mode on Linux OS.)')
455455
print('--demo (Slow down and visually see test actions as they occur.)')
456456
print('--slow (Slow down the automation. Faster than using Demo Mode.)')
@@ -461,27 +461,35 @@ def show_options():
461461
print("--guest (Enable Chrome's Guest mode.)")
462462
print('-m MARKER (Run tests with the specified pytest marker.)')
463463
print('-n NUM (Multithread the tests using that many threads.)')
464-
print('-v (Verbose mode. Print the full name of each test run.)')
465-
print('--check-js (Check for JavaScript errors after page loads.)')
464+
print('-v (Verbose mode. Prints the full names of each test run.)')
466465
print('--html=report.html (Create a detailed pytest-html report.)')
466+
print('--collect-only / --co (Only show discovered tests. No run.)')
467+
print('--co -q (Only show full names of discovered tests. No run.)')
468+
print('--trace (Enter Debug Mode immediately after starting any test.')
469+
print(' n: Next line of method. s: Step through. c: Continue.)')
470+
print('--pdb (Enter Debug Mode if a test fails. h: Help. c: Continue.')
471+
print(' where: Stacktrace location. u: Up stack. d: Down stack.')
472+
print(' longlist: Stack code. dir(): List objects in namespace.)')
473+
print('-x (Stop running the tests after the first failure is reached.)')
474+
print('--archive-logs (Archive old log files instead of deleting them.)')
475+
print('--save-screenshot (Save a screenshot at the end of each test.)')
476+
print('--check-js (Check for JavaScript errors after page loads.)')
477+
print('--start-page=URL (The browser start page when tests begin.)')
467478
print("--agent=STRING (Modify the web browser's User-Agent string.)")
468479
print('--mobile (Use the mobile device emulator while running tests.)')
469480
print('--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)')
470481
print('--ad-block (Block some types of display ads after page loads.)')
471-
print('--pdb (Enter Debug Mode if a test fails. h: Help. c: Continue.')
472-
print(' interact: Interactive Mode. CTRL-D: Exit Interactive Mode.)')
473-
print('--archive-logs (Archive old log files instead of deleting them.)')
474-
print('--disable-csp (Disable the Content Security Policy of websites.)')
475-
print('--save-screenshot (Save a screenshot at the end of each test.)')
476-
print('--proxy=SERVER:PORT (Set a proxy server:port combo for tests.)')
477-
print("--settings-file=FILE (Override default SeleniumBase settings.)")
482+
print('--settings-file=FILE (Override default SeleniumBase settings.)')
478483
print('--env=ENV (Set the test env. Access with "self.env" in tests.)')
479484
print('--data=DATA (Extra test data. Access with "self.data" in tests.)')
480-
print('--collect-only -q (Show discovered tests without running them.)')
481-
print('-x (Stop running tests after the first failure is reached.)')
485+
print('--disable-csp (Disable the Content Security Policy of websites.)')
486+
print('--server=SERVER (The Selenium Grid server/IP used for tests.)')
487+
print('--port=PORT (The Selenium Grid port used by the test server.)')
488+
print('--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)')
489+
print('--proxy=USER:PASS@SERVER:PORT (Use authenticated proxy server.)')
482490
print("")
483-
line = 'For the full list of ' + c1 + 'command-line options' + cr
484-
line += ', type: "' + c2 + 'pytest' + cr + ' ' + c3 + '--help' + cr + '".'
491+
line = 'For the full list of ' + c2 + 'command-line options' + cr
492+
line += ', type: "' + c1 + 'pytest' + cr + ' ' + c3 + '--help' + cr + '".'
485493
print(line)
486494
print("")
487495

seleniumbase/plugins/base_plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def options(self, parser, env):
7575
'--log_path', '--log-path',
7676
dest='log_path',
7777
default='latest_logs/',
78-
help='Where the log files are saved. (No longer editable!)')
78+
help="""Log files are saved to the "latest_logs/" folder.
79+
(This field is NOT EDITABLE anymore!)""")
7980
parser.add_option(
8081
'--archive_logs', '--archive-logs',
8182
action="store_true",

seleniumbase/plugins/pytest_plugin.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
""" This is the pytest configuration file """
33

4+
import colorama
45
import pytest
56
import sys
67
from seleniumbase import config as sb_config
@@ -12,19 +13,20 @@
1213
def pytest_addoption(parser):
1314
"""
1415
This plugin adds the following command-line options to pytest:
15-
--browser=BROWSER (The web browser to use. Default: "chrome")
16-
--cap-file=FILE (The web browser's desired capabilities to use.)
17-
--cap-string=STRING (The web browser's desired capabilities to use.)
16+
--browser=BROWSER (The web browser to use. Default: "chrome".)
1817
--settings-file=FILE (Override default SeleniumBase settings.)
1918
--env=ENV (Set the test env. Access with "self.env" in tests.)
2019
--data=DATA (Extra test data. Access with "self.data" in tests.)
2120
--var1=DATA (Extra test data. Access with "self.var1" in tests.)
2221
--var2=DATA (Extra test data. Access with "self.var2" in tests.)
2322
--var3=DATA (Extra test data. Access with "self.var3" in tests.)
2423
--user-data-dir=DIR (Set the Chrome user data directory to use.)
25-
--server=SERVER (The server / IP address used by the tests.)
26-
--port=PORT (The port that's used by the test server.)
27-
--proxy=SERVER:PORT (This is the proxy server:port combo used by tests.)
24+
--server=SERVER (The Selenium Grid server/IP used for tests.)
25+
--port=PORT (The Selenium Grid port used by the test server.)
26+
--cap-file=FILE (The web browser's desired capabilities to use.)
27+
--cap-string=STRING (The web browser's desired capabilities to use.)
28+
--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)
29+
--proxy=USERNAME:PASSWORD@SERVER:PORT (Use authenticated proxy server.)
2830
--agent=STRING (Modify the web browser's User-Agent string.)
2931
--mobile (Use the mobile device emulator while running tests.)
3032
--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
@@ -58,8 +60,14 @@ def pytest_addoption(parser):
5860
--visual-baseline (Set the visual baseline for Visual/Layout tests.)
5961
--timeout-multiplier=MULTIPLIER (Multiplies the default timeout values.)
6062
"""
61-
parser = parser.getgroup('SeleniumBase',
62-
'SeleniumBase specific configuration options')
63+
c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
64+
c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
65+
c3 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
66+
cr = colorama.Style.RESET_ALL
67+
s_str = "SeleniumBase"
68+
s_str = s_str.replace("SeleniumBase", c1 + "Selenium" + c2 + "Base" + cr)
69+
s_str = s_str + cr + " " + c3 + "command-line options for pytest" + cr
70+
parser = parser.getgroup('SeleniumBase', s_str)
6371
parser.addoption('--browser',
6472
action="store",
6573
dest='browser',
@@ -73,7 +81,8 @@ def pytest_addoption(parser):
7381
action="store_true",
7482
dest='with_selenium',
7583
default=True,
76-
help="Use if tests need to be run with a web browser.")
84+
help="""(DEPRECATED) Start tests with an open web browser.
85+
(This is ALWAYS True now when importing BaseCase)""")
7786
parser.addoption('--env',
7887
action='store',
7988
dest='environment',
@@ -146,7 +155,8 @@ def pytest_addoption(parser):
146155
parser.addoption('--log_path', '--log-path',
147156
dest='log_path',
148157
default='latest_logs/',
149-
help='Where log files are saved. (No longer editable!)')
158+
help="""Log files are saved to the "latest_logs/" folder.
159+
(This field is NOT EDITABLE anymore!)""")
150160
parser.addoption('--archive_logs', '--archive-logs',
151161
action="store_true",
152162
dest='archive_logs',

seleniumbase/plugins/selenium_plugin.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
class SeleniumBrowser(Plugin):
1111
"""
1212
This plugin adds the following command-line options to nosetests:
13-
--browser=BROWSER (The web browser to use.)
13+
--browser=BROWSER (The web browser to use. Default: "chrome".)
14+
--user-data-dir=DIR (Set the Chrome user data directory to use.)
15+
--server=SERVER (The Selenium Grid server/IP used for tests.)
16+
--port=PORT (The Selenium Grid port used by the test server.)
1417
--cap-file=FILE (The web browser's desired capabilities to use.)
1518
--cap-string=STRING (The web browser's desired capabilities to use.)
16-
--user-data-dir=DIR (Set the Chrome user data directory to use.)
17-
--server=SERVER (The server / IP address used by the tests.)
18-
--port=PORT (The port that's used by the test server.)
19-
--proxy=SERVER:PORT (This is the proxy server:port combo used by tests.)
19+
--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)
20+
--proxy=USERNAME:PASSWORD@SERVER:PORT (Use authenticated proxy server.)
2021
--agent=STRING (Modify the web browser's User-Agent string.)
2122
--mobile (Use the mobile device emulator while running tests.)
2223
--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)

0 commit comments

Comments
 (0)