kif-framework / lela Goto Github PK
View Code? Open in Web Editor NEWLela iOS Perceptual Difference Testing Framework
License: GNU General Public License v3.0
Lela iOS Perceptual Difference Testing Framework
License: GNU General Public License v3.0
@phatmann Aimed at you.
Currently Lela doesn't support KIF 3.3.0 as the XCTest and OCTest sub-specs have been removed.
@bnickel, I would like to rename LELA to KIF.Visual to make it clear that it is part of the KIF ecosystem and what its purpose is. Is this change okay with you?
Hello, I'm simply stumped on where to put the expected images in order to pass the test. The documentation states, "copy the images into your test bundle" ... but I'm too noob to know where/how to do that.
I added the Expected in the acceptance tests folder and made sure that test bundle also had the image, but when I run the tests i get error saying that "Could not find expected image for Login Screen."
Code Snipet
#import "ImageDiffTests.h"
#import "KIF.h"
#import "KIFUITestActor+Lela.h"
#import "Lela.h"
@implementation ImageDiffTests
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)testLoginImage
{
[tester expectScreenToMatchImageNamed:@"Login Screen"];
}
Login Screen.png-768x1024@1x~ipad,iOS7.1.png is the file with the bundle
What am I missing here?
For some reason (I have Swift only framework in tests) I use use_frameworks! in cocoapods, so Lela is getting compiled to its own .framework
So this function
+ (NSString *)directoryForExpectedImages
{
return [[NSBundle bundleForClass:self] resourcePath];
}
returns path for Lela.framework, not the testing target
but I have no means to override this from my test
Hello. For some reason [imageWithContentsOfFile:] doesn't find the path file image, but using NSData it works, is anyone else having this problem? is anyone using Lela? :)
+ (UIImage *)expectedImageWithName:(NSString *)name
{
NSString *fileName = [[self imageNameForScreenNamed:name] stringByAppendingPathExtension:@"png"];
NSString *filePath = [[self directoryForExpectedImages] stringByAppendingPathComponent:fileName];
NSData *data = [NSData dataWithContentsOfFile:filePath]; //I changed these next 2 lines
return [UIImage imageWithData:data];
}
can you change it? I'm using cocoapods!
note: using iOS 8.3 with ipad 2 simulator
TIA!
Just curious, because we ported our app to Xcode7 and I'm having some interesting referential/dependency errors.
ld: warning: directory not found for option '-L/Users/klucas/Documents/Gannett/GIT/akira-ios/build/Debug-iphoneos'
"OBJC_CLASS$_KIFTestCase", referenced from:
OBJC_CLASS$_Lela_Visual_Tests in Lela_Visual_Tests.o
"OBJC_CLASS$_KIFUITestActor", referenced from:
objc-class-ref in Lela_Visual_Tests.o
"OBJC_METACLASS$_KIFTestCase", referenced from:
OBJC_METACLASS$_Lela_Visual_Tests in Lela_Visual_Tests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The same test run on the ios7.0 simulator works but on the ios8 simulator fails to find the reference image. The following call seems to return nil on Lela.mm line 68:
return [UIImage imageWithContentsOfFile:filePath];
I suspect it's related to this issue: http://stackoverflow.com/questions/25884382/ios-8-bundle-path-changes
KIF-next is marked as deprecated now that KIF 2 has been released. Lela should switch dependencies to the official version.
Currently there is no ability to adjust the pixel threshold for image comparison.
Ideally this would be exposed as an option as demonstrated in this commit (on @Oleg-Ivanov 's fork) here 10485a9 .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.