Browse Source

Fix tests!

pull/101/head
Abhishek 4 years ago
parent
commit
1ec14277c5
  1. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  2. 4
      Clocker/ClockerUITests/FloatingWindowTests.swift
  3. 2
      Clocker/ClockerUITests/OnboardingSearchTests.swift
  4. 8
      Clocker/ClockerUITests/PreferencesTest.swift

2
Clocker/ClockerUITests/AboutUsTests.swift

@ -33,7 +33,7 @@ class AboutUsTests: XCTestCase {
tapAboutTab()
let appDisplayName = "CFBundleDisplayName".localizedString()
let expectedVersion = "\(appDisplayName) 21.02.03 (92)"
let expectedVersion = "\(appDisplayName) 21.07.01 (93)"
guard let presentVersion = app.windows["Clocker"].staticTexts["ClockerVersion"].value as? String else {
XCTFail("Present version not present")

4
Clocker/ClockerUITests/FloatingWindowTests.swift

@ -112,9 +112,9 @@ class FloatingWindowTests: XCTestCase {
miscTab.click()
if floatingSlider {
app.radioGroups["FutureSlider"].radioButtons["No"].click()
app.radioGroups["FutureSlider"].radioButtons["Hide"].click()
} else {
app.radioGroups["FutureSlider"].radioButtons["Yes"].click()
app.radioGroups["FutureSlider"].radioButtons["Legacy"].click()
}
let newFloatingSliderExists = app.sliders["FloatingSlider"].exists

2
Clocker/ClockerUITests/OnboardingSearchTests.swift

@ -79,7 +79,7 @@ class OnboardingSearchTests: XCTestCase {
func testMispelledCityNameSearch() throws {
let searchField = app.searchFields["MainSearchField"]
searchField.reset(text: "ajsdkjasdkjhasdkashkjda")
searchField.reset(text: "ajsdkjasdkjhasdkashkjdazasdasdas")
searchField.typeKey(XCUIKeyboardKey.return, modifierFlags: XCUIElement.KeyModifierFlags())
sleep(2) // Wait for the query to return

8
Clocker/ClockerUITests/PreferencesTest.swift

@ -31,7 +31,7 @@ class PreferencesTest: XCTestCase {
return
}
app.windows["Clocker"].tables["TimezoneTableView"].tableRows.firstMatch.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0)).click()
app.windows["Clocker"].tables["TimezoneTableView"].tableRows.firstMatch.click()
XCTAssertTrue(app.checkBoxes["DeleteTimezone"].isEnabled)
}
@ -334,7 +334,7 @@ class PreferencesTest: XCTestCase {
if rowQueryCount > 0 {
// Table Rows aren't hittable in Xcode 12.0 (10/7/20) and so we need to find a closer co-ordinate and perform click()
let currentElement = clockerWindow.tables["TimezoneTableView"].tableRows.firstMatch.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0))
let currentElement = clockerWindow.tables["TimezoneTableView"].tableRows.firstMatch
currentElement.click()
for _ in 0 ..< rowQueryCount {
@ -416,7 +416,7 @@ extension XCTestCase {
return
}
let currentElement = app.windows["Clocker"].tableRows.firstMatch.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0))
let currentElement = app.windows["Clocker"].tableRows.firstMatch
currentElement.click()
while rowQueryCount > 0 {
@ -442,7 +442,7 @@ extension XCTestCase {
}
private func deleteAtRow(_ rowToDelete: XCUIElement, for _: XCUIApplication, shouldSleep: Bool) {
rowToDelete.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0)).click()
rowToDelete.click()
rowToDelete.typeKey(XCUIKeyboardKey.delete, modifierFlags: XCUIElement.KeyModifierFlags())
if shouldSleep {
sleep(2)

Loading…
Cancel
Save