Skip to content

Commit 426e031

Browse files
committed
Add ad_block command line arg for Pytest
1 parent 973a152 commit 426e031

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,7 @@ def setUp(self):
18961896
self.demo_mode = pytest.config.option.demo_mode
18971897
self.demo_sleep = pytest.config.option.demo_sleep
18981898
self.highlights = pytest.config.option.highlights
1899+
self.ad_block_on = pytest.config.option.ad_block_on
18991900
self.verify_delay = pytest.config.option.verify_delay
19001901
self.timeout_multiplier = pytest.config.option.timeout_multiplier
19011902
self.use_grid = False

seleniumbase/plugins/pytest_plugin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def pytest_addoption(parser):
107107
default=None,
108108
help="""Setting this overrides the default number of
109109
highlight animation loops to have per call.""")
110+
parser.addoption('--ad_block', action="store_true",
111+
dest='ad_block_on',
112+
default=False,
113+
help="""Using this makes WebDriver block display ads
114+
that are defined in ad_block_list.AD_BLOCK_LIST.""")
110115
parser.addoption('--verify_delay', action='store', dest='verify_delay',
111116
default=None,
112117
help="""Setting this overrides the default wait time

0 commit comments

Comments
 (0)