Verify on logout; Persona (BID) session is also terminated

Updated according reviews

Removed unused import and pep8
This commit is contained in:
Andrei Hutusoru 2013-09-13 15:05:46 +03:00
Родитель 6484d09793
Коммит d4bd3bb466
3 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -88,6 +88,9 @@ class Base(Page):
from pages.profile import Profile
return Profile(self.testsetup)
def logout_using_url(self):
self.get_relative_path(u'/logout')
class Header(Page):
_search_box_locator = (By.CSS_SELECTOR, 'input.search-query')

Просмотреть файл

@ -4,7 +4,7 @@
# 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 selenium.webdriver.support.ui import WebDriverWait
from pages.base import Base
@ -14,3 +14,11 @@ class Home(Base):
Base.__init__(self, testsetup)
if open_url:
self.selenium.get(self.base_url)
def wait_for_user_login(self):
# waits to see if user gets logged back in
# if not then all ok
try:
WebDriverWait(self.selenium, 20).until(lambda s: self.is_user_loggedin)
except Exception:
pass

Просмотреть файл

@ -22,6 +22,19 @@ class TestAccount:
home_page.header.click_logout_menu_item()
Assert.true(home_page.is_browserid_link_present)
@pytest.mark.nondestructive
def test_logout_verify_bid(self, mozwebqa):
# issue https://github.com/mozilla/mozillians-tests/issues/99
home_page = Home(mozwebqa)
Assert.true(home_page.is_csrf_token_present)
home_page.login()
Assert.true(home_page.header.is_logout_menu_item_present)
home_page.logout_using_url()
home_page.wait_for_user_login()
Assert.true(home_page.is_browserid_link_present)
@pytest.mark.skip_selenium
@pytest.mark.nondestructive
def test_that_links_in_footer_return_200_code(self, mozwebqa):