Creating Jenkins job to build Serenity Project

Tejasvi Hegde
A free video tutorial from Tejasvi Hegde
Test Automation Enthusiast
4.3 instructor rating • 7 courses • 29,612 students

Learn more from the full course

REST API Automation:REST Assured,Serenity BDD Framework

Build a robust REST API test automation framework/CI environment using Serenity BDD, Jenkins, Git

05:28:09 of on-demand video • Updated May 2020

  • Build reusable methods ,write different types of tests
  • Create Data Driven Tests
  • Execute Tests Faster by running them in parallel
  • Run selective tests JUnit using Tags
  • Publish amazing reports with logging of Request & Response Information
  • Write Cucumber Scenarios integrated with Serenity BDD
  • Commit code to Github
  • Implement CI by integrating project with Jenkins & GIT
English [Auto] This lecture we'll be building or project y. Jenkins will be creating a job. GIGOT time we basically be using this particular job to build that project. You'll also be integrating Jenkins with get up. So essentially what will happen is every time we build the job. Jenkins the drill going basically First the latest code from get up and it'll download onto the local machine and from here on it will execute the project. And finally at the end of a project we'll be getting the result and we'll be able to view this result in Jenkins. So let's start implementing this. The first thing is I need to start Jenkyns. So right now the Jenkyns what I find is that on my desktop. So what I goes on now we get to the desktop it hit and where to start Jenkyns the commanders Giallo and is just and who will provide the name of the file which is the thing we're just going to start. What now. So by default the Jenkins application will start on port 80 80 browser and open up Jenkin's so I can look at host port 80 specifically starting up the speaker some more time. JENKINS This basically started now we need to log. So they use a name by default is adamant and the password is one thing that I copied we just copied be secure. So you have not created a user then you you need to basically use that before it has a name and password. From the installation videos I've basically showed how to ghetto password you can get it was it that if not if it's not I can just show you have a more time. So when you install Jenkins you can actually get the initial password. In this particular location that is your home directory you know to go to the Jenkins for that and indicates you have a particular secrets and if you will put up this particular file that is initial password this will actually created the password. So you need to use this password to log into its I feel noter disown already. Then you can just copy paste into. So now we are logged into Jenkin's the first thing that I need to do is I need to solve like a this plugin will basically be useful for us in August of Yuda it's demo reports that are generated in the project in the building Serenity project. We will get a next above. So in order to view this particular report we need the team a publisher. So we install it click on Manny Jenkyns and show you how to manage its this and you can click on the. And here you can search for instrument publisher. So this is not showing up here because I already installed it but if you type it you should see something like this. I'm just typing it. So this is the plug in. OK. Make sure you install this particular plug in. So when you install this plug it after installing you you need to restart Incans in order to in order for this plug in to be available. One example I'm just going to install some other plug in just to show this process. We just probably go to install this particular install this plan. So there are two options you can see installed without restart and you can also download it and install after the start. So would you choose this option. I mean you could just checkbook set up this checkbox but once the download is finished Jenkins will automatically stop and contest finished restarting. Also the plug in will be in stock. Next thing is VBC going to need to create a job in order to execute that product. Some wirklich can create new jobs you get into an let's say student. Just keep the project name and all of these options you can just select a freestyle project because Aki so disturbed the job is creative. Now did the job how confident page is Dopp integration is open. So we need to know configure this particular job. The first thing that I'm able to provide is basically Sellick the source code management. So we are going to be integrating Jenkins with get selected and here we need to provide a positive urine that we open up get up and provide the positive. And also we need to provide the credentials because this is nothing but a prodigious we can provide the credentials that is you me that is use on the Basford and from here we decide to get up Origin's Reinoso the Brenta stupid that is you have a brand specified here which is specified as the master branch. If you look at getup We also are going to have any other branches that just have only the master but. So our code is basically the master batch. So I'll just leave this as it is because we will be building the must a bunch the core from the most avenge what is I think though unFoolish on the good side is completed. Next we need to basically build the project so to build the project. Scroll down to this section here and then click on this dropdown and that is step. So here we have different options. Can either be a Windows batch command it's your channel. And so since I started that project is a maven project I'll be selecting this option. I want to be going to build my name and projects and see in what upload medium Doggett's and here's how the region do specifiable. So the way we build up project is to this particular goal that is we just copy this so we have the clean fight and then the aggregate. So does that work. This would be a good one also need to provide the number 7 5 and discriminated Baumgarten some of your understanding just as it is also after the build is completed. Basically we need to publish which team of reports does scoffed at the postproduction somewhat select publish or estimate reports and see at. And here we need to provide that directly. I'll just leave it blank for now. This is a fight and this is that right. And so I named essence student. Click on a play and see. So the job confrontation is completed. Now let me bring this up when I bring the job. What will happen is the Feister represented as a project present in this day more depositary this will be downloaded onto a temporary folder in Jenkins and from there the project will be executed. If I click on Bridgnorth the Bedouins start is going to open up the antoh looks quite like the can see that it's connecting to good and it also was able to download the file. But while executing the go it is not throwing another. So let's hope that it is. It's basically complaining that you could not find the bumboat excellent in this particular location. So let us see what this is or that it this is going to copy despite let me open up another minute. We navigate to never get to this let us users on the dark Jenkins and Jenkin's see how workspace I just never get to the jinking successors type in LS Sure you can see that these are all the different jobs that I have created and Jenkinson. So these were all of the previous jobs that I had created. But this particular job was a straight up doc who's the one that we just didn't. Now let me just navigate this navigate into this job. The CD student fundamentalists. So sure you can see that this is our project. OK this is a student project and this was a text file that we were mythically we pushed from a local Abbassi to the remarkable. This is the text file and this is the story. What's happening here is the job is trying to find the palm Bartik cement in this particular location. There is one of the waspishly how the job. And I know the job dipp it's trying to find the Pumbaa accident but we don't have the bomb here. The Pomus present inside the student so they do ls student. So here you can see that this is where the Pomus present missing and what we need to do is you need to provide this holding then. So go back and open up the project configuration and hear what I need to do is on the moving target just like you do here. But why the project name or number the product name have bombed or some on a play Sim I think I have forgotten too one thing that is not yet started the students up. Let me do that quickly. So even distraint up by default will start on to. We don't want or we can't have two things running on the same ports and would have changed the port number. Now this should start on EDT Fe. So in my project also I mentioned the port Ambrosi DTV That is if I just up this project and get hope the sport is also deeply in order to do his job. This time the addition of building the job molto Beckett if you look at this pretty close change that is the get up change the changes. Also to study the study of what the changes can do. Also tell me the board the comic book and the commandant at it along with that find we could also do it if the job is actually executing. You can see that the builders started the test. Suddenly that executing so buried under the bill number in the consulate worked on the Jenkins logs all the logs will be displayed here. That is the 70 locks. So whatever logs we see here on eclipse the same locks will be able to see that Ponson. So my machine is very slow so what I'm gonna do is I'm just going to. They can see that that it's not passing it. I'm just going to pause this video here and I'll let the complete with the just completed and hit you can see that there are a lot of failures in the bird because we have some test failing faint Why go back to the project for the Jenkins job up right now if I to open up the steamer report so it's going to be revisited because it's not able to access the index indexed on each team. So again I'm going to bring up the terminal here. GIGOT can stomach so physical issues it's not able to find the next ordnance team and so you're not going to pop out properly. Let's say the discovery begins to open up. New Window for this navigate to the Jenkins hold. But as users are in the dark Jenkins that we need to go to the workspace and we have the start up job is the Jenkins just under the Jenkin's job we'll have a secret project. So now we get here. And the indexed started estimate would be under this particular part is so some Wysocki into the target but I'm you have site and undecided how to 74 it. So here we proceed to suspect the next statement is Jose PWT. This will give the working directly what I'm worth. I'm just going to copy this particular part and let me go back to the competition now go back to the post-production is well this is the. But this is the dirty part very likely find the next Arctic's team is like we applied Seybert what I'm going to do is just go close to to get up would it kill this particular student up application and just that he started again. And I'll build the job again and this time we should be able to see the instrument.