I am using pytest-mozwebqa
plugin for running some selenium tests. I want to login to the application only once for all the tests so I tried using a session scoped fixture in the conftest.py
but I am getting following error. How can I write this login fixture so that login is not required per test and a single login is available to all tests?
This is the error I am getting:
================================================================================================= ERRORS ==================================================================================================
___________________________________________________________________________ ERROR at setup of TestData.test_selected_version ____________________________________________________________________________
ScopeMismatch: You tried to access the 'function' scoped fixture 'mozwebqa' with a 'module' scoped request object, involved factories
conftest.py:6: def login(mozwebqa, variables)
../../.virtualenvs/webqa/lib/python2.7/site-packages/pytest_mozwebqa/pytest_mozwebqa.py:159: def pytest_funcarg__mozwebqa(request)
Content of the conftest.py
:
@pytest.fixture(scope='session')
def login(mozwebqa, variables):
data_page = DataPage(mozwebqa)
network_page = data_page.select_version(variables)
return network_page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With