Skip to content

Releases: skyweb07/Snap.swift

πŸ“Έ Multiple device snapshots + Kaleidoscope support

09 Jan 18:01
8adf558
Compare
Choose a tag to compare

New year, new challenges! πŸ”₯

This version brings a really cool feature so we can test multiple device screens in one assertion, it's as simple as:

expect(viewController).toMatchSnapshot(for devices: [.iphone4, .iphone5s])

// or 

expect(viewController).toMatchSnapshot(for: .allDevices)

Also thanks to @PhilippeRiegert we have added support for Kaleidoscope ksdiff #29 tool so it logs in the console the command needed to do diffing using the tool. To finish up we have fixed a small issue with auto layout constraints that needed to finish to update the layout before rendering the image on #28

tvOS support πŸ“Ί + Carthage πŸ”§ + Custom snapshot names γŠ”

15 Dec 16:47
Compare
Choose a tag to compare

Another minor release with some good stuff on it

Also, I've added support for custom snapshot names, now you can take many screenshots from a test case using custom names as:

 expect(view).toMatchSnapshot(named: "custom_name") // Reference image will be stored with this name

To end, @rnystrom found an issue πŸ› when generating snapshots in projects with spaces on directory #22

Thanks everyone involved ✨

Export image resources πŸ› 

29 Nov 17:05
Compare
Choose a tag to compare

What

As requested @niilohlin we now store the image assets in disk so external agents like (CI systems etc) can use those images

CALayer & Objective-C support βœ…

25 Nov 14:31
Compare
Choose a tag to compare

What

  • Added support for checking for CALayers, now you can use the same pattern that for view checking
func test_box_with_gradient_layer() {
  let layer = CAGradientLayer()
  layer.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
 
  expect(layer).toMatchSnapshot()
}
  • Added Objective-C compatibility and it's as easy as swift
@import XCTest;
#import <Snap_swift/Snap_swift-swift.h>
#import <Snap_swift/Snap.h>

@interface SnapTests : XCTestCase
@end

@implementation SnapTests
 
- (void)test_box_with_text_aligned_to_center {

  UIView *view = [BoxWithTextAlignedToCenterView new];
  
  verifyView(view); // or verifyLayer if it's a CALayer subclass
}

@end

0.2.0

25 Nov 13:53
Compare
Choose a tag to compare
0.2.0 Pre-release
Pre-release
no message