Comparing version 1.0.5 to 1.0.6
Changelog | ||
========= | ||
v1.0.6 - Rename custom matchers to avoid naming conflict with Jasmine toMatch (04/11/2015) | ||
v1.0.5 - Add Jasmine 2 custom matchers (10/07/2015) | ||
v1.0.4 - Fix writing diff when sub-directories are under base path (30/12/2014) | ||
@@ -5,0 +8,0 @@ |
@@ -211,3 +211,3 @@ var BlinkDiff = require('blink-diff'), | ||
var v1 = { | ||
toMatch: function() { | ||
toMatchScreen: function() { | ||
var result = this.actual, | ||
@@ -221,3 +221,3 @@ percent = +((result.differences / result.dimension) * 100).toFixed(2); | ||
toNotMatch: function() { | ||
toNotMatchScreen: function() { | ||
var result = this.actual; | ||
@@ -231,3 +231,3 @@ this.message = function() { | ||
v2 = { | ||
toMatch: function() { | ||
toMatchScreen: function() { | ||
return { | ||
@@ -244,3 +244,3 @@ compare: function(actual, expected) { | ||
toNotMatch: function() { | ||
toNotMatchScreen: function() { | ||
return { | ||
@@ -247,0 +247,0 @@ compare: function(actual, expected) { |
{ | ||
"name": "pix-diff", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Protractor plugin for image comparison", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -46,3 +46,3 @@ Pix-Diff | ||
PixDiff provides two comparison methods ```checkScreen``` and ```checkRegion``` along with two jasmine matchers ```toMatch``` and ```toNotMatch```. Two helper methods ```saveScreen``` and ```saveRegion``` are provided for saving images. | ||
PixDiff provides two comparison methods ```checkScreen``` and ```checkRegion``` along with two jasmine matchers ```toMatchScreen``` and ```toNotMatchScreen```. Two helper methods ```saveScreen``` and ```saveRegion``` are provided for saving images. | ||
@@ -58,3 +58,3 @@ **Example:** | ||
it("should match the page", function () { | ||
expect(browser.pixdiff.checkScreen('example-page')).toMatch(); | ||
expect(browser.pixdiff.checkScreen('example-page')).toMatchScreen(); | ||
}); | ||
@@ -64,7 +64,7 @@ | ||
element(By.buttonText('yes')).click(); | ||
expect(browser.pixdiff.checkScreen('example-page')).toNotMatch(); | ||
expect(browser.pixdiff.checkScreen('example-page')).toNotMatchScreen(); | ||
}); | ||
it("should match the title", function () { | ||
expect(browser.pixdiff.checkRegion(element(By.id('title')), 'example-page-title')).toMatch(); | ||
expect(browser.pixdiff.checkRegion(element(By.id('title')), 'example-page-title')).toMatchScreen(); | ||
}); | ||
@@ -74,3 +74,3 @@ | ||
expect(browser.pixdiff.checkRegion(element(By.id('title')), 'example-page-title', { | ||
blockOut: {x: 10, y: 132, width: 100, height: 50}})).toMatch(); | ||
blockOut: {x: 10, y: 132, width: 100, height: 50}})).toMatchScreen(); | ||
}); | ||
@@ -77,0 +77,0 @@ }); |
@@ -27,3 +27,3 @@ 'use strict'; | ||
it("should match the page with custom matcher", function () { | ||
expect(browser.pixDiff.checkScreen('example-page')).toMatch(); | ||
expect(browser.pixDiff.checkScreen('example-page')).toMatchScreen(); | ||
}); | ||
@@ -38,4 +38,4 @@ | ||
it("should not match the page with custom matcher", function () { | ||
expect(browser.pixDiff.checkScreen('example-fail', {threshold:1})).toNotMatch(); | ||
expect(browser.pixDiff.checkScreen('example-fail', {threshold:1})).toNotMatchScreen(); | ||
}); | ||
}); |
19537