| 226 | |
| 227 | @pytest.fixture(scope="session") |
| 228 | def browser(request): |
| 229 | try: |
| 230 | from selenium import webdriver |
| 231 | print("Starting chromedriver...") |
| 232 | options = webdriver.chrome.options.Options() |
| 233 | options.add_argument("--headless") |
| 234 | options.add_argument("--window-size=1920x1080") |
| 235 | options.add_argument("--log-level=1") |
| 236 | browser = webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, service_log_path=os.path.devnull, options=options) |
| 237 | |
| 238 | def quit(): |
| 239 | browser.quit() |
| 240 | request.addfinalizer(quit) |
| 241 | except Exception as err: |
| 242 | raise pytest.skip("Test requires selenium + chromedriver: %s" % err) |
| 243 | return browser |
| 244 | |
| 245 | |
| 246 | @pytest.fixture(scope="session") |