-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathCalculatorPage.java
More file actions
35 lines (27 loc) · 949 Bytes
/
CalculatorPage.java
File metadata and controls
35 lines (27 loc) · 949 Bytes
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
27
28
29
30
31
32
33
34
35
package calcapp.pages.app;
import com.frameworkium.core.htmlelements.element.*;
import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.BasePage;
import io.qameta.allure.Step;
import org.openqa.selenium.support.FindBy;
import java.util.List;
public class CalculatorPage extends BasePage<CalculatorPage> {
@FindBy(className = "UIATextField")
private List<TextInput> fields;
@Visible
@FindBy(className = "UIAButton")
private Button computeSumButton;
@FindBy(className = "UIAStaticText")
private TextBlock resultLabel;
@Step("Compute sum of {0} and {1}.")
public CalculatorPage computeSum(Integer a, Integer b) {
fields.get(0).sendKeys(a.toString());
fields.get(1).sendKeys(b.toString());
computeSumButton.click();
return this;
}
@Step("Get the result.")
public String getResult() {
return resultLabel.getText();
}
}