This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
Added Login/Logout test #12
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
default: | |||
username: <username> | |||
password: <password> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
#!/usr/bin/env python | |||
# This Source Code Form is subject to the terms of the Mozilla Public | |||
# License, v. 2.0. If a copy of the MPL was not distributed with this | |||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |||
|
|||
from unittestzero import Assert | |||
|
|||
from pages.home import HomePage | |||
|
|||
|
|||
class TestLoginLogout: | |||
|
|||
def test_login(self, mozwebqa): | |||
home_pg = HomePage(mozwebqa) | |||
home_pg.go_to_home_page() | |||
home_pg.login_region.login() | |||
Assert.true(home_pg.is_logged_in) | |||
|
|||
|
|||
def test_logout(self, mozwebqa): | |||
home_pg = HomePage(mozwebqa) | |||
home_pg.go_to_home_page() | |||
home_pg.login_region.login() | |||
Assert.true(home_pg.is_logged_in) | |||
home_pg.login_region.logout() | |||
Assert.true(not home_pg.is_logged_in) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -3,15 +3,19 @@ | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | # file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
|
||
import pytest | |||
import random | import random | ||
|
|
||
from unittestzero import Assert | from unittestzero import Assert | ||
|
|
||
from pages.home import HomePage | from pages.home import HomePage | ||
|
|
||
xfail = pytest.mark.xfail | |||
|
|||
|
|
||
class TestUserRegistration: | class TestUserRegistration: | ||
|
|
||
@xfail(reason="There is a capcha on the registration page") | |||
def test_new_user_can_register(self, mozwebqa): | def test_new_user_can_register(self, mozwebqa): | ||
home_pg = HomePage(mozwebqa) | home_pg = HomePage(mozwebqa) | ||
home_pg.go_to_home_page() | home_pg.go_to_home_page() | ||
|
@@ -26,8 +30,11 @@ def test_username_only_allows_lower_case_letters_and_numbers(self, mozwebqa): | ||
registration_pg = home_pg.login_region.click_sign_up() | registration_pg = home_pg.login_region.click_sign_up() | ||
|
|
||
invalid_characters = range(32, 47) + range(58, 96) + range(123, 127) | invalid_characters = range(32, 47) + range(58, 96) + range(123, 127) | ||
invalid_username = "automatedtest%s" % chr(random.choice(invalid_characters)) | invalid_username = "automatedtest%s" % chr(random.choice( | ||
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. Lines too long for you, eh? Fair enough. :P |
|||
invalid_characters)) | |||
|
|||
print "invalid_username : %s" % invalid_username | print "invalid_username : %s" % invalid_username | ||
registration_pg.type_username(invalid_username) | registration_pg.type_username(invalid_username) | ||
registration_pg.submit_registration() | registration_pg.submit_registration() | ||
Assert.equal(registration_pg.username_error, "Only lowercase letters and numbers allowed") | Assert.equal(registration_pg.username_error, | ||
"Only lowercase letters and numbers allowed") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks for xfailing this.