mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
WebUI Tests: changing how the login screen is detected
The "rcue-login-screen" element does not exist anymore. Changing the code to use the ".login-pf" instead. With the change, it's also necessary to check if the login screen is still visible when trying to fill the fields of new password, otherwise a StaleElementReferenceException exception will be raised. Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
7c3f9b79eb
commit
49a17e98b0
@ -385,14 +385,15 @@ class UI_driver(object):
|
||||
self.wait_for_request(n=2)
|
||||
|
||||
# reset password if needed
|
||||
newpw_tb = self.find("//input[@type='password'][@name='new_password']", 'xpath', auth)
|
||||
verify_tb = self.find("//input[@type='password'][@name='verify_password']", 'xpath', auth)
|
||||
if newpw_tb and newpw_tb.is_displayed():
|
||||
newpw_tb.send_keys(new_password)
|
||||
verify_tb.send_keys(new_password)
|
||||
verify_tb.send_keys(Keys.RETURN)
|
||||
self.wait(0.5)
|
||||
self.wait_for_request(n=2)
|
||||
if self.login_screen_visible():
|
||||
newpw_tb = self.find("//input[@type='password'][@name='new_password']", 'xpath', auth)
|
||||
verify_tb = self.find("//input[@type='password'][@name='verify_password']", 'xpath', auth)
|
||||
if newpw_tb and newpw_tb.is_displayed():
|
||||
newpw_tb.send_keys(new_password)
|
||||
verify_tb.send_keys(new_password)
|
||||
verify_tb.send_keys(Keys.RETURN)
|
||||
self.wait(0.5)
|
||||
self.wait_for_request(n=2)
|
||||
|
||||
def logged_in(self):
|
||||
"""
|
||||
@ -405,12 +406,13 @@ class UI_driver(object):
|
||||
|
||||
def logout(self):
|
||||
self.profile_menu_action('logout')
|
||||
assert self.login_screen_visible()
|
||||
|
||||
def get_login_screen(self):
|
||||
"""
|
||||
Get reference of login screen
|
||||
"""
|
||||
return self.find('rcue-login-screen', 'id')
|
||||
return self.find('.login-pf', By.CSS_SELECTOR)
|
||||
|
||||
def login_screen_visible(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user