Skip to content

A facade for any UI driver (currently supports only WebDriver) for highly reliable and resilient interaction with Views and Elements

License

Notifications You must be signed in to change notification settings

softwareonpurpose/uinavigator

Repository files navigation

uinavigator

UiNavigator provides individual facades to the WebDriver and WebElement functionality of WebDriver. Host is a singleton which can be initialized with a DriverInstantiation for any WebDriver -- browser or mobile. Use of Selenium 'By' locators is constrained to the most reliable and resilient (i.e. id, name, class, tag). Doing so encourages accessing UI elements in composite regions (encapsulated WebElements) resulting in further increased reliability and resilience. References to WebElements are instantiated just-in-time, only when needed, avoiding Stale Element issues common when references are instantiated on page load.

Browser Drivers - For each browser to be supported, add the appropriate executable (e.g. ChromeDriver.exe, GeckoDriver.exe) to java/main/resources. DefaultDriverInstantiations are provided for the most common.
NO EXECUTABLE BROWSER DRIVERS ARE INCLUDED WITH THIS PACKAGE.

UiHost - Facade for WebDriver (e.g. browser or device) related functionality (e.g. load(), waitUntilVisible()) provided by WebDriver and WebDriverWait. The WebDriver.findElement() method is referenced ONLY in this class, and utilized ONLY via the private Element.getElement() method.

UiElement - Facade for WebElement related functionality (e.g. getText(), click())

UiView - Implementation of the 'Page Object' model, providing direct navigation to a view, and user-defined confirmation of state.

  • Suggest implementing a View interface which includes ONLY "state" methods (e.g. getText(), isActive(), getItemCount(), etc.) and "region" methods (e.g. inHeader(), inContent(), inFooter(), etc.).
  • Suggest 'action' methods, which result in any change of state (e.g. linkClick(), login(String username), etc.) be implemented in concrete View classes, and always call the expect() method of the resulting concrete View.
  • Suggest 'in[Region]' methods for returning a region of a given page (e.g. inHeader(), inContet(), inItemList())

UiRegion - Encapsulates the model of a "region" of a web page in the same manner UiView models a web page. This improves the cohesion of the test code AND facilitates reuse for shared regions (e.g. header, footer, sidebar)

About

A facade for any UI driver (currently supports only WebDriver) for highly reliable and resilient interaction with Views and Elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages