Browse Source

Tests + Version bump.

pull/92/head
Abhishek 5 years ago
parent
commit
3084b2a7e8
  1. 4
      Clocker/Clocker/Clocker-Info.plist
  2. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  3. 49
      Clocker/ClockerUITests/PreferencesTest.swift

4
Clocker/Clocker/Clocker-Info.plist

@ -13,11 +13,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.6.14</string>
<string>1.6.15</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>69</string>
<string>70</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>

2
Clocker/ClockerUITests/AboutUsTests.swift

@ -32,7 +32,7 @@ class AboutUsTests: XCTestCase {
tapAboutTab()
let expectedVersion = "Clocker 1.6.13 (68)"
let expectedVersion = "Clocker 1.6.15 (70)"
guard let presentVersion = app.windows["Clocker"].staticTexts["ClockerVersion"].value as? String else {
XCTFail("Present version not present")
return

49
Clocker/ClockerUITests/PreferencesTest.swift

@ -53,7 +53,7 @@ class PreferencesTest: XCTestCase {
deleteAPlace(place: "UTC", for: app)
}
func testSortingByTimezoneDifference() {
func testSortingCitiesByTimezoneDifference() {
app.tapMenubarIcon()
app.tables["mainTableView"].typeKey(",", modifierFlags: .command)
@ -95,10 +95,9 @@ class PreferencesTest: XCTestCase {
addAPlace(place: "Mumbai", to: app)
}
func testSortingByTimezoneName() {
func testSortingCitiesByTimezoneName() {
app.tapMenubarIcon()
app.tables["mainTableView"].typeKey(",", modifierFlags: .command)
// app.windows["Clocker"].checkBoxes["SortButton"].click()
XCTAssertTrue(app.windows["Clocker"].checkBoxes["Sort by Time Difference"].exists)
XCTAssertTrue(app.windows["Clocker"].checkBoxes["Sort by Label"].exists)
@ -138,7 +137,7 @@ class PreferencesTest: XCTestCase {
XCTAssertFalse(app.windows["Clocker"].checkBoxes["Sort by Name"].exists)
}
func testSortingByCustomLabel() {
func testSortingCitiesByCustomLabel() {
app.tapMenubarIcon()
app.tables["mainTableView"].typeKey(",", modifierFlags: .command)
@ -180,6 +179,48 @@ class PreferencesTest: XCTestCase {
deleteAPlace(place: "Portland", for: app, shouldSleep: false)
}
func testSortingTimezonesByCustomLabel() {
app.tapMenubarIcon()
app.tables["mainTableView"].typeKey(",", modifierFlags: .command)
addAPlace(place: "Europe/Lisbon", to: app)
addAPlace(place: "Asia/Kolkata", to: app)
addAPlace(place: "Anywhere on Earth", to: app, shouldSleep: false)
XCTAssertTrue(app.windows["Clocker"].checkBoxes["Sort by Label"].exists)
var expectedLabels: [String] = []
let formattedAddressQuery = app.windows["Clocker"].textFields
for elementIndex in 0 ..< formattedAddressQuery.count {
if let currentValue = formattedAddressQuery.element(boundBy: elementIndex).value as? String, elementIndex % 2 == 1 {
expectedLabels.append(currentValue)
}
}
expectedLabels.sort()
if let value = app.windows["Clocker"].checkBoxes["Sort by Label"].value as? Int, value == 0 {
app.windows["Clocker"].checkBoxes["Sort by Label"].click()
}
var actualLabels: [String] = []
let newFormattedAddressQuery = app.windows["Clocker"].textFields
for elementIndex in 0 ..< newFormattedAddressQuery.count {
if let currentValue = newFormattedAddressQuery.element(boundBy: elementIndex).value as? String, elementIndex % 2 == 1 {
actualLabels.append(currentValue)
}
}
XCTAssertEqual(actualLabels, expectedLabels)
deleteAPlace(place: "Europe/Lisbon", for: app)
deleteAPlace(place: "Asia/Kolkata", for: app)
deleteAPlace(place: "Anywhere on Earth", for: app, shouldSleep: false)
}
func testSearchingWithMisspelledName() {
app.tapMenubarIcon()
app.tables["mainTableView"].typeKey(",", modifierFlags: .command)

Loading…
Cancel
Save