ShaftHQ / SHAFT_ENGINE

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:

Home Page:https://shafthq.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ceasefire now

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

GitHub Workflow Status (with branch) GitHub Workflow Status (with branch)

Codacy grade Codecov

SHAFT: Unified Test Automation Engine

SHAFT_ENGINE

πŸ†“ 100% Free | 🟒 Proud member of the Selenium Ecosystem | πŸ† Winner of the 2023 Google Open Source Award

πŸƒ Quick Start Guide

Option 1: Template Project

Option 2: New Project

Step 1: Initial Setup

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

Step 2: Creating Tests

  • Create a new Package TestPackage under src/test/java and create a new Java Class TestClass under that package.
  • Copy the below imports into your newly created java class.
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;
  • Copy the below code snippet into your newly created java class.
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();
    }

Step 3: Managing Test Data

  • Create the following file src/test/resources/testDataFiles/simpleJSON.json.
  • Copy the below code snippet into your newly created json file.
{
  "searchQuery": "SHAFT_Engine"
}

Step 4: Running Tests

  • Run your TestClass.java as a TestNG Test Class.
  • The execution report will open automatically in your default web browser after the test run is completed.
  • Join our GitHub Repo stars to get notified by email when a new release is pushed out.
  • After upgrading your Engine to a new major release it is sometimes recommended to delete the properties folder src\main\resources\properties and allow SHAFT to regenerate the defaults by running any test method.

πŸ‘¨β€πŸ’» Tech Stack

Java Maven       IntelliJ IDEA

🦸 Powered by

Selenium WebDriver       Appium       REST Assured       TestNG       Allure Reports       Cucumber.io       OpenCV       Selenium Grid       GitHub Actions       Dependabot       CodeQL       Codacy       JaCoCo       CodeCov       sonatype

πŸ™ Big thanks for the open source licenses and support

BrowserStack       Applitools       LambdaTest

🀝 Support & Contributions

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

🌍 Who else is using SHAFT? 2

_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      Paymob Solutions

Stop Reinventing the wheel! Start using SHAFT!

Footnotes

  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:
    - Open 'Edit Run/Debug Configurations' dialog > Edit Configurations... > Edit configuration templates...
    - Select Cucumber Java > Program Arguments > and add this argument:
    --plugin com.shaft.listeners.CucumberFeatureListener
    - After saving the changes, remember to delete any old runs you may have triggered by mistake before adding the needed config. ↩

  2. Company names are collected via anonymous surveys and provided freely by engineers who claimed to be using SHAFT_Engine within these companies. ↩

About

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:

https://shafthq.github.io/

License:MIT License


Languages

Language:Java 98.5%Language:Gherkin 0.6%Language:HTML 0.5%Language:Shell 0.3%