GithubHelp home page GithubHelp logo

frameworkium / frameworkium-bdd Goto Github PK

View Code? Open in Web Editor NEW
15.0 7.0 19.0 1.14 MB

Integration of Cucumber BDD and frameworkium-core to offer support for using tests written as feature files.

License: Apache License 2.0

Java 92.40% Gherkin 7.60%
automation selenium selenium-webdriver bdd cucumber-jvm

frameworkium-bdd's Introduction

Frameworkium Examples

build

This is a sample project which utilises frameworkium-core, a framework for writing maintainable Selenium and REST API tests that also makes integrating with other test things (e.g. JIRA) much easier.

Please see the Frameworkium usage guide for more details.

As a result:

<dependencies>
  <dependency>
    <groupId>com.github.frameworkium</groupId>
    <artifactId>frameworkium-core</artifactId>
    <!-- Update this with the latest from the frameworkium-core releases page -->
    <version>3.0.0</version>
  </dependency>
</dependencies>

The Frameworkium project is based on Ardesco's Selenium-Maven-Template and Joe VDW's Bootstrapium. We have extended it with some handy extras for getting started quickly with Selenium, Appium and Rest Assured.

Getting Started

After setting up apache maven, open the frameworkium-examples directory in a terminal/command prompt and run mvn clean verify to run the example tests using Firefox.

You will need the geckodriver on your path if you are using Firefox version 48 or above.

Browsers

You can provide the -Dbrowser argument to chose a browser to run the tests in.

Drivers

Each browser requires a "driver".

For chrome, ChromeDriver needs to be on your path or specified as an argument:

mvn clean verify -Dbrowser=chrome -Dwebdriver.chrome.driver=c:\path\to\chromedriver.exe

For Firefox 48 and above, geckodriver needs to be on your path or specified as an argument:

mvn clean verify -Dbrowser=firefox -Dwebdriver.gecko.driver=c:\path\to\geckodriver.exe

Selenium Grid

Want to run tests using a grid and in parallel?

mvn clean verify -Dbrowser=chrome -DgridURL=http://localhost:4444/wd/hub -Dthreads=4

All you need to do is ensure the browser is installed in the default location and that the driver is on the path.

Sauce Labs

Running mobile web tests using Appium on Sauce Labs is only slightly more involved:

export SAUCE_USERNAME=username
export SAUCE_ACCESS_KEY=access_key
mvn clean verify -Dplatform=ios -Dbrowser=safari -Dsauce=true 

BrowserStack

Running mobile web tests using Appium on BrowserStack:

export BROWSER_STACK_USERNAME=username
export BROWSER_STACK_ACCESS_KEY=access_key
mvn clean verify -Dplatform=ios -Dbrowser=safari -DbrowserStack=true 

A full list of arguments can be found on the guidance page.

Reporting

After running your tests, you can generate an Allure test report by simply running:

mvn allure:report 

Further Information

Frameworkium sets you up for other stuff too - check out the guidance page for further info.

frameworkium-bdd's People

Contributors

5a4fa0dc42c6f avatar davecpayne avatar dependabot[bot] avatar gitnikos avatar ham1 avatar mjl33 avatar robertgates55 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

frameworkium-bdd's Issues

The Allure report creates both a default suite and a feature suite

Describe the Issue
When the feature BDD suite is generated, a default suite called Surefire Suite is also created. This is counted as an extra test in the execution, even though only one test is actually run. This causes a discrepancy in the test results.
To Reproduce
Steps to reproduce the behavior:

  1. Execute the test with the maven command,mvn clean verify -Dbrowser=chrome"
  2. On successful execution execute maven report command mvn allure: report. Report generated successfully

Expected Behaviour
A clear and concise report should be generated with only the feature file suite displayed in the report.

Screenshots

image

Versions (please complete the following information):

  • Frameworkium-core version: [4.0.0-BETA4]
  • OS: [e.g. Windows 10]
  • Browser [e.g. Chrome]
  • Version [e.g. 116]

Additional Context
Add any other context about the problem here.

retry is not working for BDD examples

I have added @Test(retryAnalyzer = RetryFlakyTest.class) to the test class and then run the seleniumHq bdd example (forcing it to fail) mvn clean verify -Dtags=@CustomTag -DmaxRetryCount=2

After the test fails, the test is not executed again. Is the retry feature working for BDD implementation?

How do I specify the path of the chrome or the IE driver inorder to debug a single feature file

Hi Team,

Thanks for the excellent framework.

I am trying to use this BDD framework and run/debug a particular feature file using Chrome or the IE driver but I am unable to make out exactly as to where do I mention the path of the driver.exe files for chrome or IE. Below is what I am trying to achieve. Any help would be appreciated.

String chromedriver_path = System.getProperty("user.dir") + "/drivers/chromedriver.exe";
System.setProperty("webdriver.chrome.driver",chromedriver_path);

Should the UITestRunner have alwaysRun set on afterMethod?

I've found that if an exception is thrown in the setUpClass or setTestName methods (annotated with @BeforeClass and @BeforeMethod respectively) of UITestRunner, then the subsequent test(s) are skipped, and so the afterMethod method doesn't execute. This meant that the Chrome session didn't get killed.

Adding alwaysRun=true to the @AfterMethod annotation seems to have resolved this issue.

Is there any downside to that which I might be missing? If not, I'm happy to submit a PR with that change in.

[Question] Calling methods from the same page

   @Step
    @Given("^I have opened Admin Ui login page$")
    public void givenIHaveLogedToAdminUi() throws InterruptedException {
        LoginPage.open();
    }

    @Given("^User logged to Admin Ui as a \"([^\"]*)\" and \"([^\"]*)\"$")
    public void whenImLoginIntoAdminUiAsATypeAnd(String username, String password) throws InterruptedException {
        new LoginPage().get().fillLoginForm(username, password);
        new LoginPage().get().login();
        new DashboardPage().get().getMainMenu();
    }

    @Then("^I click submit button with empty credential$")
    public void thenIClickSubmitButtonWithEmptyCredential() throws InterruptedException {
        new LoginPage().get().loginWithWrongCred();
    }

    @Then("^I should see Invalid Username or Password message$")
    public void thenIShouldSeeInvalidUsernameOrPassword() throws InterruptedException {
        Assert.assertTrue(new LoginPage().get().getInvalidUsernameAndPasswordError());
    }

I have Following code and my question is should i always call (new LoginPage().get().SOME_METHOD or create an LoginPage object and reuse it in other methods?
New keyword should be rather for creating instance of page ?

Error writing allure properties file

Hi just pulled down the frameworkium-bdd repo. I get the following exception on test run seems it is unable to find properties in the target directory?

[INFO] Running TestSuite
18:06:32.677 [TestNG-test=Surefire test-1] ERROR - IO problem when writing allure properties file
java.io.FileNotFoundException: target/allure-results/environment.properties (No such file or directory)
at java.io.FileOutputStream.open0(Native Method) ~[?:?]
at java.io.FileOutputStream.open(FileOutputStream.java:298) ~[?:?]
at java.io.FileOutputStream.(FileOutputStream.java:237) ~[?:?]
at java.io.FileOutputStream.(FileOutputStream.java:126) ~[?:?]
at com.frameworkium.core.common.reporting.allure.AllureProperties.save(AllureProperties.java:82) [frameworkium-core-3.0.0.jar:?]
at com.frameworkium.core.common.reporting.allure.AllureProperties.createUI(AllureProperties.java:32) [frameworkium-core-3.0.0.jar:?]
at com.frameworkium.core.ui.UITestLifecycle.afterTestSuite(UITestLifecycle.java:114) [frameworkium-core-3.0.0.jar:?]
at com.frameworkium.bdd.UITestRunner.tearDownClass(UITestRunner.java:85) [test-classes/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) [testng-6.14.3.jar:?]
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59) [testng-6.14.3.jar:?]
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458) [testng-6.14.3.jar:?]
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222) [testng-6.14.3.jar:?]
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142) [testng-6.14.3.jar:?]
at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:214) [testng-6.14.3.jar:?]
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) [testng-6.14.3.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

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.