Exemplo n.º 1
0
class LoginPage(Page):
    def __init__(self, browser: Remote) -> None:
        self._browser = browser
        self._email = PersonalDetails(browser)
        self._password = Password(browser)

    def load(self, device: Device) -> None:
        self._browser.get(
            f"https://{device.connections.main.ip}/index.php?route=account/login"
        )

    def available(self) -> bool:
        return "Account Login" in self._browser.title

    def fill_credentials(self, email_address: str, password: str) -> None:
        self._email.type_email(email_address)
        self._password.type_password(password)

    def press_login_button(self) -> None:
        self._browser.find_element_by_xpath('//input[@value="Login"]').click()
Exemplo n.º 2
0
class RegisterAffiliatePage(Page):
    def __init__(self, browser: Remote) -> None:
        self._browser = browser
        self._personal_details = PersonalDetails(browser)
        self._information = AffiliateInformation(browser)
        self._password = Password(browser)
        self._press_continue = RegisterAccountPage(browser)

    def open(self, device: Device) -> None:
        self._browser.get(
            f"https://{device.connections.main.ip}/index.php?route=affiliate/register"
        )

    def loaded(self) -> bool:
        return "Affiliate Program" in self._browser.title

    def fill_personal_details(self, first_name: str, last_name: str,
                              email: str, telephone: str) -> None:
        self._personal_details.type_first_name(first_name)
        self._personal_details.type_last_name(last_name)
        self._personal_details.type_email(email)
        self._personal_details.type_telephone(telephone)

    def press_pay_method(self) -> None:
        self._browser.find_element_by_xpath(
            "/html/body/div[2]/div/div/form/fieldset[2]/div[4]/div/div[2]/label/input"
        ).click()

    def fill_information(self, company: str, website: str, tax: str,
                         paypal: str) -> None:
        self._information.type_company(company)
        self._information.type_website(website)
        self._information.type_tax(tax)
        self._information.type_paypal(paypal)

    def fill_password(self, passwords: str) -> None:
        self._password.type_password(passwords)
        self._password.confirm_password(passwords)

    def press_continue(self) -> None:
        self._press_continue.press_continue()
Exemplo n.º 3
0
 def __init__(self, browser: Remote) -> None:
     self._browser = browser
     self._email = PersonalDetails(browser)
     self._password = Password(browser)
Exemplo n.º 4
0
 def __init__(self, browser: Remote) -> None:
     self._browser = browser
     self._personal_details = PersonalDetails(browser)
     self._information = AffiliateInformation(browser)
     self._password = Password(browser)
     self._press_continue = RegisterAccountPage(browser)