From 8ea6d777fa8eaa3659e0df5320f703ac840b0ea4 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sun, 11 Oct 2020 14:11:05 -0500 Subject: [PATCH] Test fixes. --- .../ClockerUITests/FloatingWindowTests.swift | 24 +++++++++---------- Clocker/ClockerUITests/PreferencesTest.swift | 8 +++++-- Clocker/Panel/ParentPanelController.swift | 8 +++---- .../AppFeedbackWindowController.swift | 2 +- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Clocker/ClockerUITests/FloatingWindowTests.swift b/Clocker/ClockerUITests/FloatingWindowTests.swift index d1c1355..c156e81 100644 --- a/Clocker/ClockerUITests/FloatingWindowTests.swift +++ b/Clocker/ClockerUITests/FloatingWindowTests.swift @@ -23,6 +23,18 @@ class FloatingWindowTests: XCTestCase { app.tapMenubarIcon() app.buttons["Pin"].click() } + + addUIInterruptionMonitor(withDescription: "Reminders Access") { (alert) -> Bool in + print("Interruption Handler called") + print(alert) + let alertButton = alert.buttons["OK"] + if alertButton.exists { + print("Okay button found") + alertButton.tap() + return true + } + return false + } } override func tearDown() { @@ -83,18 +95,6 @@ class FloatingWindowTests: XCTestCase { let remindersCheckbox = app.checkBoxes["ReminderCheckbox"] remindersCheckbox.click() - addUIInterruptionMonitor(withDescription: "Reminders Access") { (alert) -> Bool in - print("Interruption Handler called") - print(alert) - let alertButton = alert.buttons["OK"] - if alertButton.exists { - print("Okay button found") - alertButton.tap() - return true - } - return false - } - app.buttons["SaveButton"].click() app.tapMenubarIcon() diff --git a/Clocker/ClockerUITests/PreferencesTest.swift b/Clocker/ClockerUITests/PreferencesTest.swift index dc716e9..a0b052a 100644 --- a/Clocker/ClockerUITests/PreferencesTest.swift +++ b/Clocker/ClockerUITests/PreferencesTest.swift @@ -382,7 +382,9 @@ extension XCTestCase { } let searchField = app.searchFields["AvailableSearchField"] - searchField.reset(text: place) + if searchField.isHittable { + searchField.reset(text: place) + } let results = app.tables["AvailableTimezoneTableView"].cells.staticTexts.matching(matchPredicate) @@ -400,7 +402,9 @@ extension XCTestCase { results.firstMatch.click() } - app.buttons["AddAvailableTimezone"].click() + if app.buttons["AddAvailableTimezone"].exists { + app.buttons["AddAvailableTimezone"].click() + } if shouldSleep { sleep(2) diff --git a/Clocker/Panel/ParentPanelController.swift b/Clocker/Panel/ParentPanelController.swift index d0e7f9d..82d4709 100644 --- a/Clocker/Panel/ParentPanelController.swift +++ b/Clocker/Panel/ParentPanelController.swift @@ -167,11 +167,9 @@ class ParentPanelController: NSWindowController { name: NSNotification.Name.NSSystemTimeZoneDidChange, object: nil) - #if DEBUG -// if #available(OSX 11.0, *) { -// mainTableView.style = .fullWidth -// } - #endif + if #available(OSX 11.0, *) { + mainTableView.style = .fullWidth + } if modernSlider != nil { modernSlider.enclosingScrollView?.scrollerInsets = NSEdgeInsets(top: 0, left: 0, bottom: 100, right: 0) diff --git a/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift b/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift index 854db79..93b7c5c 100644 --- a/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift +++ b/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift @@ -213,7 +213,7 @@ class AppFeedbackWindowController: NSWindowController { contactBox.title = "Contact Information (Optional)".localized() accessoryInfo.stringValue = "Contact fields are optional! Your contact information will let us contact you in case we need more information or can help!".localized() - let range = NSRange(location: 9, length: 15) + let range = NSRange(location: 9, length: 16) quickCommentsLabel.title = "Tweet to @Clocker_Support if you have a quick comment!" setUnderline(for: quickCommentsLabel, range: range)