https://github.com/RWS/Testy
Automated Acceptance Testing: Selenium and Selenium WebDriver test framework for web applications (best suited for ExtJS and complex UI)
https://github.com/RWS/Testy
Last synced: about 2 months ago
JSON representation
Automated Acceptance Testing: Selenium and Selenium WebDriver test framework for web applications (best suited for ExtJS and complex UI)
- Host: GitHub
- URL: https://github.com/RWS/Testy
- Owner: RWS
- License: mit
- Created: 2013-03-05T17:14:11.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T08:16:23.000Z (about 2 months ago)
- Last Synced: 2025-02-19T09:24:51.195Z (about 2 months ago)
- Language: Java
- Size: 208 MB
- Stars: 29
- Watchers: 18
- Forks: 30
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-java - Testy
README
# Testy
Automated Acceptance Testing.
[`Selenium WebDriver`](http://www.seleniumhq.org/projects/webdriver/) test framework for web applications.
You don't have to worry anymore about complex [`XPATH`](http://zvon.org/xxl/XPathTutorial/Output/example1.html) or [`CSS selector`](https://saucelabs.com/selenium/css-selectors) because we are taking care for you about that.
Simply set each property on the element and we will generate the necessary selector.
You can combine more properties/attributes on the same selector very easy.This project is optimized for:
- [x] Dynamic html & Complex UI
- [x] [`Sencha ExtJS`](https://www.sencha.com/products/extjs/#overview)
- [x] [`Bootstrap`](http://getbootstrap.com/javascript/)
- [x] Simple web applications/sites## Java Usage Example
```html
Save
Cancel
x
_
``````java
Button saveButton = new Button().setText("Save");
Button cancelButton = new Button().setText("Cancel");
// more properties for selecting/testing specific element with wanted attributes
WebLocator closeIcon = new WebLocator().setClasses("close").setTitle("Close");
WebLocator minimIcon = new WebLocator().setClasses("minimize").setTitle("Minimize");```
```java
public class SubscribePage {
private WebLocator header = new WebLocator().setClasses("header");
private TextField emailField = new TextField().setLabel("Email");
private WebLink subscribeLink = new WebLink(header, "Subscribe now");
public void subscribe(String email) {
emailField.setValue(email);
subscribeLink.click();
}
}
public class SubscribeTest extends TestBase {
SubscribePage subscribePage = new SubscribePage();
@Test
public void subscribeTest() {
subscribePage.subscribe("[email protected]");
}
}
```## Table and rows examples
```java
public class SubscribersPage {
private Table table = new Table();
public boolean unsubscribe(String email) {
// find row that contains specified email in second column
Row row = table.getRow(new Cell(2, email));
// find remove button inside specified row
Button removeButton = new Button(row, "Remove");
return removeButton.click();
}
}
public class RemoveSubscriberTest extends TestBase {
SubscribersPage subscribersPage = new SubscribersPage();
@Test
public void unsubscribeTest() {
boolean removed = subscribersPage.unsubscribe("[email protected]");
//... assert
}
}
```## Prerequisites
- Java
- Maven## Getting the maven plugin
```xml
com.sdl.lt
Testy
2.13.1```
[Here is how these lines appear in a project pom.xml](https://github.com/nmatei/cucumber-testy-tutorial/blob/master/pom.xml)
## Initialize Testy
### Simple way to migrate or use Testy
After you create your driver, pass the reference to Testy, then just it use as you want```java
driver = new FirefoxDriver();
WebDriverConfig.init(driver);
// then just use WebLocator or any other classes from Testy
```### OR Create your driver using Testy much simpler
```java
public static WebDriver driver;
static {
startSuite();
}
private static void startSuite() {
try {
driver = WebDriverConfig.getWebDriver(Browser.FIREFOX);
} catch (Exception e) {
LOGGER.error("Exception when start suite", e);
}
}
```### To use Selenium Grid you need the following:
1. Set this system property: remoteDriver=true
2. Pass the remote hub url as a parameter when initializing the WebDriver.
e.g.:
```java
WebDriver driver = WebDriverConfig.getWebDriver(EnvConfig.getBrowserConfigPath(), new URL("http://localhost:4444/wd/hub"));
or
WebDriver driver = WebDriverConfig.getWebDriver(URL remoteUrl, DesiredCapabilities capabilities);
```[Here is how these lines appear in a project](https://github.com/nmatei/cucumber-testy-tutorial/blob/master/src/test/java/org/fasttrackit/util/TestBase.java)
## Example project
Here is a sample project with cucumber and Testy on Chrome browser:
[Full example](https://github.com/nmatei/cucumber-testy-tutorial)
## Release Notes
**Release Notes for Testy 2.13.1**
- added setChildNodes(SearchType searchType, final WebLocator... childNodes) method
- improvement select(boolean doScroll, String... nodes) method in Tree
- update webdriver version 3.141.59
- TODO[Detailed Release Notes](./release-notes.md)
### Getting SNAPSHOT versions of the plugin
```xml
sonatype-nexus-snapshots
sonatype-nexus-snapshots
https://oss.sonatype.org/content/repositories/snapshots/
com.sdl.lt
Testy
2.14.0-SNAPSHOT
```## Demo application links
- [Login](https://rawgit.com/sdl/Testy/master/src/test/functional/app-demo/login.html)
- [Bootstrap](https://rawgit.com/sdl/Testy/master/src/test/functional/app-demo/bootstrap/index.html)
- [Sencha ExtJs](https://rawgit.com/sdl/Testy/master/src/test/functional/app-demo/extjs/index.html)## Setting up Testy project
[Setting UP](./setup.md)
## License
Testy is [MIT licensed](./LICENSE.md).