Skip to content

Commit adca08b

Browse files
committed
Add UI tests for ICTokenField
1 parent dd3a43e commit adca08b

2 files changed

Lines changed: 47 additions & 56 deletions

File tree

Example/Example.xcodeproj/xcshareddata/xcschemes/ICInputAccessoryUITests.xcscheme

Lines changed: 0 additions & 56 deletions
This file was deleted.

Example/ICInputAccessoryUITests/ICInputAccessoryUITests.swift

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,51 @@ class ICInputAccessoryUITests: XCTestCase {
5050
accessory.childrenMatchingType(.Button).element.tap()
5151
}
5252

53+
func testTokenField() {
54+
let app = XCUIApplication()
55+
let tablesQuery = app.tables
56+
let textField = tablesQuery.cells.containingType(.StaticText, identifier:"ICTokenField").childrenMatchingType(.TextField).element
57+
58+
textField.tap()
59+
textField.typeText("Try")
60+
textField.typeText(" ")
61+
textField.typeText("iCook")
62+
textField.typeText(",")
63+
textField.typeText("beta")
64+
textField.typeText(" ")
65+
66+
let deleteKey = app.keys["delete"]
67+
deleteKey.tap()
68+
deleteKey.tap()
69+
70+
textField.typeText("TestFlight")
71+
textField.typeText(",")
72+
73+
let searchButton = app.buttons["Search"]
74+
searchButton.tap()
75+
}
76+
77+
func testCustomizedTokenField() {
78+
let app = XCUIApplication()
79+
app.tables.staticTexts["CustomizedTokenField"].tap()
80+
81+
let tokenField = app.navigationBars["Example.CustomizedTokenView"].scrollViews.childrenMatchingType(.TextField).element
82+
tokenField.typeText("Try")
83+
tokenField.typeText(" ")
84+
tokenField.typeText("iCook")
85+
tokenField.typeText(",")
86+
tokenField.typeText("beta")
87+
tokenField.typeText(" ")
88+
89+
let deleteKey = app.keys["delete"]
90+
deleteKey.tap()
91+
deleteKey.tap()
92+
93+
tokenField.typeText("TestFlight")
94+
tokenField.typeText(",")
95+
96+
let searchButton = app.buttons["Search"]
97+
searchButton.tap()
98+
}
99+
53100
}

0 commit comments

Comments
 (0)