Beispiel #1
0
    def start(self):
        driver = WebDriverFactory.get_chrome_driver(self.__driver_path)
        executor = Actions(driver)

        driver.get(self.__url)

        # 进入登入界面
        executor.click_element('input[title="ログイン"]')

        # 输入账号密码 登入
        executor.input_text('input[id="tel"]', self.__tel)
        executor.input_text('input[id="pass"]', self.__tel_password)
        executor.click_element('input[alt="ログイン"]')

        # 点击ボイスワープ按钮
        executor.click_element('input[alt="ボイスワープ"]')

        # 点击サービス開始/停止按钮
        executor.click_element('input[alt="サービス開始/停止"]')

        # 点击开始单选按钮 设定时间
        if self.__start_or_stop:
            executor.click_element('input[id="r2"]')
            executor.input_text('input[id="call_sec2"]', '5')
        else:
            executor.click_element('input[id="stop"]')
        # 点击设定按钮
        executor.click_element('input[alt="設定"]')

        # 登出
        executor.click_element('input[title="ログアウト"]')

        # 发送邮件
        mail_provider = MailProvider(
            self.__mail_account, self.__mail_password, self.__mail_subject, self.__mail_text)
        mail_provider.send_mail(self.__mail_list)