<s> from selenium . webdriver . common import by <EOL> from openstack_dashboard . test . integration_tests . pages import basepage <EOL> from openstack_dashboard . test . integration_tests . regions import forms <EOL> class ChangepasswordPage ( basepage . BaseNavigationPage ) : <EOL> _password_form_locator = ( by . By . ID , '<STR_LIT>' ) <EOL> CHANGE_PASSWORD_FORM_FIELDS = ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> @ property <EOL> def password_form ( self ) : <EOL> src_elem = self . _get_element ( * self . _password_form_locator ) <EOL> return forms . FormRegion ( <EOL> self . driver , self . conf , src_elem = src_elem , <EOL> field_mappings = self . CHANGE_PASSWORD_FORM_FIELDS ) <EOL> def change_password ( self , current , new ) : <EOL> self . password_form . current_password . text = current <EOL> self . password_form . new_password . text = new <EOL> self . password_form . confirm_password . text = new <EOL> self . password_form . submit ( ) <EOL> def reset_to_default_password ( self , current ) : <EOL> if self . topbar . user . text == self . conf . identity . admin_username : <EOL> return self . change_password ( current , <EOL> self . conf . identity . admin_password ) <EOL> else : <EOL> return self . change_password ( current , <EOL> self . conf . identity . password ) </s>
