Open williamhqs opened 4 years ago
Same here. I've also taken a look at getReferenceImageDirectoryWithDefault
method and found that none of the defined environment variables gets passed upon running.
If you are using test plans, this might be of help to you.
Since I've recently converted to test plans, I was defining the environment variables the wrong way. I've opened a pull request (#131) with updated instructions. Basically, you need to set the variables inside the test plans configuration, not the run action section of your scheme because they will not get automatically transferred to the test action as they did before.
One additional note wrt @ekranac comment above, in addition to setting the environment variables for the configuration, I had to pick the scheme in the 'Target for Variable Expansion' setting
I'm having the same issue... Even if I set the values on test plans or branch new schemes, the code fails to create the directory at _saveReferenceImage
function under FBSnapshotTestController.m
.
When calling the [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:&creationError];
it returns the following error:
Error Domain=NSCocoaErrorDomain Code=4 "The file “MyTestScheme.MyTestClass” doesn’t exist." UserInfo={NSFilePath=/Users/MyUser/MyProjectName/MyTestScheme/ReferenceImages_64/MyTestScheme.MyTestClass, NSUnderlyingError=0x600003b45e60 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
but I can't find the folders ReferenceImages and FailureDiffs.
I can only find it from the log:
/Users/william/Library/Developer/Xcode/DerivedData/MyProject-gpgfmvvbgxrsaqamedlklzlbhyxu/Build/Products/Test-iphonesimulator/MyProject.app/PlugIns/MyProject Tests.xctest/ReferenceImages_64/MyProject Tests.CountdownViewTests/testExampleAndReturnError:@2x.png
I also tried set a fixed path, still doesn't work. Not sure the reason why, I don't want to find it from the console every time.
Any help? Thanks!