Automated Acceptance Testing.
Selenium WebDriver test framework for web applications.
You don't have to worry anymore about complex XPATH or CSS selector 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:
- Dynamic html & Complex UI
Sencha ExtJSBootstrap- Simple web applications/sites
<button>Save</button><button>Cancel</button><divclass="close" title="Close">x</div><spanclass="minimize" title="Minimize">_</span>ButtonsaveButton = newButton().setText("Save");
ButtoncancelButton = newButton().setText("Cancel");
// more properties for selecting/testing specific element with wanted attributesWebLocatorcloseIcon = newWebLocator().setClasses("close").setTitle("Close");
WebLocatorminimIcon = newWebLocator().setClasses("minimize").setTitle("Minimize");publicclassSubscribePage {
privateWebLocatorheader = newWebLocator().setClasses("header");
privateTextFieldemailField = newTextField().setLabel("Email");
privateWebLinksubscribeLink = newWebLink(header, "Subscribe now");
publicvoidsubscribe(Stringemail) {
emailField.setValue(email);
subscribeLink.click();
}
}
publicclassSubscribeTestextendsTestBase {
SubscribePagesubscribePage = newSubscribePage();
@TestpublicvoidsubscribeTest() {
subscribePage.subscribe("me@testy.com");
}
}publicclassSubscribersPage {
privateTabletable = newTable();
publicbooleanunsubscribe(Stringemail) {
// find row that contains specified email in second columnRowrow = table.getRow(newCell(2, email));
// find remove button inside specified rowButtonremoveButton = newButton(row, "Remove");
returnremoveButton.click();
}
}
publicclassRemoveSubscriberTestextendsTestBase {
SubscribersPagesubscribersPage = newSubscribersPage();
@TestpublicvoidunsubscribeTest() {
booleanremoved = subscribersPage.unsubscribe("me@testy.com");
//... assert
}
}- Java
- Maven
For full setup and run instructions, see setup.md.
For Button examples and API notes, see button.md.
<dependency>
<groupId>com.sdl.lt</groupId>
<artifactId>Testy</artifactId>
<version>2.13.1</version>
</dependency>Here is how these lines appear in a project pom.xml
After you create your driver, pass the reference to Testy, then just it use as you want
driver = newFirefoxDriver();
WebDriverConfig.init(driver);
// then just use WebLocator or any other classes from TestypublicstaticWebDriverdriver;
static {
startSuite();
}
privatestaticvoidstartSuite() {
try {
driver = WebDriverConfig.getWebDriver(Browser.FIREFOX);
} catch (Exceptione) {
LOGGER.error("Exception when start suite", e);
}
}- Set this system property: remoteDriver=true
- Pass the remote hub url as a parameter when initializing the WebDriver. e.g.:
WebDriverdriver = WebDriverConfig.getWebDriver(EnvConfig.getBrowserConfigPath(), newURL("http://localhost:4444/wd/hub"));
orWebDriverdriver = WebDriverConfig.getWebDriver(URLremoteUrl, DesiredCapabilitiescapabilities);Here is how these lines appear in a project
Here is a sample project with cucumber and Testy on Chrome browser:
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
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>sonatype-nexus-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependency>
<groupId>com.sdl.lt</groupId>
<artifactId>Testy</artifactId>
<version>2.14.0-SNAPSHOT</version>
</dependency>Testy is MIT licensed.