SHAFT is a unified test automation engine. Powered by best-in-class frameworks, SHAFT provides a wizard-like syntax to drive your automation efficiently, maximize your ROI, and minimize your learning curve. Stop reinventing the wheel. Upgrade now:
Fully documented
|
Award Winning
|
Selenium Ecosystem
|
|
(Recommended for new local sandbox projects)
(Recommended for new source controlled projects)
(Recommended if you're upgrading an existing project from Native Selenium WebDriver to SHAFT)
<project>
tag.TestPackage
under src/test/java
and create a new Java Class TestClass
under that package.import com.shaft.driver.SHAFT;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
SHAFT.GUI.WebDriver driver;
SHAFT.TestData.JSON testData;
By searchBox = By.name("q");
By resultStats = By.id("result-stats");
@Test
public void test() {
driver.browser().navigateToURL("https://www.google.com/");
driver.verifyThat().browser().title().isEqualTo("Google").perform();
driver.element().type(searchBox, testData.getTestData("searchQuery"))
.keyPress(searchBox, Keys.ENTER);
driver.assertThat().element(resultStats).text().doesNotEqual("")
.withCustomReportMessage("Check that result stats is not empty").perform();
}
@BeforeClass
public void beforeClass() {
driver = new SHAFT.GUI.WebDriver();
testData = new SHAFT.TestData.JSON("simpleJSON.json");
}
@AfterClass(alwaysRun = true)
public void afterClass(){
driver.quit();
}
src/test/resources/testDataFiles/simpleJSON.json
.{
"searchQuery": "SHAFT_Engine"
}
TestClass.java
as a TestNG Test Class.src\main\resources\properties
and allow SHAFT to regenerate the defaults by running any test method.
[^1]: If you're using Cucumber due to a known issue with IntelliJ you need to edit your run configuration template before running your tests by following these steps:
--plugin com.shaft.listeners.CucumberFeatureListener
[^4]: Company names are collected via anonymous surveys and provided freely by engineers who claimed to be using SHAFT_Engine within these companies.