Browse Source

Merge branch 'master' of https://github.com/n0shake/Clocker

pull/101/head
Abhishek 4 years ago
parent
commit
83c76d3661
  1. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  2. 4
      Clocker/ClockerUITests/FloatingWindowTests.swift
  3. 2
      Clocker/ClockerUITests/OnboardingSearchTests.swift
  4. 8
      Clocker/ClockerUITests/PreferencesTest.swift
  5. 6
      Clocker/Panel/ParentPanelController.swift

2
Clocker/ClockerUITests/AboutUsTests.swift

@ -33,7 +33,7 @@ class AboutUsTests: XCTestCase {
tapAboutTab() tapAboutTab()
let appDisplayName = "CFBundleDisplayName".localizedString() 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 { guard let presentVersion = app.windows["Clocker"].staticTexts["ClockerVersion"].value as? String else {
XCTFail("Present version not present") XCTFail("Present version not present")

4
Clocker/ClockerUITests/FloatingWindowTests.swift

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

2
Clocker/ClockerUITests/OnboardingSearchTests.swift

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

8
Clocker/ClockerUITests/PreferencesTest.swift

@ -31,7 +31,7 @@ class PreferencesTest: XCTestCase {
return 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) XCTAssertTrue(app.checkBoxes["DeleteTimezone"].isEnabled)
} }
@ -334,7 +334,7 @@ class PreferencesTest: XCTestCase {
if rowQueryCount > 0 { 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() // 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() currentElement.click()
for _ in 0 ..< rowQueryCount { for _ in 0 ..< rowQueryCount {
@ -416,7 +416,7 @@ extension XCTestCase {
return return
} }
let currentElement = app.windows["Clocker"].tableRows.firstMatch.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0)) let currentElement = app.windows["Clocker"].tableRows.firstMatch
currentElement.click() currentElement.click()
while rowQueryCount > 0 { while rowQueryCount > 0 {
@ -442,7 +442,7 @@ extension XCTestCase {
} }
private func deleteAtRow(_ rowToDelete: XCUIElement, for _: XCUIApplication, shouldSleep: Bool) { 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()) rowToDelete.typeKey(XCUIKeyboardKey.delete, modifierFlags: XCUIElement.KeyModifierFlags())
if shouldSleep { if shouldSleep {
sleep(2) sleep(2)

6
Clocker/Panel/ParentPanelController.swift

@ -701,11 +701,9 @@ class ParentPanelController: NSWindowController {
let eventCenter = EventCenter.sharedCenter() let eventCenter = EventCenter.sharedCenter()
let now = Date() let now = Date()
if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false {
guard let upcomingEvent = eventCenter.nextOccuring(events), let meetingLink = upcomingEvent.meetingURL else { if let upcomingEvent = eventCenter.nextOccuring(events), let meetingLink = upcomingEvent.meetingURL {
return NSWorkspace.shared.open(meetingLink)
} }
NSWorkspace.shared.open(meetingLink)
return
} }
if self.stackView.arrangedSubviews.contains(self.upcomingEventView!), self.upcomingEventView?.isHidden == false { if self.stackView.arrangedSubviews.contains(self.upcomingEventView!), self.upcomingEventView?.isHidden == false {

Loading…
Cancel
Save