Skip to content

Commit

Permalink
Fix ios13 issue and improve screenshot taking
Browse files Browse the repository at this point in the history
  • Loading branch information
kenji21 committed Oct 8, 2019
1 parent 1099b90 commit 94ffe31
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Removed

## [0.3.0](https://github.com/openium/SwiftiumTestingKit/compare/v0.3.0...HEAD)
## [0.3.0](https://github.com/openium/SwiftiumTestingKit/compare/v0.3.0...v0.4.0)
### Added
Attach screenshot using XCUIScreen.main.screenshot() and a name

### Changed
Update SimulatorStatusMagic to ios13 branch

### Removed


## [0.3.0](https://github.com/openium/SwiftiumTestingKit/compare/v0.3.0...v0.4.0)
### Added
Support for Swift 5.1

Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "kif-framework/KIF" ~> 3.7
github "shinydevelopment/SimulatorStatusMagic" ~> 2.2
github "shinydevelopment/SimulatorStatusMagic" "ios13"
github "AliSoftware/OHHTTPStubs" ~> 7.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "AliSoftware/OHHTTPStubs" "7.0.0"
github "kif-framework/KIF" "v3.7.8"
github "shinydevelopment/SimulatorStatusMagic" "2.4.1"
github "shinydevelopment/SimulatorStatusMagic" "82529f682e0b988d3c115b9e98e9ff77f3215798"
2 changes: 1 addition & 1 deletion STKTestAppTests/STKSoloTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class STKSoloTests: XCTestCase {
let alertOKAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alertVC.addAction(alertOKAction)
viewController.present(alertVC, animated: false, completion: nil)

attachScreenshot(name: "test")
// When
let waitForOK = sut.waitFor(tappableText: "OK", andTapIt: true)

Expand Down
8 changes: 4 additions & 4 deletions SwiftiumTestingKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = QH6KR5PAQ7;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -560,7 +560,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.3.0;
MARKETING_VERSION = 0.4.0;
PRODUCT_BUNDLE_IDENTIFIER = fr.openium.SwiftiumTestingKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -576,7 +576,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = QH6KR5PAQ7;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -594,7 +594,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.3.0;
MARKETING_VERSION = 0.4.0;
PRODUCT_BUNDLE_IDENTIFIER = fr.openium.SwiftiumTestingKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
11 changes: 10 additions & 1 deletion SwiftiumTestingKit/XCTestCaseExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,22 @@ extension XCTestCase {
name: StaticString = #function,
cleaningMethodNameWith: (StaticString) -> String) {
//let image = solo.window.otk_screenshot(withStatusBar: true)
let image = window.layer.screenshot
let image = XCUIScreen.main.screenshot().image
//let image = window.layer.screenshot
let attachment = XCTAttachment(image: image, quality: .medium)
attachment.lifetime = .keepAlways
let nameCleaned = cleaningMethodNameWith(name)
attachment.name = nameCleaned
add(attachment)
}

public func attachScreenshot(name: String) {
let image = XCUIScreen.main.screenshot().image
let attachment = XCTAttachment(image: image, quality: .medium)
attachment.lifetime = .keepAlways
attachment.name = name
add(attachment)
}
}

extension UIView {
Expand Down
1 change: 1 addition & 0 deletions tag-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if [ $# -lt 1 ] ; then
exit -1
fi

VERSION=$1
TAG=v$VERSION

echo "Have you updated the changelog for version $VERSION ? (ctrl-c to go update it)"
Expand Down

0 comments on commit 94ffe31

Please sign in to comment.