class HomeBusiness:

    def __init__(self, i):
        self.home_handle = HomeHandle(i)

    def dialog_pass(self):
        """
        关闭红包
        """
        self.home_handle.click_dialog()
Exemplo n.º 2
0
class TestLogin:
    mydriver = None
    homepage = None
    loginpage = None

    def setup_class(self):
        self.mydriver = BaseDriver('http://localhost/')
        self.mydriver.set_max_window()
        self.mydriver.set_imp_wait(10)

    def teardown_class(self):
        time.sleep(2)
        self.mydriver.quit()

    # @pytest.mark.skip
    @allure.title('进入主页后跳转至登录页')
    @pytest.mark.run(order=1)
    def test_to_loginpage(self):
        self.homepage = HomeHandle(self.mydriver)
        self.homepage.go_2_loginpage()

    # @pytest.mark.skip
    @allure.title("登录")
    @allure.description("用例描述:测试登录的各种异常情况")
    @pytest.mark.parametrize(
        ("username", "password", "veriycode", "dialog_text"), build_data())
    @pytest.mark.run(order=2)
    def test_login_error(self, username, password, veriycode, dialog_text):
        self.loginpage = LoginHandle(self.mydriver)
        self.loginpage.input_username(username)
        self.loginpage.input_password(password)
        self.loginpage.input_veriycode(veriycode)
        self.loginpage.click_login()
        dialog_text = self.loginpage.get_dialog_text()
        time.sleep(1)
        self.loginpage.click_dialog_yes_bg()
        assert dialog_text == dialog_text
Exemplo n.º 3
0
class HomeBusiness:
    def __init__(self, driver):
        self.home_handle = HomeHandle(driver)

    def city_change_accept(self):
        if self.home_handle.get_city_change_alert():
            self.home_handle.accept_city_change()
        else:
            return False

    def city_change_cancel(self):
        if self.home_handle.get_city_change_alert():
            self.home_handle.cancel_city_change()
        else:
            return False
Exemplo n.º 4
0
 def test_to_loginpage(self):
     self.homepage = HomeHandle(self.mydriver)
     self.homepage.go_2_loginpage()
Exemplo n.º 5
0
 def test_to_loginpage(self):
     homehandle = HomeHandle(self.driver)
     homehandle.go_2_loginpage()
Exemplo n.º 6
0
 def __init__(self, driver):
     self.home_handle = HomeHandle(driver)
 def __init__(self, i):
     self.home_handle = HomeHandle(i)