Merge pull request #9546 from Realjuan/selenium_sign_out_test

Implementation of Selenium test for signout from user preferences
This commit is contained in:
John Chilton
2020-04-20 12:55:16 -04:00
committed by GitHub
3 changed files with 28 additions and 1 deletions
@@ -83,7 +83,7 @@ export const getUserPreferencesModel = () => {
},
logout: {
title: _l("Sign Out"),
id: "edit-preferences-custom-builds",
id: "edit-preferences-sign-out",
description: _l("Click here to sign out of all sessions."),
icon: "fa-sign-out",
shouldRender: !!Galaxy.session_csrf_token,
+6
View File
@@ -70,6 +70,7 @@ masthead:
preferences:
selectors:
sign_out: "#edit-preferences-sign-out"
change_password: "#edit-preferences-password"
manage_information: '#edit-preferences-information'
current_email: "#user-preferences-current-email"
@@ -88,6 +89,11 @@ change_user_address:
type: xpath
selector: '//span[contains(text(), "Insert Address")]'
sign_out:
selectors:
cancel_button: '.modal-footer .buttons #button-0'
sign_out_button: '.modal-footer .buttons #button-1'
history_panel:
menu:
labels:
+21
View File
@@ -0,0 +1,21 @@
from .framework import (
selenium_test,
SeleniumTestCase
)
class SignOutTestCase(SeleniumTestCase):
@selenium_test
def test_sign_out(self):
email = self._get_random_email()
self.register(email)
self.click_masthead_user()
self.components.masthead.preferences.wait_for_and_click()
self.components.preferences.sign_out.wait_for_and_click()
self.components.sign_out.cancel_button.wait_for_and_click()
assert self.is_logged_in()
new_email = self.driver.find_element_by_id("user-preferences-current-email").text
self.assertTrue(email == new_email)
self.components.preferences.sign_out.wait_for_and_click()
self.components.sign_out.sign_out_button.wait_for_and_click()
assert not self.is_logged_in()