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
You can interchange **pytest** with **nosetests**, but using pytest is strongly recommended because developers stopped supporting nosetests. Chrome is the default browser if not specified.
56
58
57
59
(NOTE: If you're using **pytest** for running tests outside of the SeleniumBase repo, **you'll want a copy of [pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini) at the base of the new folder structure**. If using **nosetests**, the same applies for [setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg).)
58
60
61
+
An easy way to override seleniumbase/config/settings.py is by using a custom settings file.
62
+
Here's the command-line option to add to tests: (See [examples/custom_settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/custom_settings.py))
63
+
``--settings_file=custom_settings.py``
64
+
(Settings include default timeout values, a two-factor auth key, DB credentials, S3 credentials, Email Testing API credentials, and other important settings used by tests.)
65
+
59
66
#### **Running tests on [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, the [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium) Selenium Grid, the [TestingBot](https://testingbot.com/features) Selenium Grid, (or your own):**
60
67
61
68
Here's how to connect to a BrowserStack Selenium Grid server for running tests:
(NOTE: You can add ``--show_report`` to immediately display Nosetest reports after the test suite completes. Only use ``--show_report`` when running tests locally because it pauses the test run.)
158
165
159
-
Here are some other useful arguments:
166
+
Here are some other useful command-line options that come with Pytest:
160
167
```bash
161
-
-v # Prints the full test name rather than a dot for each test.
168
+
-v # Prints the full test name for each test.
169
+
-q # Prints fewer details in the console output when running tests.
162
170
-x # Stop running the tests after the first failure is reached.
163
-
```
164
-
165
-
Here's a **nosetests**-specific argument:
166
-
```bash
167
-
--logging-level=INFO # Hide DEBUG messages, which can be overwhelming.
168
-
```
171
+
--html=report.html # Creates a detailed test report after tests complete. (Using the pytest-html plugin)
172
+
--collect-only # Show what tests would get run without actually running them.
173
+
-s # See print statements. (Should be on by default with pytest.ini present.)
174
+
-n=NUM # Multithread the tests using that many threads. (Speed up test runs!)
175
+
```
176
+
177
+
SeleniumBase provides additional Pytest command-line options for tests:
178
+
```bash
179
+
--browser=BROWSER # (The web browser to use.)
180
+
--cap_file=FILE # (The web browser's desired capabilities to use.)
--env=ENV # (Set a test environment. Use "self.env" to use this in tests.)
183
+
--data=DATA # (Extra data to pass to tests. Use "self.data" in tests.)
184
+
--user_data_dir=DIR # (Set the Chrome user data directory to use.)
185
+
--server=SERVER # (The server / IP address used by the tests.)
186
+
--port=PORT # (The port that's used by the test server.)
187
+
--proxy=SERVER:PORT # (This is the proxy server:port combo used by tests.)
188
+
--agent=STRING # (This designates the web browser's User Agent to use.)
189
+
--extension_zip=ZIP # (Load a Chrome Extension .zip file, comma-separated.)
190
+
--extension_dir=DIR # (Load a Chrome Extension directory, comma-separated.)
191
+
--headless # (The option to run tests headlessly. The default on Linux OS.)
192
+
--headed # (The option to run tests with a GUI on Linux OS.)
193
+
--start_page=URL # (The starting URL for the web browser when tests begin.)
194
+
--log_path=LOG_PATH # (The directory where log files get saved to.)
195
+
--archive_logs # (Archive old log files instead of deleting them.)
196
+
--demo_mode # (The option to visually see test actions as they occur.)
197
+
--demo_sleep=SECONDS # (The option to wait longer after Demo Mode actions.)
198
+
--highlights=NUM # (Number of highlight animations for Demo Mode actions.)
199
+
--message_duration=SECONDS # (The time length for Messenger alerts.)
200
+
--check_js # (The option to check for JavaScript errors after page loads.)
201
+
--ad_block # (The option to block some display ads after page loads.)
202
+
--verify_delay=SECONDS # (The delay before MasterQA verification checks.)
203
+
--disable_csp # (This disables the Content Security Policy of websites.)
204
+
--enable_sync # (The option to enable "Chrome Sync".)
205
+
--maximize_window # (The option to start with the web browser maximized.)
206
+
--save_screenshot # (The option to save a screenshot after each test.)
207
+
--visual_baseline # (Set the visual baseline for Visual/Layout tests.)
208
+
--timeout_multiplier=MULTIPLIER # (Multiplies the default timeout values.)
209
+
```
210
+
(For more details, see the full list of command-line options **[here](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/pytest_plugin.py)**.)
Copy file name to clipboardExpand all lines: help_docs/mysql_installation.md
+26-20Lines changed: 26 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,40 @@
5
5
6
6
(NOTE: If you're using this test framework from a local development machine and don't plan on writing to a MySQL DB from your local test runs, you can skip this step.)
7
7
8
-
##### macOS:
8
+
##### Linux (Ubuntu):
9
9
```bash
10
-
brew install MySQL
10
+
sudo apt update
11
+
sudo apt install mysql-server
12
+
sudo mysql_secure_installation
13
+
sudo mysql -e 'CREATE DATABASE IF NOT EXISTS test_db;'
14
+
sudo mysql -h 127.0.0.1 -u root test_db < seleniumbase/core/create_db_tables.sql
15
+
sudo service mysql restart
11
16
```
12
17
13
-
##### Windows:
14
-
[Download MySQL here](http://dev.mysql.com/downloads/windows/)
15
-
16
-
That installs the MySQL library so that you can use database commands in your code. To make that useful, you'll want to have a MySQL DB that you can connect to.
0 commit comments