-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathDynamicLoadingExamplePage.java
More file actions
50 lines (41 loc) · 1.6 KB
/
DynamicLoadingExamplePage.java
File metadata and controls
50 lines (41 loc) · 1.6 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package theinternet.pages;
import com.frameworkium.core.htmlelements.annotations.Timeout;
import com.frameworkium.core.htmlelements.element.Button;
import com.frameworkium.core.htmlelements.element.TextBlock;
import com.frameworkium.core.ui.annotations.Invisible;
import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.BasePage;
import io.qameta.allure.Step;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.support.FindBy;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOf;
public class DynamicLoadingExamplePage extends BasePage<DynamicLoadingExamplePage> {
@Visible
@FindBy(css = "#start button")
private Button startButton;
@Invisible // make sure it's not there
@Timeout(0) // used to speed up the wait for Invisible TypifiedElements
@FindBy(id = "finish")
private TextBlock dynamicElement;
@Step("Click Start")
public DynamicLoadingExamplePage clickStart() {
startButton.click();
wait.until(visibilityOf(dynamicElement.getWrappedElement()));
return this;
}
@Step("Wait for the hidden element to be displayed")
public DynamicLoadingExamplePage waitForElementToBeDisplayed() {
wait.until(visibilityOf(dynamicElement.getWrappedElement()));
return this;
}
public boolean isElementDisplayed() {
return dynamicElement.isDisplayed();
}
public boolean isElementPresent() {
try {
return dynamicElement.isDisplayed();
} catch (NoSuchElementException e) {
return false;
}
}
}