Skip to content

Commit

Permalink
Merge pull request #103 from theappbusiness/release/1.6.0
Browse files Browse the repository at this point in the history
Release/1.6.0
  • Loading branch information
Zachary Borrelli authored Jul 7, 2020
2 parents bbdd63d + 1643f64 commit 8401910
Show file tree
Hide file tree
Showing 16 changed files with 184 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ os:
- osx
osx_image: xcode10.3
language: swift
before_install:
- brew update
- brew bundle
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/TABTestKit.xcworkspace -scheme TABTestKit_ExampleUITests -sdk iphonesimulator12.4 -destination "OS=12.4,name=iPhone Xs" | xcpretty
- carthage build --archive
- pod lib lint
2 changes: 2 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
brew "carthage"
brew "cocoapods"
60 changes: 60 additions & 0 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"entries": {
"brew": {
"carthage": {
"version": "0.35.0",
"bottle": {
"cellar": ":any_skip_relocation",
"prefix": "/usr/local",
"files": {
"catalina": {
"url": "https://homebrew.bintray.com/bottles/carthage-0.35.0.catalina.bottle.tar.gz",
"sha256": "fdaacafff1566fa7b1e42e68e108da69aa7578dc82f4736272dca10283c9cba2"
},
"mojave": {
"url": "https://homebrew.bintray.com/bottles/carthage-0.35.0.mojave.bottle.tar.gz",
"sha256": "1da29ca0b1d8e79bec5e548f5ab2433890ebc3fc9007f5fdb70d9e3be281dbb7"
},
"high_sierra": {
"url": "https://homebrew.bintray.com/bottles/carthage-0.35.0.high_sierra.bottle.tar.gz",
"sha256": "130fcb9bc06ef8e7f1c5ac9af0d155bd347db039b2cf80fa0fef764b3627ffbf"
}
}
}
},
"cocoapods": {
"version": "1.9.3",
"bottle": {
"cellar": "/usr/local/Cellar",
"prefix": "/usr/local",
"files": {
"catalina": {
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.9.3.catalina.bottle.tar.gz",
"sha256": "70f8c793bb60631422db028bbebb64ba9fcc1085a216abe5e625357380e06d46"
},
"mojave": {
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.9.3.mojave.bottle.tar.gz",
"sha256": "074e5b53b7a054c132582183dcf47546ddd028a7beb9fcdc653fe4a43225bcf3"
},
"high_sierra": {
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.9.3.high_sierra.bottle.tar.gz",
"sha256": "61d9473fd19573cebe3401921c69b8bc69eba9c096de654776a24dedd089ce65"
}
}
}
}
}
},
"system": {
"macos": {
"mojave": {
"HOMEBREW_VERSION": "2.4.2",
"HOMEBREW_PREFIX": "/usr/local",
"Homebrew/homebrew-core": "7007f55d45d89fcf9d3b3402b11b0870e8c21c05",
"CLT": "10.3.0.0.1.1562985497",
"Xcode": "11.3",
"macOS": "10.14.6"
}
}
}
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Pending

---

## 1.6.0

- Added `Image` element which can be used to represent images (and anything else that XCUI sees as a `.image` type). (issue #100)
- Added Brewfile for better dependency control
- Fixes an issue when building Carthage framework failed due to a missing file in TABTestKit carthage project.
- Adds a step script for building carthage framework in Travis CI. This should report to CI if the TABTestKit can be build as a Carthage framework.
- Adds a step script for linting cocoapods project in Travis CI. This should report to CI if the TABTestKit can be safe to be published as Cocoapods framework.


---

## 1.5.0
Expand Down
4 changes: 4 additions & 0 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 18 additions & 10 deletions Example/TABTestKit/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="VEl-fI-I9x">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="VEl-fI-I9x">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -145,14 +145,14 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LOH-Wp-wlz">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" alwaysBounceVertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LOH-Wp-wlz">
<rect key="frame" x="0.0" y="0.0" width="375" height="700"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QfG-gN-IGv">
<rect key="frame" x="0.0" y="0.0" width="375" height="1039.5"/>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QfG-gN-IGv">
<rect key="frame" x="0.0" y="0.0" width="375" height="1075.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ZkC-Ik-w7v">
<rect key="frame" x="32" y="0.0" width="311" height="1039.5"/>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ZkC-Ik-w7v">
<rect key="frame" x="32" y="8" width="311" height="1105.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Example label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="T3E-u4-09J">
<rect key="frame" x="0.0" y="0.0" width="311" height="20.5"/>
Expand Down Expand Up @@ -262,8 +262,15 @@
<color key="pageIndicatorTintColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="currentPageIndicatorTintColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</pageControl>
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ufc-9Z-WSb">
<rect key="frame" x="0.0" y="823.5" width="311" height="216"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qez-OB-CWf">
<rect key="frame" x="0.0" y="823.5" width="311" height="50"/>
<accessibility key="accessibilityConfiguration">
<bool key="isElement" value="YES"/>
</accessibility>
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default"/>
</imageView>
<pickerView contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ufc-9Z-WSb">
<rect key="frame" x="0.0" y="889.5" width="311" height="216"/>
</pickerView>
</subviews>
</stackView>
Expand Down Expand Up @@ -300,6 +307,7 @@
<outlet property="button" destination="qtX-qz-K6y" id="uki-Ua-0gn"/>
<outlet property="decimalPadTextField" destination="61Z-cm-ZHi" id="erp-Pq-mkz"/>
<outlet property="emailAddressTextField" destination="5fw-xl-ecR" id="8yG-pC-ARd"/>
<outlet property="imageView" destination="Qez-OB-CWf" id="3ih-0H-8Kj"/>
<outlet property="label" destination="T3E-u4-09J" id="XIT-Qw-tLK"/>
<outlet property="numberPadTextField" destination="bDy-WJ-8HC" id="kKJ-mR-HGy"/>
<outlet property="numbersAndPunctuationTextField" destination="R96-dd-z2I" id="P7z-aD-qnW"/>
Expand Down
6 changes: 6 additions & 0 deletions Example/TABTestKit/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Example/TABTestKit/Images.xcassets/ottoman.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ottoman.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Example/TABTestKit/OtherElementsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class OtherElementsController: UIViewController {
@IBOutlet private var toggle: UISwitch!
@IBOutlet private var stepper: UIStepper!
@IBOutlet private var pageControl: UIPageControl!
@IBOutlet private var imageView: UIImageView!
@IBOutlet private var picker: UIPickerView!

override func viewDidLoad() {
Expand All @@ -51,6 +52,9 @@ final class OtherElementsController: UIViewController {
toggle.accessibilityIdentifier = "ExampleSwitch"
stepper.accessibilityIdentifier = "ExampleStepper"
pageControl.accessibilityIdentifier = "ExamplePageControl"
imageView.image = UIImage(named: "ottoman")
imageView.accessibilityLabel = "Ottoman"
imageView.accessibilityIdentifier = "ExampleImage"
picker.accessibilityIdentifier = "ExamplePicker"
picker.dataSource = self
picker.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct OtherElementsScreen: Screen {
let toggle = Switch(id: "ExampleSwitch")
let stepper = Stepper(id: "ExampleStepper")
let pageIndicator = PageIndicator(id: "ExamplePageControl")
let image = Image(id: "ExampleImage")
let picker = Picker(id: "ExamplePicker")
let shareSheet = ActivitySheet()

Expand Down
6 changes: 6 additions & 0 deletions Example/TABTestKit_ExampleUITests/OtherElementsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ final class OtherElementsTests: TABTestCase, SystemPreferencesContext {
Then(the: value(of: otherElementsScreen.pageIndicator, is: "page 1 of 3"))
}

Scenario("Seeing the image") {
Given(I: scroll(otherElementsScreen, .downwards, until: otherElementsScreen.picker, is: .visible))
When(I: see(otherElementsScreen.image))
Then(the: value(of: otherElementsScreen.image, is: "Ottoman"))
}

Scenario("Seeing and interacting with the picker") {
Given(I: see(otherElementsScreen.picker))
And(the: value(of: otherElementsScreen.picker.wheel(0), is: "Hello"))
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func test_login() {
- [`Picker`](#picker)
- [`PageIndicator`](#pageindicator)
- [`WebView`](#webview)
- [`Image`](#image)
- [Predefined Screens](#predefined-screens)
- [`systemPreferencesRootScreen`](#systempreferencesrootscreen)
- [`systemPreferencesGeneralScreen`](#systempreferencesgeneralscreen)
Expand Down Expand Up @@ -1146,6 +1147,20 @@ Since `WebView` conforms to `Scrollable`, you can scroll it:
webView.scroll(.left)
```

#### Image

`Image` represents an image or imageView in the app:

```swift
let image = Image(id: "ExampleImage")
```

Since `Image` conforms to `ValueRepresentable`, you can get the label (string) value:

```swift
XCTAssertEqual(image.value, "image of random object")
```

#### Icon

`Icon` typically represents an app icon on the Home Screen, but can represent
Expand Down
4 changes: 2 additions & 2 deletions TABTestKit.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'TABTestKit'
s.version = '1.5.0'
s.version = '1.6.0'
s.summary = 'Strongly typed Swift wrapper around XCTest / XCUI, enabling you to write BDD-style automation tests, without writing much code at all.'
s.homepage = 'https://github.com/theappbusiness/TABTestKit'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.authors = { 'zacoid55' => '[email protected]',
'KaneCheshire' => '[email protected]',
'theblixguy' => '[email protected]' }
s.source = { :git => 'https://github.com/theappbusiness/TABTestKit.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.ios.deployment_target = '12.4'
s.swift_version = '5.0'
s.source_files = 'TABTestKit/Classes/**/*'
s.frameworks = 'XCTest'
Expand Down
4 changes: 4 additions & 0 deletions TABTestKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
9536C80D2412A7D100D4B362 /* ActivitySheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9536C80C2412A7D100D4B362 /* ActivitySheet.swift */; };
957289A72481452C00DBC55D /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 957289A62481452C00DBC55D /* Icon.swift */; };
95D471C22397C8C1002BEFCA /* SheetContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D4716B2397C8C1002BEFCA /* SheetContext.swift */; };
95D471C32397C8C1002BEFCA /* BiometricsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D4716C2397C8C1002BEFCA /* BiometricsContext.swift */; };
95D471C42397C8C1002BEFCA /* NavigationContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D4716D2397C8C1002BEFCA /* NavigationContext.swift */; };
Expand Down Expand Up @@ -80,6 +81,7 @@

/* Begin PBXFileReference section */
9536C80C2412A7D100D4B362 /* ActivitySheet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivitySheet.swift; sourceTree = "<group>"; };
957289A62481452C00DBC55D /* Icon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = "<group>"; };
95D471462397C1A9002BEFCA /* TABTestKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TABTestKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
95D4715D2397C8C1002BEFCA /* Biometrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Biometrics.h; sourceTree = "<group>"; };
95D471652397C8C1002BEFCA /* Biometrics-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Biometrics-Bridging-Header.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -260,6 +262,7 @@
95D4718A2397C8C1002BEFCA /* Cell.swift */,
95D471892397C8C1002BEFCA /* CollectionView.swift */,
95D4718F2397C8C1002BEFCA /* Header.swift */,
957289A62481452C00DBC55D /* Icon.swift */,
95D471992397C8C1002BEFCA /* Keyboard.swift */,
95D471842397C8C1002BEFCA /* Label.swift */,
95D471932397C8C1002BEFCA /* NavBar.swift */,
Expand Down Expand Up @@ -474,6 +477,7 @@
95D471CC2397C8C1002BEFCA /* XCUIElement+hasKeyboardFocus.swift in Sources */,
95D471C42397C8C1002BEFCA /* NavigationContext.swift in Sources */,
95D471D72397C8C1002BEFCA /* TabBar.swift in Sources */,
957289A72481452C00DBC55D /* Icon.swift in Sources */,
95D471DA2397C8C1002BEFCA /* View.swift in Sources */,
95D471E92397C8C1002BEFCA /* Slider.swift in Sources */,
95D471EA2397C8C1002BEFCA /* PageIndicator.swift in Sources */,
Expand Down
Loading

0 comments on commit 8401910

Please sign in to comment.