I guess you all have enough knowledge on Jenkins setup. If not you can refer to my article on setting up Jenkins from here. Now you may wonder how to get a report of test results after executing your automated test suite via Jenkins. We will learn how to generate test results in html file in Jenkins. For that we are going to use protractor-jasmine2-html-reporter
- Framework has to be jasmine2
framework: 'jasmine2'
- Login as Jenkins user
thuvvareka: thuvvareka$ sudo su - jenkins Password: thuvvareka:~ jenkins$
- Now you have logged in as jenkins user, Run the following command to install protractor-jasmine2-html-reporter
npm install protractor-jasmine2-html-reporter --save-dev
- Configure protractor-jasmine2-html-reporter in your protractor configuration file
exports.config = { onPrepare: function () { var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter'); protractor.basePath = __dirname; jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({ savePath: '/tmp/reports' }) ); },Directory will be automatically created if it does not exist. You can view the results in html page with the screenshots.
Comments
Post a Comment