Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ cache:
- Pods
before_install:
- export LANG=en_US.UTF-8
- xcrun instruments -s devices
- xcrun instruments -w "iPhone 7 (10.3.1) [" || true
install:
- make install
before_script:
- xcodebuild -workspace ICInputAccessory.xcworkspace -list
script:
- bundle exec rake ci:build
- bundle exec rake ci:test
- make -B carthage
- make -B docs
after_script:
Expand Down
550 changes: 0 additions & 550 deletions Example.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

3 changes: 2 additions & 1 deletion Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>ICInputAccessoryExample</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down Expand Up @@ -35,7 +37,6 @@
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
412 changes: 412 additions & 0 deletions ICInputAccessory.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -14,10 +14,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B5E9F8FA1C8D3B6E00443DC7"
BlueprintIdentifier = "B53376871F4436D000230739"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
ReferencedContainer = "container:ICInputAccessory.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -32,20 +32,20 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B548C5C11C8E91B0009D5AEE"
BlueprintIdentifier = "B533769A1F4436D000230739"
BuildableName = "ICInputAccessoryUITests.xctest"
BlueprintName = "ICInputAccessoryUITests"
ReferencedContainer = "container:Example.xcodeproj">
ReferencedContainer = "container:ICInputAccessory.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B5E9F8FA1C8D3B6E00443DC7"
BlueprintIdentifier = "B53376871F4436D000230739"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
ReferencedContainer = "container:ICInputAccessory.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
Expand All @@ -65,10 +65,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B5E9F8FA1C8D3B6E00443DC7"
BlueprintIdentifier = "B53376871F4436D000230739"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
ReferencedContainer = "container:ICInputAccessory.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
Expand All @@ -84,10 +84,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B5E9F8FA1C8D3B6E00443DC7"
BlueprintIdentifier = "B53376871F4436D000230739"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
ReferencedContainer = "container:ICInputAccessory.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
3 changes: 0 additions & 3 deletions ICInputAccessory.xcworkspace/contents.xcworkspacedata

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

32 changes: 8 additions & 24 deletions ICInputAccessoryUITests/ICKeyboardDismissTextFieldUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,24 @@ import XCTest

class ICKeyboardDismissTextFieldUITests: XCTestCase {

private lazy var app = XCUIApplication()

override func setUp() {
super.setUp()
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

func testKeyboardDismissing() {
let app = XCUIApplication()
app.tables.cells.textFields["ICKeyboardDismissTextField"].tap()

let keyboardWindow = app.children(matching: .window).element(boundBy: 1)
let accessory = keyboardWindow.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element(boundBy: 0)
accessory.children(matching: .button).element.tap()
app.tables.textFields["ICKeyboardDismissTextField"].tap()
app.buttons["Dismiss Keyboard"].tap()
}

func testStoryboard() {
let app = XCUIApplication()
let tablesQuery = app.tables

tablesQuery.buttons["Storyboard"].tap()
tablesQuery.textFields["Storyboard ICKeyboardDismissTextField"].tap()

let keyboardWindow = app.children(matching: .window).element(boundBy: 1)
let accessory = keyboardWindow.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element(boundBy: 0)
accessory.children(matching: .button).element.tap()

tablesQuery.buttons["Back to Code"].tap()
app.tables.buttons["Storyboard"].tap()
app.tables.textFields["Storyboard ICKeyboardDismissTextField"].tap()
app.buttons["Dismiss Keyboard"].tap()
app.tables.buttons["Back to Code"].tap()
}

}
72 changes: 15 additions & 57 deletions ICInputAccessoryUITests/ICTokenFieldUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,15 @@ import XCTest

class ICTokenFieldUITests: XCTestCase {

private lazy var app = XCUIApplication()

override func setUp() {
super.setUp()
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
app.launch()
}

func testTokenField() {
let app = XCUIApplication()
let tablesQuery = app.tables
let textField = tablesQuery.cells.containing(.staticText, identifier:"ICTokenField").children(matching: .textField).element

private func typeTexts(in textField: XCUIElement) {
textField.tap()
textField.typeText("Try")
textField.typeText(" ")
Expand All @@ -61,58 +52,25 @@ class ICTokenFieldUITests: XCTestCase {
textField.typeText("TestFlight")
textField.typeText(",")

let searchButton = app.buttons["Search"]
searchButton.tap()
app.buttons["Search"].tap()
}

func testTokenField() {
let textField = app.tables.cells.containing(.staticText, identifier:"ICTokenField").children(matching: .textField).element
typeTexts(in: textField)
}

func testCustomizedTokenField() {
let app = XCUIApplication()
app.tables.staticTexts["CustomizedTokenField"].tap()

let tokenField = app.navigationBars["Example.CustomizedTokenView"].scrollViews.children(matching: .textField).element
tokenField.typeText("Try")
tokenField.typeText(" ")
tokenField.typeText("iCook")
tokenField.typeText(",")
tokenField.typeText("beta")
tokenField.typeText(" ")

let deleteKey = app.keys["delete"]
deleteKey.tap()
deleteKey.tap()

tokenField.typeText("TestFlight")
tokenField.typeText(",")

let searchButton = app.buttons["Search"]
searchButton.tap()
typeTexts(in: tokenField)
}

func testStoryboard() {
let app = XCUIApplication()
let tablesQuery = app.tables
tablesQuery.buttons["Storyboard"].tap()

let tokenField = tablesQuery.cells.containing(.staticText, identifier:"Storyboard ICTokenField").children(matching: .textField).element
tokenField.tap()
tokenField.typeText("Try")
tokenField.typeText(" ")
tokenField.typeText("iCook")
tokenField.typeText(",")
tokenField.typeText("beta")
tokenField.typeText(" ")

let deleteKey = app.keys["delete"]
deleteKey.tap()
deleteKey.tap()

tokenField.typeText("TestFlight")
tokenField.typeText(",")

let searchButton = app.buttons["Search"]
searchButton.tap()

tablesQuery.buttons["Back to Code"].tap()
app.tables.buttons["Storyboard"].tap()
let tokenField = app.tables.cells.containing(.staticText, identifier:"Storyboard ICTokenField").children(matching: .textField).element
typeTexts(in: tokenField)
app.tables.buttons["Back to Code"].tap()
}

}
4 changes: 1 addition & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ platform :ios, "8.0"
use_frameworks!

workspace "ICInputAccessory"
project "Example"
project "ICInputAccessory"

target "Example" do
pod "ICInputAccessory/KeyboardDismissTextField", path: "./"
pod "ICInputAccessory/TokenField", path: "./"
pod "SwiftLint", "0.19.0"
end
11 changes: 1 addition & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
PODS:
- ICInputAccessory/KeyboardDismissTextField (1.4.0)
- ICInputAccessory/TokenField (1.4.0)
- SwiftLint (0.19.0)

DEPENDENCIES:
- ICInputAccessory/KeyboardDismissTextField (from `./`)
- ICInputAccessory/TokenField (from `./`)
- SwiftLint (= 0.19.0)

EXTERNAL SOURCES:
ICInputAccessory:
:path: ./

SPEC CHECKSUMS:
ICInputAccessory: dace41bea1ed8b0368bf8ffd439a215efa8effd3
SwiftLint: 3537a05b34060e78e7510f04fb7537d738247803

PODFILE CHECKSUM: 400449a0f6672fe2c72f4d91409a3e8abccb8fab
PODFILE CHECKSUM: 0709dcae81d808b2c03cbe4911faac9680768b93

COCOAPODS: 1.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ open class ICKeyboardDismissAccessoryView: UIView {
_button.layer.cornerRadius = 4
_button.layer.shouldRasterize = true
_button.layer.rasterizationScale = UIScreen.main.scale
_button.accessibilityLabel = "Dismiss Keyboard"
return _button
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ open class ICKeyboardDismissTextField: UITextField {

private func setUpAccessoryView() {
if keyboardAccessoryView == nil {
keyboardAccessoryView = ICKeyboardDismissAccessoryView()
// Set an initial frame for the button to appear during UI testing.
let frame = CGRect(x: 0, y: 0, width: 320, height: 60)
keyboardAccessoryView = ICKeyboardDismissAccessoryView(frame: frame)
}
}

Expand Down