-
Notifications
You must be signed in to change notification settings - Fork 554
Configure current UI tests to run on each PR. #4875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [tool:pytest] | ||
| addopts = -r=a --verbose | ||
| base_url = https://addons-dev.allizom.org | ||
| sensitive_url = mozilla\.(com|org) | ||
| xfail_strict = true | ||
| DJANGO_SETTINGS_MODULE = settings_test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,24 @@ | ||
| import os | ||
| import pytest | ||
|
|
||
| from pages.desktop.home import Home | ||
|
|
||
|
|
||
| @pytest.mark.skip( | ||
| reason='https://github.com/mozilla/addons-server/issues/2462') | ||
| def test_login(base_url, selenium, user): | ||
| @pytest.mark.skipif(os.environ.get('PYTEST_BASE_URL') is None, | ||
| reason='Live Server login currently not functioning') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I'm blind, knowing that this is hard to fix, are there any tests currently running that are using the live-server and thus testing the overwritten
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this should probably use another environment variable than Also, can be changed later but we should abstract these switches and skips into something like requires_real_environment = pytest.mark.skipif(os.environ.get('UITEST_USE_LIVESERVER') is None, reason='Requires a real environment not the live_server')
@requires_real_environment
def test_login(my_base_url, selenium, user):
# ...And set the actual reason in the docstring. Again, let's not do this now but maybe later when we have more tests that need switching back and forth.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have a patch for this, but I will keep this in mind.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
right but no test is actually using it right now, right? Just want to make sure I'm not missing anything.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They all use |
||
| def test_login(my_base_url, selenium, user): | ||
| """User can login""" | ||
| page = Home(selenium, base_url).open() | ||
| page = Home(selenium, my_base_url).open() | ||
| assert not page.logged_in | ||
| page.login(user['email'], user['password']) | ||
| assert page.logged_in | ||
|
|
||
|
|
||
| @pytest.mark.skip( | ||
| reason='https://github.com/mozilla/addons-server/issues/2462') | ||
| def test_logout(base_url, selenium, user): | ||
| reason='https://github.com/mozilla/geckodriver/issues/233') | ||
| def test_logout(my_base_url, selenium, user): | ||
| """User can logout""" | ||
| page = Home(selenium, base_url).open() | ||
| page = Home(selenium, my_base_url).open() | ||
| page.login(user['email'], user['password']) | ||
| page.logout() | ||
| assert not page.logged_in | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed it, if you ever have the need to use it, there's also
olympia.landfill.user:generate_addon_user_and_categorywhich does this and creates a proper (featured) category too.