Пример #1
0
 def setUpClass(self):
     My_Log().info(
         '############################### START ###############################'
     )
     self.driver = select_browser(browser_name)
     Page(self.driver).max_window()
     Page(self.driver).wait(secs=2)
Пример #2
0
 def setUpClass(self):
     self.logger = Log()
     self.logger.info(
         '############################### START ###############################'
     )
     self.driver = browser.select_browser(globalparam.browser)
     # self.driver.implicitly_wait(10)
     Page(self.driver).max_window()
Пример #3
0
    def login_name(self, username):
        self.element_send_keys(self.login_name_loc, username)

    def login_password(self, password):
        self.element_send_keys(self.login_password_loc, password)

    def login_click(self):
        self.element_click(self.login_button_loc)

    def login_error_text(self):
        return self.element_get_text(self.login_error_loc)

    def login_success_text(self):
        return self.element_get_text(self.login_success_loc)

    # 登录操作
    def user_login(self, username, password):
        self.open()
        self.login_name(username)
        self.login_password(password)
        self.login_click()


if __name__ == '__main__':
    wb = browser.select_browser(browser='firefox')
    test = Login_page(wb, "http://192.168.1.96:8082/passport")
    test.open()
    test.user_login("root", "zaq12wsx")
    print(test.login_success_text())
    # print(test.login_error_text())
Пример #4
0
 def setUp(self):
     self.driver = browser.select_browser(browser='firefox')
     Page(self.driver).max_window()