Jenkins is an open-source automation server written in Java(can be used with any technology). Jenkins helps to automate the non-human part of the software development process, with continuous integration.
It works based on plugins, i.e., have to install respective plugins in order to communicate. For example, Maven, Git plugins have to install with configuration.
Instead of pulling the entire code for building and testing. You can just use Jenkins to automatically fetch the code from the repository, build and test it in the test environment and can send an email notification about the results so it will be easier to find the bug in that version of the commit, instead of going through the whole code to find the bug.
1. Navigate to : https://jenkins.io/download/
2. Download the Generic war files, choose the war file from the stable release
3. Go to the folder in terminal/CMD where you have stored the Jenkins.war file and execute the below command.
java -jar jenkins.war
4. You would be able to success screen once we execute the command.
5. Navigate to the URL in your browser http://localhost:8080; sometimes, it may take up to 3 minutes to open the page, so have patience if you get no page/ error page.
6. Please navigate to the highlighted path in your browser, and copy the password. 7. Install / select plugins based on your need, you can install plugins after installation of Jenkins as well. 8. You may need to wait for 10-15 mins for the completion of the installation of plugins. 9. Fill the use details and continue 10. Click on start Jenkins button 11. If you reached the below page, then your installation is successful.
protractor conf.js. If you have not configured the workspace path, then you need to write the command to navigate to the workspace and then protractor run command like below.
d: # change the driver to d
cd D:Protractor Demo # navigate to the folder where the conf file is present.
protractor conf.js
Not all the times, you will have to run in the local machine because you got to execute the automation in node/slave machines.
In such cases, we have to fetch the code from the repository and execute if your code Javascript then you can run directly, but if it is Typescript then you need to compile the code(tsc) and then run it.
Under Source Management, choose the required tool and then provide the git URL and then the branch to clone. You might need to change the build steps because this time, you should install the npm packages and then compile the code and then execute.
d: # change the driver to d
cd D:Protractor Demo # navigate to the folder where the conf file is present.
npm install protractor
#please do install required, I have limited with protractor to show you
tsc
protractor conf.js
You might have heard about the Maven build tool used for installing the java jar files and update them.
But with javascript, we should use the package.json file to install npm packages at a shot; please refer package.json tutorial for more details.
package.json file must be pushed and should present in the repository
I have set the compilation command in the postinstall command inside the package.json. Example for package.json
{
"name": "cherchertech",
"version": "1.0.1",
"description": "this is to showcase the package.json tutorial",
"main": "index.js",
"dependencies": {
"jasmine": "^3.2.0"
},
"devDependencies": {
"@types/jasmine": "^2.8.8",
"jasmine": "^3.2.0",
"protractor": "^5.4.1",
"typescript": "^3.0.3"
},
"scripts": {
"preinstall":"npm cache clear",
"postinstall":"tsc",
"test": "protractor conf.js",
"posttest":"rmdir node_modules"
},
"keywords": [
"cherchertech",
"package",
"tutorial",
"protractor"
],
"author": "karthiq",
"license": "ISC"
}
When we use package.json, we can write below simple steps to install packages and run the code. Repository steps remain the same
d: # change the driver to d
cd D:Protractor Demo # navigate to the folder where the conf file is present.
npm install
npm test
I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.
Hi, I have angular project in my local in that i have created my test cases in E2E folder when I'm running my test cases with the command ng e2e then I'm getting EPIPE error message then I tried running Yarn e2e then my test cases are running. How to integrate with the Jenkins and how to run my test cases when there is a deployment? Can anyone help me on this.
Hi sir, How can we add the build no to access the report in mail for each Jenkins run.
Hi KarthiQ, i have gone through the protractor material you have provided and that is awesome. Actually i am working on protractor with minimum knowledge since i have not come across such scenarios to lean more. But now after reading this tutorial i am confident enough to handle any scenario. Thanks a lot. i got confused in one area that all the examples given is in only typescript?? do you have any material with only javascript ?