Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### def blablabla
- self.input_clear_and_enter(self.by_name("username"), login)
- self.input_clear_and_enter(self.by_name("password"), password)
- self.by_xpath("/html/body/div[1]/div/div/div/div[2]/form/a").click()
- h3_title = self.by_xpath('/html/body/div[4]/div[1]/div/div/div/h3').text
- if 'Панель управления' in h3_title :
- self.log_info('logged to SPICY.CMS ADMINPANEL ... OK')
- self.scr('login_to_adminpanel')
- return True
- else:
- log_error("Login failed")
- def unlogin_from_admin(self):
- self.go("/admin/")
- self.wait(.8)
- self.by_xpath("//span[contains(text(),'admin')]").click()
- self.by_xpath("//li[5]/a/span").click()
- good_bye_text = self.by_xpath("/html/body/div[1]/div/div/div/div[1]/span").text
- assert ('До свидания' in good_bye_text), "Unlogin failed"
- self.log_info('Login to adminpanel OK')
- self.scr('unlogin_to_adminpanel')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement