@@ -179,23 +179,20 @@ describe("Integration", function () {
179179 } ) ;
180180 } ) ;
181181
182- ifNotInWebkitIt (
183- "should compare a page with its reference image and return true if similar" ,
184- function ( done ) {
185- var testPageUrl = testHelper . fixture ( "pageUnderTest.html" ) ;
186-
187- storeReferenceImage ( testPageUrl , {
188- imageUri : theReferenceImageUri ,
189- } ) . then ( function ( ) {
190- csscritic . add ( testPageUrl ) ;
191- csscritic . execute ( ) . then ( function ( passed ) {
192- expect ( passed ) . toBe ( true ) ;
182+ it ( "should compare a page with its reference image and return true if similar" , function ( done ) {
183+ var testPageUrl = testHelper . fixture ( "pageUnderTest.html" ) ;
193184
194- done ( ) ;
195- } ) ;
185+ storeReferenceImage ( testPageUrl , {
186+ imageUri : theReferenceImageUri ,
187+ } ) . then ( function ( ) {
188+ csscritic . add ( testPageUrl ) ;
189+ csscritic . execute ( ) . then ( function ( passed ) {
190+ expect ( passed ) . toBe ( true ) ;
191+
192+ done ( ) ;
196193 } ) ;
197- }
198- ) ;
194+ } ) ;
195+ } ) ;
199196
200197 // Disabled, as we cannot compare the serialized image across browsers. Same image has different serialisations
201198 xit ( "should store a reference when a result is accepted" , function ( done ) {
@@ -231,84 +228,72 @@ describe("Integration", function () {
231228 } ) ;
232229 } ) ;
233230
234- ifNotInWebkitIt (
235- "should properly report a failing comparison" ,
236- function ( done ) {
237- var testPageUrl = testHelper . fixture ( "brokenPage.html" ) ;
238-
239- storeReferenceImage ( testPageUrl , {
240- imageUri : theReferenceImageUri ,
241- } ) . then ( function ( ) {
242- csscritic . addReporter ( csscritic . NiceReporter ( ) ) ;
243- csscritic . add ( testPageUrl ) ;
244- csscritic . execute ( ) . then ( function ( ) {
245- expect (
246- $ ( ".cssCriticNiceReporter .failed.comparison" )
247- ) . toExist ( ) ;
248- expect (
249- $ (
250- ".cssCriticNiceReporter .comparison .titleLink"
251- ) . text ( )
252- ) . toEqual ( testPageUrl ) ;
253- expect (
254- $ ( ".cssCriticNiceReporter .comparison .errorText" )
255- ) . toExist ( ) ;
256- expect (
257- $ (
258- ".cssCriticNiceReporter .comparison .errorText"
259- ) . text ( )
260- ) . toContain ( "background_image_does_not_exist.jpg" ) ;
261- expect (
262- $ (
263- ".cssCriticNiceReporter .comparison .referenceImageContainer img"
264- )
265- ) . toExist ( ) ;
266- expect (
267- $ (
268- ".cssCriticNiceReporter .comparison .referenceImageContainer canvas"
269- )
270- ) . toExist ( ) ;
271- expect (
272- $ (
273- ".cssCriticNiceReporter .comparison .pageImageContainer canvas"
274- )
275- ) . toExist ( ) ;
276-
277- done ( ) ;
278- } ) ;
279- } ) ;
280- }
281- ) ;
282-
283- ifNotInWebkitIt (
284- "should correctly re-render a page overflowing the given viewport" ,
285- function ( done ) {
286- var testPageUrl = testHelper . fixture ( "overflowingPage.html" ) ,
287- reporter = jasmine . createSpyObj ( "Reporter" , [
288- "reportComparison" ,
289- ] ) ,
290- result ;
291-
292- csscritic . addReporter ( reporter ) ;
293-
294- // Accept first rendering
295- reporter . reportComparison . and . callFake ( function ( theResult ) {
296- result = theResult ;
297- } ) ;
231+ it ( "should properly report a failing comparison" , function ( done ) {
232+ var testPageUrl = testHelper . fixture ( "brokenPage.html" ) ;
298233
234+ storeReferenceImage ( testPageUrl , {
235+ imageUri : theReferenceImageUri ,
236+ } ) . then ( function ( ) {
237+ csscritic . addReporter ( csscritic . NiceReporter ( ) ) ;
299238 csscritic . add ( testPageUrl ) ;
300239 csscritic . execute ( ) . then ( function ( ) {
301- var anothercsscritic = aCssCriticInstance ( ) ;
302- result . acceptPage ( ) ;
240+ expect (
241+ $ ( ".cssCriticNiceReporter .failed.comparison" )
242+ ) . toExist ( ) ;
243+ expect (
244+ $ ( ".cssCriticNiceReporter .comparison .titleLink" ) . text ( )
245+ ) . toEqual ( testPageUrl ) ;
246+ expect (
247+ $ ( ".cssCriticNiceReporter .comparison .errorText" )
248+ ) . toExist ( ) ;
249+ expect (
250+ $ ( ".cssCriticNiceReporter .comparison .errorText" ) . text ( )
251+ ) . toContain ( "background_image_does_not_exist.jpg" ) ;
252+ expect (
253+ $ (
254+ ".cssCriticNiceReporter .comparison .referenceImageContainer img"
255+ )
256+ ) . toExist ( ) ;
257+ expect (
258+ $ (
259+ ".cssCriticNiceReporter .comparison .referenceImageContainer canvas"
260+ )
261+ ) . toExist ( ) ;
262+ expect (
263+ $ (
264+ ".cssCriticNiceReporter .comparison .pageImageContainer canvas"
265+ )
266+ ) . toExist ( ) ;
267+
268+ done ( ) ;
269+ } ) ;
270+ } ) ;
271+ } ) ;
303272
304- anothercsscritic . addReporter ( reporter ) ;
305- anothercsscritic . add ( testPageUrl ) ;
306- anothercsscritic . execute ( ) . then ( function ( status ) {
307- expect ( status ) . toBe ( true ) ;
273+ it ( "should correctly re-render a page overflowing the given viewport" , function ( done ) {
274+ var testPageUrl = testHelper . fixture ( "overflowingPage.html" ) ,
275+ reporter = jasmine . createSpyObj ( "Reporter" , [ "reportComparison" ] ) ,
276+ result ;
308277
309- done ( ) ;
310- } ) ;
278+ csscritic . addReporter ( reporter ) ;
279+
280+ // Accept first rendering
281+ reporter . reportComparison . and . callFake ( function ( theResult ) {
282+ result = theResult ;
283+ } ) ;
284+
285+ csscritic . add ( testPageUrl ) ;
286+ csscritic . execute ( ) . then ( function ( ) {
287+ var anothercsscritic = aCssCriticInstance ( ) ;
288+ result . acceptPage ( ) ;
289+
290+ anothercsscritic . addReporter ( reporter ) ;
291+ anothercsscritic . add ( testPageUrl ) ;
292+ anothercsscritic . execute ( ) . then ( function ( status ) {
293+ expect ( status ) . toBe ( true ) ;
294+
295+ done ( ) ;
311296 } ) ;
312- }
313- ) ;
297+ } ) ;
298+ } ) ;
314299} ) ;
0 commit comments