devops continuous integration -> selenium -> cucumber

10
DEVOPS – CONTINUOUS INTEGRATION Selenium & Cucumber

Upload: abhay-kumar-pmp-csm-itil

Post on 11-Jan-2017

105 views

Category:

Software


2 download

TRANSCRIPT

Page 1: DevOps Continuous Integration -> Selenium -> Cucumber

DEVOPS – CONTINUOUS INTEGRATIONSelenium & Cucumber

Page 2: DevOps Continuous Integration -> Selenium -> Cucumber

CONTINUOUS INTEGRATION

Source control

Continuous Integration

Build Automation

Build Repository

Automated Testing

Automated Release ManagementDevelopment

Page 3: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Selenium in Jenkins - Freestyle Project

Create a Java project in Eclipse using option -> New -> Java Project -> Update Project Name -> Click Libraries -> Add External Jars -> Select Selenium-Server-Standalone Jar file -> Add Library –> Select TestNG – >Click Next – >Click Finish –> Click Finish ->

Create a script file (mac)/bat file (window) in the project directory using syntax – “java –cp bin;lib/* org.testng.TestNG testng.xml” and save the file in same directory locally.

Page 4: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Selenium in Jenkins - Freestyle Project

Create a freestyle project in Jenkins using option –> New Item -> Update project name -> Select Freestyle project -> Press ok -> Click advance under General -> Select custom workspace ->update project home directory in the directory field ->

Next step , under build ->Press Add build step -> Select “Execute shell” -> Update script file name in the command field -> Press apply ->Press save ->

Now, a freestyle selenium project is ready to build in Jenkins.

Page 5: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Selenium in Jenkins - Maven Project

Verify & insure your Eclipse have Maven and TestNG plugins installed -> Create a Maven project in Eclipse using option New -> Project -> Select Maven Project -> Click next -> Check “Create a simple project” -> Click Next -> Update group ID field –> update artifact ID field -> update name -> update description -> click finish ->

Update the pom.xml file with necessary Selenium & testing dependencies and testng.xml file location update->

Page 6: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Selenium in Jenkins - Maven Project

Create a test program & generate testing.xml using right click test java class -> Select TestNG -> Convert to TestNG -> save testng.xml file as per pom.xml location specification ->

Next, in Jenkins -> Create New item –> Enter an item name -> Select Maven project -> Press ok -> Update pom.xml location file in build section -> Press apply –> Press save.

Now maven selenium project ready to build in Jenkins.

Page 7: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Cucumber in Jenkins - Maven Project

Create a project in Eclipse using option -> New -> project -> select Maven project -> press next -> check create a simple project -> Press next -> Update group ID -> Update artefact ID -> Update name -> Update description -> Press finish ->

Open pom.xml file -> Update latest stable selenium, junit, cucumber-java, cucumber-junit dependencies in the pom.xml -> Press control^S ->

Page 8: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Cucumber in Jenkins - Maven Project

Install cucumber software update for eclipse from http://cucumber.github.com/cucumber-eclipse/update-site using option help -> install new software -> Create a feature file ->

Create a package and java class in src/test/java folder using option new package -> Name the package -> New class -> Name the class -> Add reference of the feature file in the class ->

Page 9: DevOps Continuous Integration -> Selenium -> Cucumber

Configuring Cucumber in Jenkins - Maven Project

Create a test step package and java class in src/test/java folder using option new package -> Name package -> New class -> Name class -> Create test steps as per the feature file and reference as glue in the earlier defined class - >

In Jenkins, create new project using option -> New Item -> Enter an item name -> Select Maven -> Click ok -> Update location of the the pom-xml file in next page under build section-> Press apply -> Press save ->

Now, Maven cucumber project is ready to build in Jenkins.