Giter VIP home page Giter VIP logo

ruru-protractor-html-screenshot-reporter's Introduction

ruru-protractor-html-screenshot-reporter

Protractor test results in HTML format with screen captures.

Will work with multi-capabilities and spec file sharding.

##BETA BETA BETA BETA

Needs more tests, more use in different configurations.

Build status: Run Status

Test coverage: Coverage Badge

Installation

npm install ruru-protractor-html-screenshot-reporter

Usage

Place the following in your Protractor configuration file

var HTMLScreenshotReporter = require('ruru-protractor-html-screenshot-reporter');

Create an instance of the reporter passing (optional) configuration parameters

var htmlReporter = new HTMLScreenshotReporter({
	title : 'My Protractor End to End Test Report',
	targetPath : 'target',
	screenshotsFolder : 'screenshots-folder',
	fileName : 'protractor-e2e-report.html',
	takeScreenShotsForPassedSpecs: true
});

Place the following in your Protractor configuration file

exports.config = {

	framework : 'jasmine2',
	
	//You MUST define the resultJsonOutputFile configuration so it can be post processed
	resultJsonOutputFile : 'my-protractor-e2e-results.json',

	...
	
	//Place an onPrepare function similar to:
	onPrepare : function () {

		// Assign the test reporters to each running instance
		jasmine.getEnv().addReporter(htmlReporter);

		//Provide browser with capability information so that all specs can access it
		return browser.getProcessedConfig().then(function (config) {
			return browser.getCapabilities().then(function (cap) {
				browser.version = cap.get('version');
				browser.browserName = cap.get('browserName');
				browser.baseUrl  = config.baseUrl;
			});
		});
	},
	
	//Place an afterLaunch function similar to:
	afterLaunch : function (exitCode) {
		return new Promise(function (resolve) {
			htmlReporter.generateHtmlReport(exports.config.resultJsonOutputFile);
		});
	}
}

Development

If you want to build and test this project you will be able to by:

npm install
npm test

ruru-protractor-html-screenshot-reporter's People

Contributors

andre-h avatar tiberiuzuld avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.