All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nordstrom.automation.selenium.interfaces.DetectsLoadCompletion Maven / Gradle / Ivy

Go to download

Selenium3 Foundation is an automation framework designed to extend and enhance the capabilities provided by Selenium 3.0 (WebDriver).

There is a newer version: 1.0.4
Show newest version
package com.nordstrom.automation.selenium.interfaces;

import org.openqa.selenium.SearchContext;

import com.nordstrom.automation.selenium.support.Coordinator;

/**
 * Page classes that model pages with complex loading behavior implement this interface to provide scenario-specific
 * detection of page load completion. This is typically required for single-page applications or more conventional
 * multi-page applications that use dynamic load techniques (e.g. - AJAX).
 */
public interface DetectsLoadCompletion {
    
    /**
     * Determine if the page has finished loading.
     * 
     * @return 'true' if the page has finished loading; otherwise 'false'
     */
    boolean isLoadComplete();
    
    /**
     * Returns a 'wait' proxy that determines if the page has finished loading.
     * 
     * @return 'true' if the page has finished loading; otherwise 'false'
     */
    static Coordinator pageLoadIsComplete() {
        return new Coordinator() {

            @Override
            public Boolean apply(SearchContext context) {
                return Boolean.valueOf(((DetectsLoadCompletion) context).isLoadComplete());
            }
            
            @Override
            public String toString() {
                return "page to finish loading";
            }
        };
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy