summaryrefslogtreecommitdiff
path: root/src/main/java/com/mavlushechka/a1qa/project/pages/HomePage.java
blob: a4ab95c95542916e0a6f7eb5ef83fc8974b8e867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.mavlushechka.a1qa.project.pages;

import aquality.selenium.browser.AqualityServices;
import aquality.selenium.elements.interfaces.IButton;
import aquality.selenium.elements.interfaces.ITextBox;
import com.mavlushechka.a1qa.framework.pages.BaseForm;
import org.openqa.selenium.By;

public class HomePage extends BaseForm {

    private final ITextBox phoneOrEmailTextBox = AqualityServices.getElementFactory().getTextBox(By.id("index_email"), "Phone or email");
    private final IButton signInButton = AqualityServices.getElementFactory().getButton(
            By.xpath("//button[contains(@class, 'VkIdForm__signInButton')]"),"Sign in"
    );


    public HomePage() {
        super(AqualityServices.getElementFactory().getLabel(By.xpath("//*[contains(@class, 'IndexPageContent')]"), "Index page content"), "Home");
    }

    public void performAuthorization(String phoneOrEmail) {
        phoneOrEmailTextBox.clearAndType(phoneOrEmail);
        signInButton.click();
    }

}