Skip to content
/ Testy Public

Automated Acceptance Testing: Selenium and Selenium WebDriver test framework for web applications (best suited for ExtJS and complex UI)

License

Notifications You must be signed in to change notification settings

RWS/Testy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testy

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:

Java Usage Example

    <button>Save</button>
    <button>Cancel</button>
    
    <div class="close" title="Close">x</div>
    <span class="minimize" title="Minimize">_</span>
    
    
    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");
    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("me@testy.com");
        }
    }

Table and rows examples

    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("me@testy.com");
            //... assert
        }
    }

Prerequisites

  • Java
  • Maven

Getting the maven plugin

<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

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

driver = new FirefoxDriver();
WebDriverConfig.init(driver);
// then just use WebLocator or any other classes from Testy

OR Create your driver using Testy much simpler

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.:
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

Example project

Here is a sample project with cucumber and Testy on Chrome browser:

Full example

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

Getting SNAPSHOT versions of the plugin

    <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>

Demo application links

Setting up Testy project

Setting UP

License

Testy is MIT licensed.

About

Automated Acceptance Testing: Selenium and Selenium WebDriver test framework for web applications (best suited for ExtJS and complex UI)

Resources

License

Stars

Watchers

Forks

Packages

No packages published