SHAFT_ENGINE icon indicating copy to clipboard operation
SHAFT_ENGINE copied to clipboard

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

SHAFT_ENGINE

Contributors) License JFrog release (latest by date including pre-releases)

Codacy grade GitHub Workflow Status GitHub Workflow Status

SHAFT: Unified Test Automation Engine

Quick Start Guide 🏃

  • Create a new Java/Maven project using Eclipse, IntelliJ or your favourite IDE.
  • Copy the highlighted contents of this pom.xml file into yours inside the <project> tag.
  • Follow the steps in this footnote in case you are using IntelliJ[^1].
  • Create the following file src/test/resources/testDataFiles/simpleJSON.json.
  • Copy the below code snippet into your newly created json file.
{
  "searchQuery": "SHAFT_Engine"
}
  • Create a new Package under src/test/java and create a new Java Class under that package.
  • Copy the below code snippet into your newly created java class.
public class Test_Wizard_GUI {
    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
    public void afterClass() {
        driver.quit();
    }
}
  • Run it as a TestNG Test Class.
  • The execution report will open automatically in your default web browser after the test run is completed.
  • You can change the target browser, operating system, timeouts, and other configurations using the ⚙️ Configuration Manager.
  • Click Here for more GUI, API, DB, and CLI sample test classes.
  • And you can learn more from the 📚 Javadocs and 👤 User Guide [^2].
  • Here is also a complete tutorial showing everything from creating the project to running remote, unattended, parallelized, cross-platform tests ▶️ Youtube: Test Automation Hero++ [^3].
  • Lastly, feel free to Join us via Slack & Facebook for support and contributions. [^1]: Due to a known issue with IntelliJ you need to edit your run configuration templates before running your tests by following these steps:
    - Open 'Edit Run/Debug Configurations' dialog > Edit Configurations... > Edit configuration templates...
    - Select TestNG > Listeners > and add these listeners one by one:
    com.shaft.tools.listeners.AlterSuiteListener, com.shaft.tools.listeners.SuiteListener, com.shaft.tools.listeners.InvokedMethodListener
    - Select Cucumber Java > Program Arguments > and add this argument:
    --plugin com.shaft.tools.listeners.CucumberFeatureListener
    - After saving the changes, remember to delete any old test runs you may have triggered by mistake before adding the needed config. [^2]: The User Guide is still a work in progress. You can find a guide to contribute to it here SHAFT_Engine_Docusaurus, and feel free to Join us via Slack & Facebook for support and contributions. [^3]: The Test Automation Hero++ Playlist is in Arabic. The working code itself is in English, and it's hosted here using_SHAFT_Engine_2. Feel free to Join us via Slack & Facebook for support and contributions.

What? Why? When? How? and Who? 🤔

What is SHAFT?

  • A Unified Test Automation Engine.
    Generic Test Automation Architecture
  • A source controlled Java Maven project that is easily extended and regularly enhanced with new features.
  • Provides an easily understandable and user-friendly syntax for writing simple, robust, reliable, maintainable, and scalable tests.
  • Provides a ton of built-in features in the Test Execution and Test Adaptation layers of the Generic Test Automation Architecture, and allows you to focus on the Test Generation and Test Definition Layers.
    SHAFT_ENGINE MindMap

Why should I use SHAFT?

  • MIT Licensed Open-Source project that's free to use and easy to customize.
  • Frequent updates full of new features and bug fixes.
  • Helps you focus on writing simple tests without wasting time on any of the underlying boilerplate code and error handling.
  • Maximize your Return On Investment by eliminating framework creation time, tool selection and training costs, and minimizing ramp up time.
    Return On Investment Analysis
  • Start being productive immediately!

When should I use SHAFT?

  • If you're getting started with a new test automation project that focuses on any of the supported platforms.
  • If you already have an existing test automation project that uses Selenium/Appium/RestAssured/TestNG/Java then using SHAFT will be a direct upgrade with ZERO refactoring required.

How can I use SHAFT?

Who is using SHAFT? [^4]

_VOIS (Vodafone Intelligent Solution)      GET Group Holdings      MOMRA (Saudi Arabia's Ministry of Municipal and Rural Affairs)      Vodafone (Egypt)      Solutions by STC      GIZA Systems      Euronet      Terkwaz Business Solutions      Incorta      BayanTech      Adam.ai      ACT Global Soft      elmenus      IDEMIA      iHorizons      Robusta

[^4]: Company names are collected via anonymous surveys and provided freely by engineers who claimed to be using SHAFT_Engine within these companies.

For Support & Contributions 👥

  • Join us via Slack & Facebook
    automatest-workspace Automatest
  • And feel free to create PRs directly. This lovely tutorial will help.

Stop Reinventing the wheel! Start using SHAFT!