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

io.github.kgress.scaffold.WebDriverNavigation Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package io.github.kgress.scaffold;

/**
 * This class is for handling threading during navigation for an implementing project.
 *
 * Implementing projects should include an "AutomationNavigation" file that extends off of this. Doing so will allow
 * you to encapsulate navigation actions outside of Page Objects and test files.
 *
 * // TODO We should move the {@link WebDriverWrapper}'s navigate method to here in the future for further encapsulation.
 */
public abstract class WebDriverNavigation {

    /**
     * Gets the {@link WebDriverWrapper} from the current thread.
     *
     * @return the {@link WebDriverWrapper} from the current thread
     */
    protected WebDriverWrapper getWebDriverWrapper() {
        return getContext().getWebDriverManager().getWebDriverWrapper();
    }

    /**
     * Grabs the {@link WebDriverContext} for the current thread. This allows us to get the {@link WebDriverWrapper} for that specific thread.
     *
     * @return the {@link TestContext}
     */
    private WebDriverContext getContext() {
        return TestContext.baseContext().getWebDriverContext();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy