Commit 8f95d578 by linguangwei

操作被隐藏的元素界面可视

parent bccd5bf6
......@@ -114,6 +114,11 @@ class Page(object):
def switch_to_current(self):
self.driver.switch_to.default_content()
# 操作脚本
def excute_script(self, loc):
# self.driver.execute_script("document.getElementsByClassName('form xm_phone_login')[0].style.position = 'static'")
self.driver.execute_script("document.getElementsByClassName('{}')[0].style.position = 'static'".format(loc))
# 切换窗口,切换到存在loc元素的窗口
def change_window(self, loc):
driver = self.driver
......
......@@ -37,3 +37,8 @@ class LoginPage(Page):
# 点击登录
def click_login(self):
self.click(self.login_button)
# 手机号码登录窗口可显示操作
def phone_input_execute_script(self):
self.excute_script("form xm_phone_login")
......@@ -23,11 +23,13 @@ class TestLoginPage(object):
@pytest.mark.usefixtures("before_test_case")
def testLogin(self):
login_page = LoginPage(driver=self.driver)
login_page.click_phone_login()
login_page.phone_input_execute_script()
login_page.sleep(2)
# login_page.click_phone_login()
login_page.input_account(account=self.account)
login_page.input_password(password=self.password)
login_page.click_login()
login_page.sleep(1)
login_page.sleep(5)
# 校验是否存在店铺名称的元素
assert login_page.ifElementExist(login_page.store_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment