项目作者: rohinegi548

项目描述 :
Behavior Driven Development Cucumber - Selenium based automation framework including Cucumber Pretty, Advanced and Allure reports
高级语言: HTML
项目地址: git://github.com/rohinegi548/Cucumber-BDD-Automation-Framework.git


# Cucumber-BDD-Automation-Framework

Behavior Driven Development Cucumber - Selenium based automation framework including Allure reports

This framework contains sample code containing:


  • 1 feature (feature file)

  • 2 Scenarios

  • Simple scenario login scenario and adding products to carts

  • Advance scenario where parameterization has been used (Scenario Outline examples) to search different types of products and listing out them


Directory structure:









Steps to run at your system:



  • Clone the repository using “git clone

  • Change “Username” and “Password” in both scenarios in feature file

  • Run “mvn clean test”

  • Run “mvn site”



Cucumber Reports: net.masterthought - This will generate two reports



  • Cucumber Pretty (folder - “target\cucumber-reports\cucumber-pretty”), file - “index.html”

  • Cucumber Advance (folder - “target\cucumber-reports\advanced-reports\cucumber-html-reports”), file - “overview-features.html”




Folders for these reports:








Snapshots - Cucumber - Pretty - Report: See here






Snapshots - Cucumber - Advanced - Report: See here









See configuration in “pom.xml” file

  1. <plugin>
  2. <groupId>net.masterthought</groupId>
  3. <artifactId>maven-cucumber-reporting</artifactId>
  4. <version>3.8.0</version>
  5. <executions>
  6. <execution>
  7. <id>execution</id>
  8. <phase>verify</phase>
  9. <goals>
  10. <goal>generate</goal>
  11. </goals>
  12. <configuration>
  13. <projectName>MyProjectName</projectName>
  14. <!-- Replace with project name -->
  15. <outputDirectory>target/cucumber-reports/advanced-reports</outputDirectory>
  16. <cucumberOutput>target/cucumber-reports/CucumberTestReport.json</cucumberOutput>
  17. <buildNumber>1</buildNumber>
  18. <parallelTesting>false</parallelTesting>
  19. <enableFlashCharts>false</enableFlashCharts>
  20. <skippedFails>true</skippedFails>
  21. </configuration>
  22. </execution>
  23. </executions>
  24. </plugin>

Allure Report:

Allure reports will be generated based on the testcases json files when you’ll run “mvn site”.

Add this Allure dependency in pom.xml:




ru.yandex.qatools.allure
allure-cucumber-jvm-adaptor
1.6.2



Add this under Maven Surefire plugin:




javaagent:”${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar” -Dcucumber.options=”—plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter”
And this under “project xml” tag


true


ru.yandex.qatools.allure
allure-maven-plugin
2.5







You will be able to locate the report in folder : “target\site\allure-maven-plugin”, the “Index.html” file.










You can either open it through Firefox or on a local server. I had used “Jetty server”, using this command: “mvn jetty:run”. And then open url in your any browser “http://localhost:8080“ and there you go.



MVN Jetty configuration is to be done in pom.xml if want to use it:



org.eclipse.jetty
jetty-maven-plugin
9.2.10.v20150310

${project.build.directory}/site/allure-maven-plugin
stop
1234



Example snapshot of Allure report:


  • allure-xunit view





  • allure-xunit1 view





  • allure-xunit2 view





  • allure-behavior1 view





  • allure-behavior2 view





  • allure-graph view





Added a sample Execution Video and Generated Reports, See here:
Herexecution Video and Generated Reports