|
1 | 1 | """ The main purpose of this file is to demonstrate running SeleniumBase
|
2 | 2 | scripts without the use of Pytest by calling the script directly
|
3 |
| - with Python or from a Python interactive interpreter. Based on |
4 |
| - whether relative imports work or don't, the script can autodetect |
5 |
| - how this file was run. With pure Python, it will initialize |
6 |
| - all the variables that would've been automatically initialized |
7 |
| - by the Pytest plugin. The setUp() and tearDown() methods are also |
8 |
| - now called from the script itself. |
| 3 | + with Python or from a Python interactive interpreter. |
| 4 | + Based on whether relative imports work or don't work, this script |
| 5 | + can autodetect how this file was run. With pure Python, it |
| 6 | + initializes all the variables that would've been automatically |
| 7 | + initialized by the Pytest plugin. The setUp() and tearDown() methods |
| 8 | + are also now called from the script itself. |
| 9 | +
|
| 10 | + (Note: The SB() and Driver() formats make this example obsolete.) |
9 | 11 |
|
10 | 12 | One big advantage to running tests with Pytest is that most of this
|
11 | 13 | is done for you automatically, with the option to update any of the
|
12 | 14 | parameters through command-line parsing. Pytest also provides you
|
13 | 15 | with other plugins, such as ones for generating test reports,
|
14 | 16 | handling multithreading, and parametrized tests. Depending on your
|
15 | 17 | specific needs, you may need to call SeleniumBase commands without
|
16 |
| - using Pytest, and this example shows you how. |
| 18 | + using Pytest, and this example shows you one way of doing that. |
17 | 19 | """
|
| 20 | + |
18 | 21 | pure_python = False
|
19 | 22 | try:
|
20 | 23 | # Running with Pytest / (Finds test methods to run using autodiscovery)
|
|
33 | 36 | sb.browser = "chrome"
|
34 | 37 | sb.is_behave = False
|
35 | 38 | sb.headless = False
|
| 39 | + sb.headless1 = False |
36 | 40 | sb.headless2 = False
|
37 | 41 | sb.headed = False
|
38 | 42 | sb.xvfb = False
|
| 43 | + sb.xvfb_metrics = None |
39 | 44 | sb.start_page = None
|
40 | 45 | sb.locale_code = None
|
41 | 46 | sb.protocol = "http"
|
|
79 | 84 | sb.esc_end = False
|
80 | 85 | sb.use_wire = False
|
81 | 86 | sb.enable_3d_apis = False
|
| 87 | + sb.window_position = None |
82 | 88 | sb.window_size = None
|
83 | 89 | sb.maximize_option = False
|
84 | 90 | sb.visual_baseline = False
|
| 91 | + sb.disable_cookies = False |
85 | 92 | sb.disable_features = None
|
86 | 93 | sb._disable_beforeunload = False
|
87 | 94 | sb.save_screenshot_after_test = False
|
|
0 commit comments