How to integrate Cucumber with Jenkins

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hi everyone this is mes from learn hyen automation.com today in this video we'll mainly Focus how to integrate cocumber test with genkins so in this video we'll mainly cover how to download and install genkins then create a maven project in genkins and finally we'll execute for.xml file from genkins so I already uh covered a detailed tutorial in uh selenium Series where we have discussed how to configure genkins so to download genkins you need to Simply specify download genkins just type this in Google just just type Jenkins you'll get their official site jenkins. so recently they have done so many major changes in the genkins so you will notice you will get a different kind of UI now so click on download genkins you will get two options longterm release and weekly release I don't trust this weekly release so let's click on the long-term support one once you click on it you will get a v file I already have so I will click on cancel so once you get this VAR file I already have downloaded this v file so if I have to start this genkins I need to start command prompt I have to say Java space hyphen jar and I will directly mention this v file that's all and hit enter it will take hardly 1 minute and it will install genkins on your local machine so once you get this complete uh info section Jenkins is fully up and running then start any browser and type Local Host colon 8080 so it will start this genkins so in this video description I will provide two video links uh where we have discussed how to integrate genkins with selenium so already we have configured this long back but still if you are completely new then you can go to this manage genkins and uh here you need to mention your Java with is where your Java is located and Maven so only two things are required so if you click on the first one configure system then we have a specified Java and M in here it's running on Local Host is little bit slow so all settings will remain same here only need to do is uh if you go here is the Java and all this is the email notification that you have to do I'm using SMTP server details my username password and so this is for the email notification and for the Java one just check actually they changed so go to manage genin go to system information and this is SST information no so in the new UI you will find all the tools here previously everything was in configure system so in the recent genkins they moved all these options to Global tool configuration so if you go to This Global tool configuration first thing that you need to set is the jdk uncheck this and mention where your Java is located so in my machine right now it is located at this particular location then you need to add Maven so for me I will uncheck this and Maven is located right now in this directory that's all to start with jenin once your jdk is done Maven is done click on Save and you can go back to the genkins homepage I already have some jobs created but let's create a fresh job and uh let's create a maven project you can see there are four options I will say cucumber framework let's select this Maven project and click on okay in the meanwhile this is our test case you can see this is the complete project that we have designed so this is our feature file this is smoke test and this is test Runner right so uh let me run only one set of test case I don't want to run all so let me run this test case only once and rest piece of code is same so in this what we need to do just go down and here you will find one option called build now it will check for this pom.xml file and if you click on Advance option you have all these options so don't go with the advance option you need to specify where your pom.xml is located our pom.xml is located if you go to your project click on property our project is located under this directory right so I will go here and I will paste and I'm instructing genkins that go to this directory and in this directory you will find pom.xml and goals you can say you want clean and install so once you specify clean and install that's all and click on Save and now if you run this project so click on build now so it will start uh running a project and you can see it is building your project in this directory that is your local directory you can change it if you want but let's not change anything it will take some time and it will run your pom.xml yes you can see it's going to this directory it is uh running this pom.xml with this clean and install and rest piece of code will be same it will not uh change the execution Behavior the only thing which you will get now you're able to run through genkins now if anybody if anyone want to run this you can share this URL with them they will directly click on build now and you can execute your test so it is still starting your session and yes and our Chrome started so once okay it's taking time so let it run still we have taken the old example if you have some uh real test cases you can configure them as well it's taking too much time still it is waiting it will run so our main motto was we have to execute this via Jenkins and we have executed so all the test record will be saved and you'll get the result either pass or fail so if you want to configure some more settings like uh you want to send an email once you are done with this then if you go down yeah so here you have the post build steps like uh run only if build success or run regardless of build result then you can add all these build steps or else you can um this is like only if the build will fill then you will get an email notification so I can mention here if any build failed send me a test result on this email ID so if any test fail or you can say any job will fail I will get an email so send email for every unstable build that's all if you click on okay oh sorry save and you can see the previous test executed uh if you go to console output you will see one scenario executed and four steps so now if you go here yes we had only four steps given then given when then and under again then so we have four steps that already executed by Jenkins so now you can see this is showing in a blue color but and interesting fact about Jenkins you have one plugin called Green balls so it will show you in a green uh symbol if any of the test pass to install that plugin you can go to this manage genkins and uh and do one thing let's sorry I want to show you one more thing so let's uh cumber framework so let's run this project at least once so now go back to manage plugins if you want like if 10 test SP uh if your job is successful then you should get a green symbol not this default blue color so if you go to this plugin if you go to available section and search here that plug-in name is green balls so if you simply Type green this plug-in name will come so select this green balls and say install without restart and it will take some time it is checking the internet connectivity and all and yes green ball is installed now if you go back to your genkins and uh still your test is running but now you can see it is showing in a green color so doesn't uh blue doesn't look promising so now it will show you either either in a red color or in a green color so let's refresh still running and you can see it's still running so let's wait yes now build is Success so now if you go to this Jenkins dashboard you'll find this cumber framework and you can see the uh test result Trend right now again it uh turned into blue so what you need to do you need to restart your genkins and once you restart you will notice all this will come in a green color and this is the test uh result train So based on the success or failure it will automatically generate this graph so that's all I have for this video so just try to configure this genkins and try to run your cucumber test VI genkins in future I will show you some additional plugins which will help you to uh generate um report in more efficient way so if you simply search cucumber genkins plugin so Jenkins already have so many inbuilt plugins for cucumber if you the most effective one is second one cucumber report plugin so if you want to generate very Advanced report then this plug-in will help you and you can see it will show you all this screenshots okay so you will get this kind of report and good thing you will see this uh kind of 3D so right now we have not discussed tags so if you are using tags it will show you which tag has been pass failed so you can see it's very cool reporting so in future videos we are going to implement the same report plug-in it's very handy to use so if you want to use it already they have given some instructions so you can directly follow it and you can directly use it as of now let's stick to the default execution so yes we have uh completed so if you still have any doubt you can send me an email and don't forget to subscribe my channel thank you so much have a nice day
Info
Channel: Mukesh otwani
Views: 73,447
Rating: undefined out of 5
Keywords: selenium, Automation, Maven, Cucumber, Jenkins, How to integrate Cucumber with Jenkins
Id: ceRnV0C3pDw
Channel Id: undefined
Length: 14min 28sec (868 seconds)
Published: Mon Jun 06 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.