Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grossopa/hamster-selenium

On top of Selenium (web browser automation tool) for providing component-based abstraction of Html DOM with interaction APIs for automating the web pages built by modern front-end frameworks such as Material UI.
https://github.com/grossopa/hamster-selenium

java material-ui material-ui-components material-ui-react selenium selenium-java test-automation webtesting

Last synced: 1 day ago
JSON representation

On top of Selenium (web browser automation tool) for providing component-based abstraction of Html DOM with interaction APIs for automating the web pages built by modern front-end frameworks such as Material UI.

Awesome Lists containing this project

README

        

# Hamster Selenium

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=grossopa_hamster-selenium&metric=alert_status)](https://sonarcloud.io/dashboard?id=grossopa_hamster-selenium)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=grossopa_hamster-selenium&metric=coverage)](https://sonarcloud.io/dashboard?id=grossopa_hamster-selenium)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=grossopa_hamster-selenium&metric=code_smells)](https://sonarcloud.io/dashboard?id=grossopa_hamster-selenium)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=grossopa_hamster-selenium&metric=ncloc)](https://sonarcloud.io/dashboard?id=grossopa_hamster-selenium)

On top of Selenium (web browser automation tool) for providing component-based abstraction of Html DOM with interaction
APIs for automating the web pages built by modern front-end frameworks such as Material UI.

It depends on selenium-java 4.6.0 and JDK 11. please visit https://github.com/SeleniumHQ/selenium to understand how
to use Selenium.

## Material UI (React)

Most of the commonly used components have been implemented in hamster-selenium-component-materialui module.

All the supported MUI components could be found in `MuiComponents` class. They have been tested against the examples in
the Material UI official page:

Version 4: https://v4.mui.com

Version 5: https://mui.com

Check hamster-selenium-examples module for the sample code and
https://github.com/grossopa/hamster-selenium/wiki/Supported-Material-UI-Components for supported Material UI
components.

## Material UI (Angular)

The framework also supports the Angular version of Material UI.

## How to Use

Plain HTML:


com.github.grossopa
hamster-selenium-component-html
1.11.0

Material UI (React):


com.github.grossopa
hamster-selenium-component-materialui
1.11.0

Material UI (Angular):


com.github.grossopa
hamster-selenium-component-mats
1.11.0

Create a ComponentWebDriver from existing WebDriver:

`ComponentWebDriver driver = new DefaultComponentWebDriver(webDriver);`

Locate the element root by class name (e.g. class="MuiSelect-root") or other indicators and convert them by using
as(mui()) and toSelect or other methods.

WebComponent component = driver.findComponent(By.className("MuiSelect-root"));
MuiSelect select = component.as(MuiComponents.mui()).toSelect(By.className("MuiMenuItem-root"));`

# License

https://mit-license.org/