Skip to content

Commit

Permalink
Add pixel threshold pixel option to screenshot matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg-Ivanov committed Dec 5, 2014
1 parent 2215e32 commit 10485a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lela/KIFUITestActor+Lela.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

#import <KIFUITestActor.h>

extern NSString * const LECompareOptionThresholdPixels;

@interface KIFUITestActor (Lela)

- (void)expectScreenToMatchImageNamed:(NSString *)name;
- (void)expectScreenToMatchImageNamed:(NSString *)name options:(NSDictionary *)options;

@end
2 changes: 2 additions & 0 deletions Lela/KIFUITestActor+Lela.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#import "Lela.h"
#import <XCTest/XCTest.h>

NSString * const LECompareOptionThresholdPixels = @"LECompareOptionThresholdPixels";

@implementation KIFUITestActor (Lela)

+ (NSString *)lelaTestRunName
Expand Down
1 change: 1 addition & 0 deletions Lela/Lela.mm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ + (BOOL)compareExpectedImage:(UIImage *)expected toActual:(UIImage *)actual opti
args.ImgA = RGBAImage::ReadFromUIImage(expected);
args.ImgB = RGBAImage::ReadFromUIImage(actual);
args.ImgDiff = new RGBAImage(args.ImgA->Get_Width(), args.ImgA->Get_Height(), "Output");
args.ThresholdPixels = [options[LECompareOptionThresholdPixels] unsignedIntValue];

BOOL success = Yee_Compare(args);

Expand Down

0 comments on commit 10485a9

Please sign in to comment.