Skip to content

Commit 614c1e1

Browse files
committed
Created a method for AngularJS requests in BasePage due to needing to set a time out.
Bumped to version 1.1.2
1 parent ee33b3c commit 614c1e1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>com.frameworkium</groupId>
55
<artifactId>Frameworkium-core</artifactId>
6-
<version>1.1.1</version>
6+
<version>1.1.2</version>
77

88
<name>Frameworkium-core</name>
99
<description>Frameworkium core code. Referenced by the com.frameworkium project, with example tests.</description>

src/main/java/com/frameworkium/pages/internal/BasePage.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.List;
66
import java.util.concurrent.TimeUnit;
77

8+
import com.paulhammant.ngwebdriver.WaitForAngularRequestsToFinish;
89
import org.apache.commons.lang.StringUtils;
910
import org.apache.logging.log4j.LogManager;
1011
import org.apache.logging.log4j.Logger;
@@ -25,8 +26,6 @@
2526
import com.frameworkium.tests.internal.BaseTest;
2627
import com.google.inject.Inject;
2728

28-
import static com.paulhammant.ngwebdriver.WaitForAngularRequestsToFinish.waitForAngularRequestsToFinish;
29-
3029
public abstract class BasePage<T extends BasePage<T>> {
3130

3231
@Inject
@@ -59,7 +58,7 @@ public T get() {
5958
HtmlElementLoader.populatePageObject(this, driver);
6059
try {
6160
if(isPageAngularJS()) {
62-
waitForAngularRequestsToFinish((JavascriptExecutor) driver);
61+
waitForAngularRequestsToFinish();
6362
}
6463
waitForExpectedVisibleElements(this);
6564
try {
@@ -204,6 +203,15 @@ public Object executeJS(String javascript) {
204203
return returnObj;
205204
}
206205

206+
/**
207+
* Method to wait for AngularJS requests to finish on the page
208+
*/
209+
public void waitForAngularRequestsToFinish() {
210+
driver.manage().timeouts().setScriptTimeout(10, TimeUnit.SECONDS);
211+
WaitForAngularRequestsToFinish
212+
.waitForAngularRequestsToFinish((JavascriptExecutor) driver);
213+
}
214+
207215
/**
208216
* Method which executes an async JS call
209217
*

0 commit comments

Comments
 (0)