Created
February 1, 2019 12:22
-
-
Save yai333/6c1d85bc1a331f670251b6d96ab2aea6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pytest | |
| from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| def pytest_addoption(parser): | |
| parser.addoption("--url", action="store", default="http://localhost", help="url") | |
| @pytest.fixture(scope="module", autouse=True) | |
| def browser(): | |
| options = Options() | |
| options.add_argument('--headless') | |
| options.add_argument('--no-sandbox') | |
| options.add_argument('--single-process') | |
| options.add_argument('--disable-dev-shm-usage') | |
| browser = webdriver.Chrome(chrome_options=options) | |
| return browser | |
| @pytest.fixture(scope="module") | |
| def url(request): | |
| return request.config.getoption("--url") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment