File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
src/main/java/com/frameworkium/pages/internal Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 55import java .util .List ;
66import java .util .concurrent .TimeUnit ;
77
8+ import com .paulhammant .ngwebdriver .WaitForAngularRequestsToFinish ;
89import org .apache .commons .lang .StringUtils ;
910import org .apache .logging .log4j .LogManager ;
1011import org .apache .logging .log4j .Logger ;
2526import com .frameworkium .tests .internal .BaseTest ;
2627import com .google .inject .Inject ;
2728
28- import static com .paulhammant .ngwebdriver .WaitForAngularRequestsToFinish .waitForAngularRequestsToFinish ;
29-
3029public 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 *
You can’t perform that action at this time.
0 commit comments