Skip to main content

Protractor jasmine2 html reporter with Jenkins

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

Popular posts from this blog

GitLab and Jenkins configuration through SSH

In my previous post I have mentioned how to integrate GitLab with Jenkins using username and password. Now we will learn how to configure Jenkins and GitLab using SSH connection. Login as Jenkins user sudo su - jenkins Run the following command to generate SSH key,  ssh - keygen Now it will create  a directory named .ssh if it doesn't exist, Press enter and re-enter when you are prompted to enter passphrase. thuvvareka : ~ jenkins$ ssh - keygen Generating public / private rsa key pair . Enter file in which to save the key ( / Users / Shared / Jenkins / . ssh / id_rsa ) : Created directory ' /Users/Shared/Jenkins/.ssh ' . Enter passphrase ( empty for no passphrase ) : Enter same passphrase again : Your identification has been saved in / Users / Shared / Jenkins / . ssh / id_rsa . Your public key has been saved in / Users / Shared / Jenkins / . ssh / id_rsa . pub . The key fingerprint is : SHA256 : O9APiAETUYC87e9T6k18SPFQxEN4R2gJbKG6JLOID64 jenkins@thu...

Katalon studio Execution Profiles

Hi Folks, I want to share my experience regarding the learning, My project manager asked me to find the best way to automate the web application for the regression/retest purpose. So I had a research on the tools and technologies regarding automation. So I found this :) In this post I would like to share my knowledge on Katalon Studio Profiles.  Let's have a quick idea regarding Katalon studio. Katalon studio is a free automation testing tool and supports the web and mobile environment, and built on top of the open-source automation frameworks Selenium, Appium with a specialized IDE. Pre requests - You can download Katalon studio from this link. I am using the latest version in order to avoid unnecessary errors. First, I will show how to record the Web application via Katalon studio. Find below mentioned test scenarios which are going to be recorded Launch the application (URL : http://demoaut.katalon.com/ ) Make an Appointment Login using provided credentials...

Data Driven Protractor Testing

In this article I would like to share knowledge regarding Data driven testing. When using a Data driven automation test framework, we do not need to hard code the test data. Instead it enables to access the test data from a separate data file and use them in the automated test cases. First, let's take a look at a simple Protractor script without Data Driven framework describe('Angular home page', function () {       it('should add the String in todo list ', function () {          browser.get('https://angularjs.org/');          element.all(by.css("[placeholder='add new todo here']")).sendKeys("Add POM");          element(by.css('input.btn-primary')).click();          var getText = element.all(by.css('label.checkbox'));          getText.get(2).getText().then(function (results) {          expect(results).toEqua...