Browse Source

Fixing tests!

pull/92/head
Abhishek 5 years ago
parent
commit
40f3695456
  1. 13
      Clocker/ClockerUITests/FloatingWindowTests.swift
  2. 1
      Clocker/Panel/UI/TimezoneDataSource.swift

13
Clocker/ClockerUITests/FloatingWindowTests.swift

@ -4,7 +4,7 @@ import XCTest
extension String {
func localizedString() -> String {
let bundle = Bundle(for: AboutUsTests.self)
let bundle = Bundle(for: FloatingWindowTests.self)
return NSLocalizedString(self, bundle: bundle, comment: "")
}
}
@ -111,6 +111,10 @@ class FloatingWindowTests: XCTestCase {
let appearanceTab = app.toolbars.buttons.element(boundBy: 1)
appearanceTab.click()
// Select Misc tab
let miscTab = app.tabs.element(boundBy: 1)
miscTab.click()
if floatingSlider {
app.radioGroups["FutureSlider"].radioButtons["No"].click()
} else {
@ -141,6 +145,10 @@ class FloatingWindowTests: XCTestCase {
let appearanceTab = app.toolbars.buttons.element(boundBy: 1)
appearanceTab.click()
// Select Misc tab
let miscTab = app.tabs.element(boundBy: 1)
miscTab.click()
XCTAssertTrue(app.staticTexts["InformationLabel"].exists)
let generalTab = app.toolbars.buttons.element(boundBy: 0)
@ -153,6 +161,7 @@ class FloatingWindowTests: XCTestCase {
XCTAssertFalse(app.staticTexts["InformationLabel"].exists)
}
/// Make sure to ensure supplementary/relative date label is turned on!
func testMovingSlider() {
if app.buttons["Pin"].exists {
app.buttons["Pin"].click()
@ -161,7 +170,7 @@ class FloatingWindowTests: XCTestCase {
let floatingSlider = app.sliders["FloatingSlider"].exists
if floatingSlider {
let tomorrowPredicate = NSPredicate(format: "placeholderValue like %@", "Tomorrow")
let tomorrowPredicate = NSPredicate(format: "identifier like %@", "RelativeDate")
let tomorrow = app.tables.tableRows.staticTexts.matching(tomorrowPredicate)
var previousValues: [String] = []

1
Clocker/Panel/UI/TimezoneDataSource.swift

@ -62,6 +62,7 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate {
cellView.noteLabel.toolTip = currentModel.note ?? CLEmptyString
cellView.currentLocationIndicator.isHidden = !currentModel.isSystemTimezone
cellView.time.setAccessibilityIdentifier("ActualTime")
cellView.relativeDate.setAccessibilityIdentifier("RelativeDate")
cellView.layout(with: currentModel)
cellView.setAccessibilityIdentifier(currentModel.formattedTimezoneLabel())

Loading…
Cancel
Save