Setting the browser via shortcut in pytest.main() isn't working
To reproduce, run the following script with python:
from seleniumbase import BaseCase
if __name__ == "__main__":
from pytest import main
main([__file__, "--edge", "-s"])
class EdgeTests(BaseCase):
def test_edge(self):
if self.browser != "edge":
self.open("data:,")
print("\n This test is only for Microsoft Edge (Chromium)!")
print(' (Run this test using "--edge" or "--browser=edge")')
self.skip('Use "--edge" or "--browser=edge"')
if self.headless:
self.open("data:,")
print("\n This test is NOT designed for Headless Mode!")
self.skip('Do NOT use "--headless" with this test!')
self.open("edge://settings/help")
self.highlight('div[role="main"]')
self.highlight('img[srcset*="logo"]')
self.assert_text("Microsoft Edge", 'img[srcset*="logo"] + div')
self.highlight('img[srcset*="logo"] + div span:nth-of-type(1)')
self.highlight('img[srcset*="logo"] + div span:nth-of-type(2)')
self.highlight('span[aria-live="assertive"]')
self.highlight('a[href*="chromium"]')
The --edge option wasn't taking effect from the pytest.main() call at the top when run with python.
Instead, the default browser, (Chrome), was being used instead.
Setting the browser via shortcut in
pytest.main()
isn't workingTo reproduce, run the following script with
python
:The
--edge
option wasn't taking effect from thepytest.main()
call at the top when run withpython
. Instead, the default browser, (Chrome
), was being used instead.