2017-02-07 22:21:09 +03:00
|
|
|
import os
|
2016-06-27 11:30:28 +03:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from pages.desktop.home import Home
|
|
|
|
|
|
|
|
|
2017-02-07 22:21:09 +03:00
|
|
|
@pytest.mark.skipif(os.environ.get('PYTEST_BASE_URL') is None,
|
|
|
|
reason='Live Server login currently not functioning')
|
2017-10-05 14:14:08 +03:00
|
|
|
def test_login(base_url, selenium, user):
|
2016-06-27 11:30:28 +03:00
|
|
|
"""User can login"""
|
2017-10-05 14:14:08 +03:00
|
|
|
page = Home(selenium, base_url).open()
|
2016-06-27 11:30:28 +03:00
|
|
|
assert not page.logged_in
|
|
|
|
page.login(user['email'], user['password'])
|
|
|
|
assert page.logged_in
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(
|
2017-02-07 22:21:09 +03:00
|
|
|
reason='https://github.com/mozilla/geckodriver/issues/233')
|
2017-10-05 14:14:08 +03:00
|
|
|
def test_logout(base_url, selenium, user):
|
2016-06-27 11:30:28 +03:00
|
|
|
"""User can logout"""
|
2017-10-05 14:14:08 +03:00
|
|
|
page = Home(selenium, base_url).open()
|
2016-06-27 11:30:28 +03:00
|
|
|
page.login(user['email'], user['password'])
|
|
|
|
page.logout()
|
|
|
|
assert not page.logged_in
|