Saturday, 22 September 2018

Maven With Cucumber


Maven with Cucumber

  What is BDD

ü  Behaviour-driven development focus on the what test on the application.
ü  BDD uses plain English text to explain the exact requirements
ü  BDD uses the language called Gherkins
ü  In the market the BDD can implement by
·         Cucumber (Java),
·         Jbehave (Java),
·         SpecFlow (dot net environment) etc.,

What is Cucumber

ü  Cucumber is a behavior driven development (BDD) approach to automation test scripts to test Desktop, Web and Android Apps.
ü  It often develops and execute acceptance, Functional, Regression and unit tests.
ü  Cucumber makes to understand the eclipse the Gherkin syntax and works like a syntax highlighter.
ü  It highlights main syntax in feature file and it is more readable.
ü  We can run the feature file independently
ü  The official URL is  https://docs.cucumber.io/   -> (cucumber.io/docs/reference)
ü  Required list of.jar files for cucumber 
·         Cobertura-2.1.1
·         Cucumber-core-1.1.2
·         Cucumber-java-1.1.2
·         Cucumber –junit-1.1.2
·         Cucumber–jvm-deps-1.0.3
·         Cucumber-reporting-0.1.0
·         Gherkin2.12.1
·         Junit-4.11
·         Mockito-all-2.0.2

The Complete jar files with pom.xml


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>MavenwithCucumberProject</groupId>
  <artifactId>MavenwithCucumberProject</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>MavenwithCucumberProject</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
  
  
  <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-core -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-core</artifactId>
    <version>1.2.5</version>
</dependency>

<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.2.5</version>
</dependency>

<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.2.5</version>
    <scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/gherkin -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>gherkin</artifactId>
    <version>2.12.2</version>
    <scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-html -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-html</artifactId>
    <version>0.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-jvm-deps -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-jvm-deps</artifactId>
    <version>1.0.5</version>
    <scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.serenity-bdd/serenity-cucumber -->
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>1.9.12</version>
</dependency>
  
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Few keywords, which are used to define in the feature file about the requirement i.e.,
·         Given
·         When
·         Then
And etc.

No comments:

Post a Comment