File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import aquality .selenium .browser .AqualityServices ;
4
4
import aquality .selenium .core .utilities .IActionRetrier ;
5
+ import aquality .selenium .elements .interfaces .IButton ;
5
6
import aquality .selenium .elements .interfaces .ILabel ;
6
7
import aquality .selenium .forms .Form ;
7
8
import org .openqa .selenium .By ;
12
13
public abstract class ManyToolsForm <T extends ManyToolsForm <T >> extends Form {
13
14
private static final String BASE_URL = "https://manytools.org/" ;
14
15
private final ILabel lblValue = getFormLabel ().findChildElement (By .xpath (".//code" ), getName (), ILabel .class );
16
+ private final IButton btnAgree = getElementFactory ().getButton (By .xpath ("//button[@mode='primary']" ), "Agree" );
15
17
16
18
protected ManyToolsForm (String name ) {
17
19
super (By .id ("maincontent" ), name );
@@ -24,6 +26,11 @@ public T open() {
24
26
AqualityServices .get (IActionRetrier .class ).doWithRetry (() -> {
25
27
AqualityServices .getBrowser ().goTo (BASE_URL + getUrlPart ());
26
28
AqualityServices .getBrowser ().waitForPageToLoad ();
29
+ if (btnAgree .state ().isDisplayed ())
30
+ {
31
+ btnAgree .click ();
32
+ btnAgree .state ().waitForNotDisplayed ();
33
+ }
27
34
}, Collections .singletonList (TimeoutException .class ));
28
35
return (T ) this ;
29
36
}
You can’t perform that action at this time.
0 commit comments