Skip to content

Commit 94ffe31

Browse files
committed
Fix ios13 issue and improve screenshot taking
1 parent 1099b90 commit 94ffe31

File tree

8 files changed

+30
-10
lines changed

8 files changed

+30
-10
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1010

1111
### Removed
1212

13-
## [0.3.0](https://github.com/openium/SwiftiumTestingKit/compare/v0.3.0...HEAD)
13+
## [0.3.0](https://github.com/openium/SwiftiumTestingKit/compare/v0.3.0...v0.4.0)
14+
### Added
15+
Attach screenshot using XCUIScreen.main.screenshot() and a name
16+
17+
### Changed
18+
Update SimulatorStatusMagic to ios13 branch
19+
20+
### Removed
21+
22+
23+
## [0.3.0](https://github.com/openium/SwiftiumTestingKit/compare/v0.3.0...v0.4.0)
1424
### Added
1525
Support for Swift 5.1
1626

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github "kif-framework/KIF" ~> 3.7
2-
github "shinydevelopment/SimulatorStatusMagic" ~> 2.2
2+
github "shinydevelopment/SimulatorStatusMagic" "ios13"
33
github "AliSoftware/OHHTTPStubs" ~> 7.0

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github "AliSoftware/OHHTTPStubs" "7.0.0"
22
github "kif-framework/KIF" "v3.7.8"
3-
github "shinydevelopment/SimulatorStatusMagic" "2.4.1"
3+
github "shinydevelopment/SimulatorStatusMagic" "82529f682e0b988d3c115b9e98e9ff77f3215798"

STKTestAppTests/STKSoloTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class STKSoloTests: XCTestCase {
182182
let alertOKAction = UIAlertAction(title: "OK", style: .default, handler: nil)
183183
alertVC.addAction(alertOKAction)
184184
viewController.present(alertVC, animated: false, completion: nil)
185-
185+
attachScreenshot(name: "test")
186186
// When
187187
let waitForOK = sut.waitFor(tappableText: "OK", andTapIt: true)
188188

SwiftiumTestingKit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@
542542
CLANG_ENABLE_MODULES = YES;
543543
CODE_SIGN_IDENTITY = "";
544544
CODE_SIGN_STYLE = Automatic;
545-
CURRENT_PROJECT_VERSION = 3;
545+
CURRENT_PROJECT_VERSION = 4;
546546
DEFINES_MODULE = YES;
547547
DEVELOPMENT_TEAM = QH6KR5PAQ7;
548548
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -560,7 +560,7 @@
560560
"@executable_path/Frameworks",
561561
"@loader_path/Frameworks",
562562
);
563-
MARKETING_VERSION = 0.3.0;
563+
MARKETING_VERSION = 0.4.0;
564564
PRODUCT_BUNDLE_IDENTIFIER = fr.openium.SwiftiumTestingKit;
565565
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
566566
SKIP_INSTALL = YES;
@@ -576,7 +576,7 @@
576576
CLANG_ENABLE_MODULES = YES;
577577
CODE_SIGN_IDENTITY = "";
578578
CODE_SIGN_STYLE = Automatic;
579-
CURRENT_PROJECT_VERSION = 3;
579+
CURRENT_PROJECT_VERSION = 4;
580580
DEFINES_MODULE = YES;
581581
DEVELOPMENT_TEAM = QH6KR5PAQ7;
582582
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -594,7 +594,7 @@
594594
"@executable_path/Frameworks",
595595
"@loader_path/Frameworks",
596596
);
597-
MARKETING_VERSION = 0.3.0;
597+
MARKETING_VERSION = 0.4.0;
598598
PRODUCT_BUNDLE_IDENTIFIER = fr.openium.SwiftiumTestingKit;
599599
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
600600
SKIP_INSTALL = YES;

SwiftiumTestingKit/XCTestCaseExtension.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,22 @@ extension XCTestCase {
6666
name: StaticString = #function,
6767
cleaningMethodNameWith: (StaticString) -> String) {
6868
//let image = solo.window.otk_screenshot(withStatusBar: true)
69-
let image = window.layer.screenshot
69+
let image = XCUIScreen.main.screenshot().image
70+
//let image = window.layer.screenshot
7071
let attachment = XCTAttachment(image: image, quality: .medium)
7172
attachment.lifetime = .keepAlways
7273
let nameCleaned = cleaningMethodNameWith(name)
7374
attachment.name = nameCleaned
7475
add(attachment)
7576
}
77+
78+
public func attachScreenshot(name: String) {
79+
let image = XCUIScreen.main.screenshot().image
80+
let attachment = XCTAttachment(image: image, quality: .medium)
81+
attachment.lifetime = .keepAlways
82+
attachment.name = name
83+
add(attachment)
84+
}
7685
}
7786

7887
extension UIView {

tag-release.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if [ $# -lt 1 ] ; then
55
exit -1
66
fi
77

8+
VERSION=$1
89
TAG=v$VERSION
910

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

0 commit comments

Comments
 (0)