From 1ec14277c5bc2a0e158b14c571d114ee679cfcb4 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 2 Jul 2021 13:53:50 -0500 Subject: [PATCH] Fix tests! --- Clocker/ClockerUITests/AboutUsTests.swift | 2 +- Clocker/ClockerUITests/FloatingWindowTests.swift | 4 ++-- Clocker/ClockerUITests/OnboardingSearchTests.swift | 2 +- Clocker/ClockerUITests/PreferencesTest.swift | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Clocker/ClockerUITests/AboutUsTests.swift b/Clocker/ClockerUITests/AboutUsTests.swift index 3a1bb5c..ae1e172 100644 --- a/Clocker/ClockerUITests/AboutUsTests.swift +++ b/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") diff --git a/Clocker/ClockerUITests/FloatingWindowTests.swift b/Clocker/ClockerUITests/FloatingWindowTests.swift index 53e8b8b..74cb020 100644 --- a/Clocker/ClockerUITests/FloatingWindowTests.swift +++ b/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 diff --git a/Clocker/ClockerUITests/OnboardingSearchTests.swift b/Clocker/ClockerUITests/OnboardingSearchTests.swift index 48566ed..87f2bfd 100644 --- a/Clocker/ClockerUITests/OnboardingSearchTests.swift +++ b/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 diff --git a/Clocker/ClockerUITests/PreferencesTest.swift b/Clocker/ClockerUITests/PreferencesTest.swift index 5c0f1f0..177d78a 100644 --- a/Clocker/ClockerUITests/PreferencesTest.swift +++ b/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)