0% found this document useful (0 votes)
9 views1 page

Cucumber Config Framework

Uploaded by

spotslank5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Cucumber Config Framework

Uploaded by

spotslank5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Create Framework from scratch

1- Create Maven project

2- Add dependencies (selenium, Webdrivermanager, Junit, Cucumber-Java, Cucumber-Junit))

3- Create folder features src/test/resources/features

4- Create folder config src/test/resources/config

Add new config.properties (URL, browserName, data of test cases: password, login, email, address ...)

5- Implement JunitRunner.java src/test/java (package runner) Independent

6- Implement DriverFactory.java src/test/java (package driverFactory) Independent

7- Implement useCase.feature (use cases with Gherkin language)

8-Add useCaseStepDefinition.java to src/test/java (package stepDefinition) (continue implementation on step 13)

Add unimplemented methods (generated when we execute useCase.feature) without implementation

9-Implement PageObjectModel.java src/test/java (package pageObjects) (locate the web page elements (By
Xpath, By Id) and return the WebElements located)

10-Implement ConfigReader.java src/main/java (package utils) (it is a file reader to read group of properties and
return it) (file config.properties should exist)

11-Implement ElementUtils.java src/main/java (package utils) (implement methods wish is a combination of


actions (sendkeys, wait …) that will probably will be executed together on a same web Element) Independent

12- Implement HooksApp.java (@Before, @After ...) src/test/java (package hooks) (needs driverFactory
configReader)

13-Implement Add useCaseStepDefinition.java to src/test/java (package stepDefinition)

src/test/java runner

driverFactory

pageObjects

hooks

stepDefinition

src/main/java utils (ConfigReader.java , ElementUtils.java)

JunitRunner: CucumberOptions:
Options Type Purpose Default Value
dryRun true: Checks if all the Steps have the Step Definition false
features set: The paths of the feature files {}
glue set: The paths of the step definition files {}
tags instruct: What tags in the features files should be executed {}
monochrome true: Display the console Output in much readable wav false
format set: What all report formaters to use false
strict true: Will fail execution if there are undefined or pending steps false
plugin set: generate cucumber reports {}

You might also like