Exemplo n.º 1
0
    def get_recovery_url(self, email_name, email_url):
        print(" + get_recovery_url \n".upper())
        print('In get_validation_code')
        driver_mail = get_driver(True)
        driver_mail.get("http://www." + email_url)

        wait = WebDriverWait(driver_mail, 30)
        submit_btn = wait.until(EC.element_to_be_clickable((By.ID, 'sm')))
        name_field = driver_mail.find_element_by_id("mailbox")
        name_field.clear()
        name_field.send_keys(email_name)
        submit_btn.click()

        wait = WebDriverWait(driver_mail, 30)
        wait.until(EC.url_to_be("http://mailnesia.com/mailbox/" + email_name))
        driver_mail.find_element_by_xpath("//tbody/tr[1]/td[2]").click()
        wait = WebDriverWait(driver_mail, 30)
        wait.until(
            EC.text_to_be_present_in_element((By.XPATH, '//pre/a[1]'), "http"))
        code = driver_mail.find_element_by_xpath("//pre/a[1]").text
        driver_mail.quit()
        close_firefox()
        return code
Exemplo n.º 2
0
 def tearDown(self) -> None:
     self.driver.quit()
     close_firefox()
Exemplo n.º 3
0
 def tearDown(self):
     # self.driver.service.process.send_signal(signal.SIGTERM)
     self.driver.quit()
     close_firefox()