|
1 |
| -""" |
2 |
| -This plugin gives the power of Selenium to nosetests |
3 |
| -by providing a WebDriver object for the tests to use. |
4 |
| -""" |
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +""" This is the nosetests Selenium plugin for test configuration. """ |
5 | 3 |
|
6 | 4 | import sys
|
7 | 5 | from nose.plugins import Plugin
|
|
11 | 9 |
|
12 | 10 | class SeleniumBrowser(Plugin):
|
13 | 11 | """
|
14 |
| - The plugin for Selenium tests. Takes in key arguments and then |
15 |
| - creates a WebDriver object. All arguments are passed to the tests. |
16 |
| -
|
17 |
| - The following command line options are available to the tests: |
18 |
| - self.options.browser -- the browser to use (--browser) |
19 |
| - self.options.cap_file -- browser's desired capabilities file (--cap_file) |
20 |
| - self.options.user_data_dir -- set Chrome's user data dir (--user_data_dir) |
21 |
| - self.options.server -- the server used by the test (--server) |
22 |
| - self.options.port -- the port used by the test (--port) |
23 |
| - self.options.proxy -- designates the proxy server:port to use. (--proxy) |
24 |
| - self.options.agent -- designates the User Agent for the browser. (--agent) |
25 |
| - self.options.extension_zip -- load a Chrome Extension ZIP (--extension_zip) |
26 |
| - self.options.extension_dir -- load a Chrome Extension DIR (--extension_dir) |
27 |
| - self.options.headless -- the option to run headlessly (--headless) |
28 |
| - self.options.headed -- the option to run with a GUI on Linux (--headed) |
29 |
| - self.options.demo_mode -- the option to slow down Selenium (--demo_mode) |
30 |
| - self.options.demo_sleep -- Selenium action delay in DemoMode (--demo_sleep) |
31 |
| - self.options.highlights -- # of highlight animations shown (--highlights) |
32 |
| - self.options.message_duration -- Messenger alert time (--message_duration) |
33 |
| - self.options.js_checking_on -- option to check for js errors (--check_js) |
34 |
| - self.options.ad_block -- the option to block some display ads (--ad_block) |
35 |
| - self.options.verify_delay -- delay before MasterQA checks (--verify_delay) |
36 |
| - self.options.disable_csp -- disable Content Security Policy (--disable_csp) |
37 |
| - self.options.enable_sync -- option to enable "Chrome Sync" (--enable_sync) |
38 |
| - self.options.save_screenshot -- save screen after test (--save_screenshot) |
39 |
| - self.options.visual_baseline -- set the visual baseline (--visual_baseline) |
40 |
| - self.options.timeout_multiplier -- increase defaults (--timeout_multiplier) |
| 12 | + This parser plugin includes the following command-line options for Nose: |
| 13 | + --browser=BROWSER (The web browser to use.) |
| 14 | + --cap_file=FILE (The web browser's desired capabilities to use.) |
| 15 | + --user_data_dir=DIR (Set the Chrome user data directory to use.) |
| 16 | + --server=SERVER (The server / IP address used by the tests.) |
| 17 | + --port=PORT (The port that's used by the test server.) |
| 18 | + --proxy=SERVER:PORT (This is the proxy server:port combo used by tests.) |
| 19 | + --agent=STRING (This designates the web browser's User Agent to use.) |
| 20 | + --extension_zip=ZIP (Load a Chrome Extension .zip file, comma-separated.) |
| 21 | + --extension_dir=DIR (Load a Chrome Extension directory, comma-separated.) |
| 22 | + --headless (The option to run tests headlessly. The default on Linux OS.) |
| 23 | + --headed (The option to run tests with a GUI on Linux OS.) |
| 24 | + --start_page=URL (The starting URL for the web browser when tests begin.) |
| 25 | + --demo_mode (The option to visually see test actions as they occur.) |
| 26 | + --demo_sleep=SECONDS (The option to wait longer after Demo Mode actions.) |
| 27 | + --highlights=NUM (Number of highlight animations for Demo Mode actions.) |
| 28 | + --message_duration=SECONDS (The time length for Messenger alerts.) |
| 29 | + --check_js (The option to check for JavaScript errors after page loads.) |
| 30 | + --ad_block (The option to block some display ads after page loads.) |
| 31 | + --verify_delay=SECONDS (The delay before MasterQA verification checks.) |
| 32 | + --disable_csp (This disables the Content Security Policy of websites.) |
| 33 | + --enable_sync (The option to enable "Chrome Sync".) |
| 34 | + --save_screenshot (The option to save a screenshot after each test.) |
| 35 | + --visual_baseline (Set the visual baseline for Visual/Layout tests.) |
| 36 | + --timeout_multiplier=MULTIPLIER (Multiplies the default timeout values.) |
41 | 37 | """
|
42 | 38 | name = 'selenium' # Usage: --with-selenium
|
43 | 39 |
|
|
0 commit comments