The Qytera Test Automation Framework (QTAF) is a Java test framework developed by Qytera GmbH based on TestNG and offers easy setup of new Selenium test projects, HTML reporting, Cucumber support, connection to Jira Xray and fast extensibility.
Blog
·
Report bug
·
Request feature
In order to use QTAF, you will need:
- Maven 3.8.6 or better
- Java 17 or better
The easiest way to start using QTAF is by including it in a Maven project's dependencies.
To include QTAF as a testing dependency, add the following lines to your project's pom.xml
:
<dependency>
<groupId>de.qytera</groupId>
<artifactId>qtaf-core</artifactId>
<version>0.2.0</version>
<scope>test</scope>
</dependency>
Afterwards, simply run mvn install
to automatically download and make available QTAF and its dependencies from Maven's Central Repository.
Having QTAF installed, using it is very straightforward. A very basic, page-object-based example for testing https://duckduckgo.com could look like this:
- open https://duckduckgo.com
- enter
test automation
into the search area - click on the search button
- assert that the result page's title contains the search term
test automation
The test can be realized with two classes: one for the page object and one for the test cases. The complete project can be found here.
Click to view project structure
src
├───main
│ └───java
└───test
└───java
└───de
└───qtaf
├───pages
│ DuckDuckGoPage.java
│
└───tests
DuckDuckGoPageTest.java
package de.qtaf.pages;
import de.qytera.qtaf.core.guice.annotations.Step;
import de.qytera.qtaf.testng.context.QtafTestNGContext;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import static com.codeborne.selenide.Selenide.$
public class DuckDuckGoPage extends QtafTestNGContext {
By searchInputSelector = By.id("search_form_input_homepage");
By searchButtonSelector = By.id("search_button_homepage")
@Step(
name = "open test page",
description = "opens a browser window and navigates to the test page"
)
public void openTestPage() {
driver.get("https://duckduckgo.com");
driver.manage().window().maximize();
}
@Step(
name = "enter search term",
description = "enters the given search term into the search field"
)
public void enterSearchTerm(String term) {
$(searchInputSelector).sendKeys(term);
}
@Step(
name = "click search button",
description = "clicks on the search button next to the search field"
)
public void clickSearchButton() {
$(searchButtonSelector).click();
}
}
package de.qtaf.tests;
import de.qtaf.pages.DuckDuckGoPage;
import de.qytera.qtaf.core.config.annotations.TestFeature;
import de.qytera.qtaf.testng.context.QtafTestNGContext;
import org.testng.annotations.Test;
@TestFeature(
name = "duckduckgo search",
description = "tests the search feature from https://duckduckgo.com"
)
public class DuckDuckGoPageTest extends QtafTestNGContext {
@Test(
testName = "QTAF-001",
description = "test a simple search"
)
public void testSearch() {
DuckDuckGoPage page = load(DuckDuckGoPage.class)
page.openTestPage();
page.enterSearchTerm("test automation");
page.clickSearchButton();
assertTrue(driver.getTitle().contains("test automation"));
}
}
You will find an extensive documentation on our GitHub page qytera-gmbh.github.io.
Feel free to join our discussion in the issues. If you want to contribute directly, you may do so any time by opening an informal pull request.