Giter VIP home page Giter VIP logo

shafthq / shaft_engine Goto Github PK

View Code? Open in Web Editor NEW
316.0 41.0 121.0 386.62 MB

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/

License: MIT License

Java 98.53% Gherkin 0.63% HTML 0.55% Shell 0.29%
appium appium-framework appium-java automation-engine maven restassured restassured-framework selenium-java selenium-webdriver test-automation-framework

shaft_engine's Introduction

Ceasefire now

SHAFT: Unified Test Automation Engine

SHAFT_ENGINE
Fully documented

User Guide
Award Winning

Google Open Source
Selenium Ecosystem

Selenium Ecosystem

License Contributors Latest Release
E2E Tests Code QL
Codacy Codecov

🏃 Quick Start Guide

Option 1: Maven Archetype

(Recommended for new local sandbox projects)

  • The easiest and most straightforward way to create a new project that uses SHAFT.
  • Just follow the simple steps here to generate your new project with one command (all configurations included).

Option 2: Template Project

(Recommended for new source controlled projects)

  • Use our Template Project to create a new project with one click.
  • Follow the steps in the ReadMe to handle project configuration.

Option 3: Start from scratch

(Recommended if you're upgrading an existing project from Native Selenium WebDriver to SHAFT)

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.

📚 User Guide

👨‍💻 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       JetBrains

🤝 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      Jahez Group      Salt Bank

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.

shaft_engine's People

Contributors

amfarid avatar cleanthat[bot] avatar dependabot[bot] avatar georgii-musikhin avatar hammad101088 avatar iezaky avatar khaledskhamis avatar kinasr avatar kyrillosnageh avatar magdyheiba avatar mahmoudelsharkawy avatar mamdouhmansour avatar marwayoussef1 avatar mennamagedm avatar mhmdelgazzar avatar mohab-osama avatar mohabmohie avatar mohamedhazem95 avatar mustafaagamy avatar osamaayman1005 avatar rihammostafa avatar salma2018170 avatar samiir95 avatar sultanpaymob avatar sys123-data avatar tarekgaafar avatar themosaeed avatar waleedmohammed avatar wesamhamed avatar zanoon2020 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shaft_engine's Issues

record video inside browser (headless)/mobile/desktop

Is your feature request related to a problem? Please describe.
The current implementation for the video recording doesn't work on headless browsers as it records the desktop itself. And the animated GIF has a big negative impact on overall execution performance.

Describe the solution you'd like
It is recommended to have a more light-weight and flexible recording mechanism to replace the older one and the animated GIF.

Build Integration with Extent Reports framework to SHAFT_Engine

Is your feature request related to a problem? Please describe.
To support Extent Reports framework and to be able to have an html emailable report.

Describe the solution you'd like
Build Integration with Extent Reports framework to SHAFT_Engine and to be able to generate reports with it alongside Allure Report framework.

Describe alternatives you've considered
N/A

Radio buttons and drop down lists cause [checkForElementVisibility] failed error but other elements are fine (in a specific website)

Error: Element Action [checkForElementVisibility] failed. With the following test data [unique element matching this locator "By.id: days" is not visible.].

I'm not sure it's a bug or not
but in a specific website "http://automationpractice.com/" I get this error while locating radio button or dropdown list (despite of they are visible)
but text boxes or buttons are fine
I'm over 3 hours investigating and I couldn't figure out what's wrong

Allure Report
generatedReport_20200522-194656.zip

Sample TC
public class test {
public WebDriver driver;
Faker fakeData = new Faker();

private By mrTitle = By.id("id_gender1");
private By days= By.id("days");
private By createAccountBtn = By.id("SubmitCreate");
private By emailCreateField = By.id("email_create");
private By firstName= By.id("customer_firstname");


@Test
public void verify() {
enterEmailAndClickCreateAccountBtn( fakeData.internet().emailAddress());
ElementActions.click(driver, mrTitle);
ElementActions.type(driver, firstName, fakeData.name().firstName());
ElementActions.select(driver, days, "3");
}
public void enterEmailAndClickCreateAccountBtn(String email) {
ElementActions.type(driver, emailCreateField, email);
ElementActions.click(driver, createAccountBtn);
}



@BeforeClass
public void beforeClass() {
driver = BrowserFactory.getBrowser();
BrowserActions.navigateToURL(driver, "http://automationpractice.com/index.php?controller=authentication");
}

}

fullScreen BrowserAction sometimes fails causing BROWSER_SO timeout in case of headless execution over Chrome

Describe the bug
fullScreen BrowserAction sometimes fails causing BROWSER_SO timeout in case of headless execution over Chrome

To Reproduce
Steps to reproduce the behavior:

  1. Set execution mode to headless
  2. Set autoMaximizeBrowserWindow to true
  3. Attempt to perform fullScreen BrowserAction
  4. BROWSER_SO timeout happens and blocks all the following tests

Expected behavior
The test should pass and the action should be skipped since there isn't any fullScreen concept inside a headless gui-less execution, it's the same as maximize.

Logs without The ElementActions events

Describe the bug
A clear and concise description of what the bug is.
no logs created in the console once set enable to alwaysLogDiscreetly=true

To Reproduce
Steps to reproduce the behavior:
alwaysLogDiscreetly=true and run

Expected behavior
A clear and concise description of what you expected to happen.
logs created in the console contains the ReportManager.log() only without the ElementActions events

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser [chrome]
  • Version [[4.1.20200309]]

Additional context
Add any other context about the problem here.

checkForElementVisibility with upload file by the hidden element

Describe the bug
When try this code:
ElementActions.typeFileLocationForUpload(driver, bankTransfer_image, bankTransferData[7]);
I got this error:
Element Action [checkForElementVisibility] failed. With the following test data [unique element matching this locator "By.xpath: //input[@id='uploadImage']" is not visible.]

To Reproduce
Steps to reproduce the behavior:

  1. Use this function: typeFileLocationForUpload

Expected behavior
doesn`t check For Element Visibility with this function

Screenshots
Capture

Desktop (please complete the following information):

  • OS: Win10
  • Browser Chrome
  • Version 83

Enable the maximum performance mode but without the headless execution

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Enable the maximum performance mode but without the headless execution to fastly boost the execution time while opening the browser

Describe alternatives you've considered
Modify the properties flags to have the maximum performance I need

Additional context
N/A

ExtentReports - The @BeforeMethod annotation steps listed in the previous test logs info at the end

Describe the bug
In the ExtentReports emailable HTML report - The @BeforeMethod annotation steps are listed in the previous test logs info at the end

To Reproduce
Steps to reproduce the behavior:

  1. Execute a some test cases (more than 2) with @BeforeMethod annotations
  2. Check the Extent HTML emailable report cases info steps

Expected behavior
The steps of the @BeforeMethod should be inside of it's own test case info steps at first

Screenshots
Test Case No.1 (No @BeforeMethod steps)
image

Then after it (Test Case No.2)
image

Desktop:

  • OS: Windows

Additional context
N/A

closureActivities fails while attaching the Extent emailable report and the Allure report is not opened automatically in some cases

Describe the bug
closureActivities fails while attaching the Extent emailable report in some cases and the Allure report is not opened automatically.

To Reproduce
Steps to reproduce the behavior:
N/A

Expected behavior

  • closureActivities should al pass
  • Allure Report should open automatically
  • The Extent emailable report should be generated in all cases

Screenshots
image

Sample Exception

java.lang.AssertionError: File Action [readFromFile] failed.
	at org.testng.Assert.fail(Assert.java:87)
	at com.shaft.cli.FileActions.failAction(FileActions.java:583)
	at com.shaft.cli.FileActions.failAction(FileActions.java:577)
	at com.shaft.cli.FileActions.readFromFile(FileActions.java:307)
	at com.shaft.tools.io.LogsReporter.attachExtentReport(LogsReporter.java:47)
	at com.shaft.tools.io.LogsReporter.closureActivities(LogsReporter.java:18)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
	at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:61)
	at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:366)
	at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:320)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:351)
	at org.testng.SuiteRunner.run(SuiteRunner.java:286)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
	at org.testng.TestNG.runSuites(TestNG.java:1069)
	at org.testng.TestNG.run(TestNG.java:1037)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
	at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
	at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:352)
	at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
	at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181)
	at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392)
	at java.base/java.nio.file.Files.readAllLines(Files.java:3399)
	at java.base/java.nio.file.Files.readAllLines(Files.java:3436)
	at com.shaft.cli.FileActions.readFromFile(FileActions.java:303)
	... 21 more

Desktop (please complete the following information):

  • OS: Windows

Additional context
The the issues is random, and needs more investigation

Should be able to get selectedText from a dropdown list and assert on that attribute

Is your feature request related to a problem? Please describe.
I should be able to get the selectedText from simple dropdown menus like this:
https://mdn.mozillademos.org/en-US/docs/Web/HTML/Element/select$samples/Basic_select?revision=1612304

Or complex menus like this:
https://mdn.mozillademos.org/en-US/docs/Web/HTML/Element/select$samples/Advanced_select_with_multiple_features?revision=1612304

Describe the solution you'd like
I'd like to see a new ElementActions method that will getSelectedText, and I would like the existing validations for ElementAttribute to support asserting/verifying "selectedText" to make sure that they match the expected value

[Feature] checkpoints count and status attachment

Is your feature request related to a problem? Please describe.
There should be specific metrics regarding the exact number of checkpoints (assertions and validations) and how many of those have passed or failed, in addition to the standard metrics for the test cases.

Describe the solution you'd like
Having an attachment which details this information would be beneficial.

[JSONFileManager] the reader gets empty each time you use the method getTestData() and we need to initialize it each time we use methods in the class

Describe the bug
While using JSONFileManager the reader gets empty each time you use the method getTestData() and we need to initialize it each time we use methods in the class
To Reproduce
Steps to reproduce the behavior:

  1. initialize the class JSONFileManager JSONFileManager = new JSONFileManager(FilePath);
  2. JSONFileManager.getTestData("JSON path");
  3. another JSONFileManager.getTestData("JSON path");

Expected behavior

  • The First line returns the value of JSONPath
  • The second line returns null although the JSONPath is correct
    Screenshots
    If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [Windows10]
  • Browser [chrome]

19

18

Additional context
Add any other context about the problem here.

Support read-only integration with JIRA

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Support read-only integration with JIRA; To be added to the final report analysis phase and to get the current state of an issue and flag issues that have an outdated state and need to be maintained in the code.

Describe alternatives you've considered
N/A

Additional context
N/A

ElementActions-Is Element Clickable fails action and don't return false || pass the action while the element is not enabled .

Describe the bug
When using isElementClickable method of ElementAction class in case of element is not enabled or not clickable it fails action and does not return false value or pass the action while the element is not enabled so web driver waits to element to be clickable where it will not as it is disabled as per attached.

To Reproduce
Steps to reproduce the behavior:

  1. private WebDriver driver;

    private By firstName = By.id("firstname");
    private By lastName = By.id("lastname");
    private By emailAddress = By.id("email");
    private By password = By.id("password");
    private By registerButton = By.xpath("//button[contains(@Class, 'register')]");
    private By checkBox1 = By.xpath("//label[@for='checkbox1']");

    @test
    public void testIsButtonNotClickable() {
    driver = BrowserFactory.getBrowser();
    BrowserActions.navigateToURL(driver, "https://www.gocardi.com/register");
    ElementActions.type(driver, firstName, "nameOne");
    ElementActions.type(driver, lastName, "nameTwo");
    ElementActions.type(driver, emailAddress, "[email protected]");
    ElementActions.type(driver, password, "test123456");
    Assertions.assertTrue(ElementActions.isElementClickable(driver, registerButton), AssertionType.NEGATIVE);
    }

  2. See error

Expected behavior
isElementClickable returns false if element is disabled or not clicakble.

Screenshots
IsELementClickable_Bug

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Browser [chrome, firefox]
  • Version [83, 77]

class com.google.gson.JsonObject cannot be cast to class com.shaft.api.RestActions$ParametersType

Describe the bug
I get this error
class com.google.gson.JsonObject cannot be cast to class com.shaft.api.RestActions$ParametersType (com.google.gson.JsonObject and com.shaft.api.RestActions$ParametersType are in unnamed module of loader 'app')

also org.json.simple.JSONObject is not working

Sample TC
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.shaft.api.RestActions;

@test
public void verify(){
Response response = createUser(
FileActions.readFromFile(System.getProperty("jsonFolderPath") + "Users/", "createUser.json"));
}
private RestActions api;
api = new RestActions("https://reqres.in/");
public Response createUser(Object body) {
JsonObject jsonObject = new JsonObject();
JsonParser parser = new JsonParser();
JsonElement jsonElement = parser.parse(body.toString());
jsonObject = jsonElement.getAsJsonObject();
return restObject.performRequest(RestActions.RequestType.POST, 201, "api/users", jsonObject, ContentType.JSON);
}

jsonfile.zip

Allure Report
generatedReport_runWithorg.json.simple.JSONObject.zip
generatedReport_CastIssue.zip

Desktop (please complete the following information):

  • OS: windows
  • Browser [chrome]
  • Version [81.0.4044.138]

Provide the Capabilities set to the driver.

Is your feature request related to a problem? Please describe.
It is related to providing capabilities to the driver.

Describe the solution you'd like
As an example:
WebDriver browser;
browser = BrowserFactory.getBrowser(BrowserType.GOOGLE_CHROME);
BrowserFactoryOptions options = new BrowserFactoryOptions();
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability(ChromeOptions.CAPABILITY, options);
options.merge(cap);
browser = new BrowserFactory.getBrowser(BrowserType.GOOGLE_CHROME(options));

ElementActions.isElementDisplayed doesn't work in case the element is not displayed

Describe the bug
When I use isElementDisplayed to check if an element is displayed and it isn't, the test fails instead of returning false.

To Reproduce
Steps to reproduce the behavior:

  1. Use the method and pass the locator of an invisible element

Expected behavior
The method should return false

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Additional context
I suggest catching that exception and returning false

UnsupportedCommandException is thrown when using ElementActions.type in Appium project

Describe the bug
Exception org.openqa.selenium.UnsupportedCommandException is thrown when using ElementActions.type(driver, elementLocator, text); in Appium project

To Reproduce
Steps to reproduce the behavior:

  1. Start Appium server and activate a virtual android device
  2. Use ElementActions.type(driver, elementLocator, text);
  3. Run
  4. See error

Expected behavior
The method should send keys

** Virtual Smartphone**

  • OS: Android 9.0

Allue report

allure-results.zip

Count element command handle the exception while element not exist but error appeared in the log

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Run script with command " if(ElementActions.getElementsCount(driver, continueSaving_button) !=0){"
  2. If element not exist exception handled but appeared in the log

Expected behavior
Count element command handle the exception while element not exist.

Screenshots
eclipse-workspace - hemma-testing_src_test_resourc

allure-results 1.zip

Desktop (please complete the following information):

  • OS: Win 10
  • Browser Chrome
  • Version 83

[OpenCV Library] When user runs SHAFT_Engine latest version at Jenkins CI server error related to open CV library occurs

Describe the bug
When user runs SHAFT_Engine latest version at Jenkins error related to open CV library

To Reproduce
Steps to reproduce the behaviour:

  1. upgrade your project to the latest version 4.2.20200529
    2- push it to any Source Code Management like github ...etc
    3- pull from SCM and run the job
    4- check the result

Expected behavior
the job should be run and executed normally without problems

Desktop (please complete the following information):

  • OS: [Windows 10 ]
  • Browser [chrome]
  • SHAFT_Engine Version [4.2.20200529]
    153

154

generatedReport_20200609-133525.zip

Additional context

  1. is jenkins executing locally or via selenium grid?
    Locally on Linux server
  2. is this working for local execution or also not working?
    yes it is working fine and normally

Properties Configuration Wizard

Is your feature request related to a problem? Please describe.
Properties files contain a lot of settings and are difficult to configure.

Describe the solution you'd like
A lightweight UI would help to easily configure those files.

Describe alternatives you've considered
Splitting up the files will help, but a lightweight UI would be great!

Additional context
N/A

Fluent waits are not working when the property createAnimatedGif=false

Describe the bug
Fluent waits are not working when the property createAnimatedGif=false causing the test to fail unexpectedly.

To Reproduce
Steps to reproduce the behavior:

  1. From the VisualValidations.property file, createAnimatedGif=false
  2. Try to execute a scenario that require the fluent waits

Expected behavior
The fluent waits should be working normally when the property createAnimatedGif=false

Sample Exception

java.lang.AssertionError: Element Action [identifyUniqueElement] failed. With the following test data [zero elements found matching this locator "By.xpath: //div[@e2e-test='feedback-message']//h1".].
	at org.testng.Assert.fail(Assert.java:99)
	at com.shaft.gui.element.ElementActions.failAction(ElementActions.java:1525)
	at com.shaft.gui.element.ElementActions.failAction(ElementActions.java:1351)
	at com.shaft.gui.element.ElementActions.identifyUniqueElement(ElementActions.java:1586)
	at com.shaft.gui.element.ElementActions.identifyUniqueElement(ElementActions.java:1360)
	at com.shaft.gui.element.ElementActions.getText(ElementActions.java:673)

Desktop:

  • OS: Windows
  • Browser: Chrome
  • Version: Latest

Additional context
N/A

log4j:ERROR Could not read configuration file

Describe the bug
After update to the last version 4.2.20200528 the test execution done successfully but the following error has been appeared in log.

To Reproduce
Steps to reproduce the behavior:

  1. Update to version 4.2.20200528
  2. Run the test

Expected behavior
that error not appear.

Screenshots
https://eu-prod.asyncgw.teams.microsoft.com/v1/objects/0-weu-d6-927d5fcc0d0492a74d84e74c3653083e/views/imgo

Desktop (please complete the following information):

  • OS: Win10
  • Browser chrome
  • Version 83

[RemoteTestNG] detected TestNG version 7.0.0
log4j:ERROR Could not read configuration file [file:/C:/Users/ahmed/.m2/repository/io/github/mohabmohie/SHAFT_ENGINE/4.2.20200528/SHAFT_ENGINE-4.2.20200528.jar!/defaultProperties/\log4j.properties].
java.io.FileNotFoundException: file:\C:\Users\ahmed.m2\repository\io\github\mohabmohie\SHAFT_ENGINE\4.2.20200528\SHAFT_ENGINE-4.2.20200528.jar!\defaultProperties\log4j.properties (The filename, directory name, or volume label syntax is incorrect)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
at java.base/java.io.FileInputStream.(FileInputStream.java:154)
at java.base/java.io.FileInputStream.(FileInputStream.java:109)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:372)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:403)
at com.shaft.tools.listeners.AlterSuiteListener.alter(AlterSuiteListener.java:24)
at org.testng.TestNG.runSuiteAlterationListeners(TestNG.java:1037)
at org.testng.TestNG.run(TestNG.java:997)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
log4j:ERROR Ignoring configuration file [file:/C:/Users/ahmed/.m2/repository/io/github/mohabmohie/SHAFT_ENGINE/4.2.20200528/SHAFT_ENGINE-4.2.20200528.jar!/defaultProperties/\log4j.properties].

when the allure report is automatically generated, the test remains stuck in the IDE

Describe the bug
The batch file is executed in attached mode and hence the IDE remains stuck waiting for the hidden batch file to finish execution

To Reproduce
Steps to reproduce the behavior:

  1. Enable openAllureReportAfterExecution=true
  2. Run any test
  3. The report is generated and the test process is stuck in the IDE

Expected behavior
The IDE should finish

Screenshots
If applicable, add screenshots to help explain your problem.
image

visual validations issue when element is not found

Describe the bug
when a previously found element can no longer be found on the current page, the engine will automatically try to locate it using AI even if the self-healing feature was disabled.

Expected behavior
A failure should happen, mentioning that the element was not found and attaching a screenshot from both the reference image and the current page.

Conflict while setting up "appPackage,browserName" mobile.properties

Screenshot_20200928-150420_Messenger
Describe the bug
Conflict regarding "appPackage,browserName" it fails when defining the appPackage and comment browserName. The work around was to leave the browserName empty else error message comes ,appium fails to start and test fails.
Also if you forgot to add the packageName it will automatically run against mobile browser

To Reproduce
Steps to reproduce the behavior:

  1. Go to mobile.properties
  2. Set up capabilities for Android (platformName,version,deviceName,automationName,packageName,appPackage,appActivity)
  3. Try to run against Android device or emulator
  4. See error "Desired should not include both an appPackage,browserName"

Expected behavior
It should work if the browserName is empty and commented it shouldn't conflict with the packageName
So if the packageName is defined it should overwrite the browserName even if it has value.

Screenshot: Added

**Smartphone:

  • Device: [samsung S9]
  • OS: Android
  • Version: 8

Additional context
Add any other context about the problem here.

I request a feature to add capabilities instead of overriding shaft engine's

Is your feature request related to a problem? Please describe.
The problem is I want to add a capability that disables SSL Certificates without overriding the shaft engine's
in the future, I may want to add more capabilities

Describe the solution you'd like
A method I could use to add a capability without affecting shaft engine's

Describe alternatives you've considered
Covering all existing capabilities in Shaft properties files

A listener that skip the test cases that have issues attached to them

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
A listener that skip the test cases that have issues attached to them and to be configurable in the properties file so the report be clean.

Describe alternatives you've considered
N/A

Additional context
N/A

default test/resources structure [including default property files and template data/suite files] should be created automatically after first run

Is your feature request related to a problem? Please describe.
default resources structure must be manually copied before first run, which makes it difficult to start a new project using SHAFT_Engine

Describe the solution you'd like
It would be great if shaft automatically creates the needed directories if it discovers that they're not present.

Describe alternatives you've considered
N/A

Additional context
N/A

SHAFT_Engine offline installer

Is your feature request related to a problem? Please describe.
It takes a lot of time to download the initial project and it would help if the user can have a package that can be used for offline installation and customization of the initial project creation.

Describe the solution you'd like
A self extracting wizard that will extract the project and the dependencies, and configure the pom.xml group/artifact information.

The Properties folder is generated under the src/test/resources folder

When creating a new SHAFT_Engine maven project, the Properties folder is generated under the src/test/resources folder.

Steps To Reproduce:

  1. Create a new SHAFT_Engine maven project
  2. Check the src/test/resources folder
  3. We can see that the Properties folder is generated in the above path

Expected behavior: The Properties folder should be generated under src/main/resources folder.

image

SHAFT_Engine can skip all the elementActions validations and just log them without failing the test

Is your feature request related to a problem? Please describe.
To make SHAFT_Engine more user friendly.

Describe the solution you'd like
SHAFT_Engine can skip all the elementActions validations and just log them without failing the test and make it optional for the user to choose to apply them or not in the execution.property file.

Describe alternatives you've considered
N/A

Additional context
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.