Creating Jenkins job to build Serenity Project

A free video tutorial from Tejasvi Hegde
Test Automation Enthusiast
Rating: 4.4 out of 5Instructor rating
7 courses
62,550 students
Creating Jenkins job to build Serenity Project

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 July 2023

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 a project where Jenkins will be creating a job and will basically be using this particular job to build that project will also be integrating Jenkins with GitHub. So essentially what will happen is every time we build a job in Jenkins, it will go and basically fetch the latest code from GitHub 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 build this research in Jenkintown. So let's start implementing this whole first thing is I need to start Jenkins'. So right now, the Jenkins' what file is present on my desktop. So what I do is I navigate to the desktop. And here I'm going to start Jenkins, the commander's job and his job. And we will provide the name of the wharfie, which is the thing, Mark Jenkins, start what? Now, placenta. So by default, the Jenkins application will start on Port 880. We just bring up a browser. And open up, Jenkins. I localhost post-paid. It's basically starting up. The speed for some more time. So Jenkins is basically started now we need to login, so the user name by default is admin and the password is something that I copied. We just copy it. Bassekou. So if you have not created a user, then you are you need to basically use the default username and password. So from the installation videos, I've basically shown how to. Get the password, you can revisit that. If not, if not, I can just show it one more time. So when you install Jenkins, you can actually get the initial password in this particular location, that is. You get home directly. You have to go to the Jenkins folder and indicates you have a particular secret. And if you open up this particular file, that is. Initial password, this will actually contain the password. So you need to use this password to log get. Or if you are not Anderson already, then you can just copy paste it here. So now we are locked into Jenkins, so the first thing that I need to do is. Need to install plugin. This plugin will basically be useful for us in order to view the entertainment reports that are generated by the project. So when we build this project, we will get our indexed outreach table. So in order to view this particular report, we need the actual publisher plugin. So install it. Just click on managing its. And here you have managed plugins. Sleekness. And you can click on the available to. And here you can search for. It's Stearman. Publisher. So this is not showing up here because they've already installed it, but if you type it, you should see something like this. You just type it in. So this is the plug. OK, so make sure you install this particular plugin, so when you install this plugin. After installing unicycling, need to restart Jenkins in order to in order for it to be available. So, for example, I'm just going to solve some of the plugin just to show this process. Let me just. Probably going to install this particular. Just to install this program so that all options you can see installed without restart and you can also download it and install after restart. So we choose this option. And you could just checkbook select these checkbooks, but once the download is. Finish, Jenkins will automatically restart. And Guinness has finished restarting and also the plug in will be installed. Next thing is we basically need to create a job in order to execute our project. So I'm going to click on Create New Jobs. And here I will enter the name. So let's say. Student. Up. I just keep this as the project name and all of these options, you can just select a freestyle project. OK. So just the job is created now within the job. We have the Conficker page, that is the job configuration is open, so we need to know Conficker, this particular job. The first thing that I'm going to provide is. And basically the source code management, so we are going to be integrating, Jenkins would get selected and here we need to provide the repository. So if you open up GitHub. And I'll provide the. Repository are. And also, we need to provide the credentials, the credentials is nothing but the. Get up, get a chance. So here. We can provide the credentials. There is. GitHub email is username. And the password. So at. And from here, we'll get the credentials. And also the brand that is you have a brand specified here, which is specified as the Masterbrand, if you look at GitHub, we also don't have any other branches that we just have only the masterbrand. So our code is basically in the masterbrand. So I'll just leave this as it is because we will be building the Masterbrand, the code from the master Bange. Whoever it is, I think the configuration that gets out is completed. Next, we need to. Basically build a project, so to build a project, scroll down to this built section here and I'll click on this doctor. That is a big step. So here we have different options, can either execute windows, better command execution and so on. Since our student project is a project, I'll be selecting this option. I want to basically build my name and project in what will be medium target. And here you have the reason to specify your goal. So the way. We build that project through. This particular caller is. You just copied us. So we have to clean, verify and then set at the aggregate. So this is our good. This would be a good. And also. We need to provide the politics of the fight. I'm just going to mention bombed out to some of you. And the rest are just as it is. And also, after the build is completed, basically need to publish the hits table reports. What about this? So after that, the post-production somewhere to select publisher FEMA reports and say at. And here we need to provide the directly. I'll just leave it alone for now. And this is a fight, and this is a title, so I named a sense. Student. And click on play. And so, Sarah. So the job configuration is completed. Now, let me bring this up when I build the job. What will happen is the files that are present here, that is a project that is present in this remote repository. This will be downloaded onto a temporary folder, Jenkins. And from there, the project will be executed if I click on below. The bill will start. It's going to open up the. Locks with a lock lock. So here you can see that it's correcting to get. And it also was able to download the vote, but while executing the good. It is not doing. So let's that it is so it's basically complaining that it could not find the bombed out axman. In this particular location. So that is what this is what this. I'm just going to copy this, but. And let me open up another terminal. And I would navigate to navigate to this park. That is users is a name Dot Jenkins and David Jenkins, you have workspace. I just navigated the Jenkins NSW. If I type in Alice. So here you can see that these are all the different jobs that were created in the Jenkins server, so these were all these are on the previous jobs that I had created. But this particular job that is a straight up job is the one that we just created now. So let me just navigate this navigating to this job CD. Surinder. For everyone else, so here you can see that this is our project. OK, so this is a student project and this was the text file that we were basically we pushed from our local repository to the remote. This is the text file and this is the student app. So what's happening here is the job is trying to find the bombed-out axman. In this particular location, there is one of the workspaces you have the job and another job that it's trying to find the right equipment, but we don't have the bomb here. The bomb is present inside the student. So if to Ellis student, so here you can see that this is where the bomb is present. Basically, what we need to do is you need to provide this. Holderman. That's a good start. So. Go back. And I'll open up the project configuration. And here's what I need to do is. Under the moving target yesterday to. So here need to provide the. Project name. And under the project, we have the politics of. I'm going to click on Uplay. Si. I think I have to do one thing that is I have not yet started the student up. So let me do that quickly. So even the threat of by default will start on. We don't want to we can't have two things running on the same boat, so I'm going to change the port. No. Now, this roundup should start on a different. So in my project also, I mentioned the Portland Press. But if I just open up this. Project on GitHub. So this port is also. So what I'm going to do is build a job, so this time the teshuvah. Doing the job. Also back here, if you look at this particular change, that is the GitHub change, the change is also listed in the bill. It's telling us what the changes. Click on it will also tell me the number and the commentary on it along with the fight. We can also do a diff. But now the job is actually executing. As you can see, that the. Builders started. No, the tests are only. They're executing so in the building under the bill number, in the control output, all the Jenkins logs on the logs would be displayed here. That is absolutely logs. So whatever. Logs we see here on Eclipse, the same logs will be able to see the control. So my machine is very slow. So what I'm going to do is I'm just going to take a seat that the tests are it. So I'm just going to pause this video here. And I let the complete. So the build is completed and here you can see that there are a lot of failures in the bill because we have some test failing. So the bill does basically fake. I go back to the project for the Jenkins job, and now if I try to open up the e-mail report. So to basically give me this idea, because it's not able to access the index. So, again, I'm going to bring up the. Terminal here. But the Jenkins', so. Basically, the issue is it's not able to find it indexed on steam, and so we are not provided the property properly, that's why the order is coming. Let me just open up a. New jackets with. So let's navigate to the Jenkins folder, that is user's username, Dot Jenkins, that we need to go to the workspace. And we had a straight up job, this is a jenkins' job. And another Jenkins job will have a certain project to navigate you. And. The index started estimate would be under this particular part, that is. Source and the source you have. Under the target. The target you have site and on the site, you have 270 Foldit. So here you see, this is where the index of stimulus for this will give me the working dirty, whatever it is, I'm just going to copy this particular part and let me go back to the. Job configuration. Now, go back to the post elections. This is the directly, but this is Detective Barbourville actually find the index started to imitate. We apply playing, David. And what I'm going to do is. Just go to. Close the student up. What killed kill this particular student publication I just restarted again? And I'll build the job again, and this time we should be able to see the estimated.