Browse Source

Fix tests!

pull/92/head
Abhishek 4 years ago
parent
commit
eb8e005830
  1. 4
      Clocker/Clocker.xcodeproj/project.pbxproj
  2. 18
      Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme
  3. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  4. 11
      Clocker/ClockerUITests/ClockerUITests.m
  5. 7
      Clocker/CoreLoggerKit/Tests/CoreLoggerKitTests/CoreLoggerKitTests.swift
  6. 16
      Clocker/Onboarding/Onboarding.storyboard
  7. 1
      Clocker/Preferences/Appearance/AppearanceViewController.swift

4
Clocker/Clocker.xcodeproj/project.pbxproj

@ -227,7 +227,6 @@
3508CCA9259A0027000E3530 /* StatusContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusContainerView.swift; sourceTree = "<group>"; }; 3508CCA9259A0027000E3530 /* StatusContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusContainerView.swift; sourceTree = "<group>"; };
352AF497232E07B400D96FA7 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 352AF497232E07B400D96FA7 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/InfoPlist.strings; sourceTree = "<group>"; };
352AF499232E07B400D96FA7 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/Localizable.strings; sourceTree = "<group>"; }; 352AF499232E07B400D96FA7 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/Localizable.strings; sourceTree = "<group>"; };
354BB0842574810500097121 /* Keys.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Keys.plist; path = ../Internal/Keys.plist; sourceTree = "<group>"; };
3569A44E25441F320087E254 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; }; 3569A44E25441F320087E254 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
357391852507277500D30819 /* HourMarkerViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HourMarkerViewItem.swift; sourceTree = "<group>"; }; 357391852507277500D30819 /* HourMarkerViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HourMarkerViewItem.swift; sourceTree = "<group>"; };
357391862507277500D30819 /* HourMarkerViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HourMarkerViewItem.xib; sourceTree = "<group>"; }; 357391862507277500D30819 /* HourMarkerViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HourMarkerViewItem.xib; sourceTree = "<group>"; };
@ -235,6 +234,7 @@
35B2FEB1259A1649005DA84D /* StartupKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = StartupKit; sourceTree = "<group>"; }; 35B2FEB1259A1649005DA84D /* StartupKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = StartupKit; sourceTree = "<group>"; };
35B2FED4259A2244005DA84D /* CoreLoggerKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CoreLoggerKit; sourceTree = "<group>"; }; 35B2FED4259A2244005DA84D /* CoreLoggerKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CoreLoggerKit; sourceTree = "<group>"; };
35B2FEE4259A2C25005DA84D /* CoreModelKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CoreModelKit; sourceTree = "<group>"; }; 35B2FEE4259A2C25005DA84D /* CoreModelKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CoreModelKit; sourceTree = "<group>"; };
35B2FF02259A3F69005DA84D /* Keys.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Keys.plist; path = ../Internal/Keys.plist; sourceTree = "<group>"; };
35C11E2024873A550031F18C /* VersionUpdateHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionUpdateHandler.swift; sourceTree = "<group>"; }; 35C11E2024873A550031F18C /* VersionUpdateHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionUpdateHandler.swift; sourceTree = "<group>"; };
35C36EE822595F13002FA5C6 /* OnboardingPermissionsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingPermissionsViewController.swift; sourceTree = "<group>"; }; 35C36EE822595F13002FA5C6 /* OnboardingPermissionsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingPermissionsViewController.swift; sourceTree = "<group>"; };
35C36EE922595F13002FA5C6 /* OnboardingWelcomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingWelcomeViewController.swift; sourceTree = "<group>"; }; 35C36EE922595F13002FA5C6 /* OnboardingWelcomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingWelcomeViewController.swift; sourceTree = "<group>"; };
@ -818,10 +818,10 @@
DD4F7BF913C30F9F00825C6E = { DD4F7BF913C30F9F00825C6E = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
35B2FF02259A3F69005DA84D /* Keys.plist */,
35B2FEE4259A2C25005DA84D /* CoreModelKit */, 35B2FEE4259A2C25005DA84D /* CoreModelKit */,
35B2FED4259A2244005DA84D /* CoreLoggerKit */, 35B2FED4259A2244005DA84D /* CoreLoggerKit */,
35B2FEB1259A1649005DA84D /* StartupKit */, 35B2FEB1259A1649005DA84D /* StartupKit */,
354BB0842574810500097121 /* Keys.plist */,
35C36F9B2259EC97002FA5C6 /* Events and Reminders */, 35C36F9B2259EC97002FA5C6 /* Events and Reminders */,
35C36F382259D80C002FA5C6 /* Overall App */, 35C36F382259D80C002FA5C6 /* Overall App */,
35C36F242259D64D002FA5C6 /* Panel */, 35C36F242259D64D002FA5C6 /* Panel */,

18
Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme

@ -39,7 +39,9 @@
</MacroExpansion> </MacroExpansion>
<Testables> <Testables>
<TestableReference <TestableReference
skipped = "YES"> skipped = "YES"
parallelizable = "YES"
testExecutionOrdering = "random">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "C2BFE3E22049F82300825BE5" BlueprintIdentifier = "C2BFE3E22049F82300825BE5"
@ -49,7 +51,9 @@
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
<TestableReference <TestableReference
skipped = "NO"> skipped = "NO"
parallelizable = "YES"
testExecutionOrdering = "random">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "C20839C621515C1E00C86589" BlueprintIdentifier = "C20839C621515C1E00C86589"
@ -58,6 +62,16 @@
ReferencedContainer = "container:Clocker.xcodeproj"> ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CoreModelKitTests"
BuildableName = "CoreModelKitTests"
BlueprintName = "CoreModelKitTests"
ReferencedContainer = "container:CoreModelKit">
</BuildableReference>
</TestableReference>
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction

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) 20.10.03 (83)" let expectedVersion = "\(appDisplayName) 20.10.03 (86)"
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")

11
Clocker/ClockerUITests/ClockerUITests.m

@ -97,11 +97,12 @@
XCUIElement *appearance = [[self.app.toolbars buttons] elementBoundByIndex: 1]; XCUIElement *appearance = [[self.app.toolbars buttons] elementBoundByIndex: 1];
[appearance click]; [appearance click];
XCUIElement *timeFormat = self.app.radioButtons[@"12-hour clock"]; XCUIElement *timeFormat = [self.app.popUpButtons[@"TimeFormatPopover"] firstMatch];
[timeFormat click]; [timeFormat click]; // Open Time Format Popover
XCUIElementQuery *const query = [[[timeFormat childrenMatchingType:XCUIElementTypeMenu] firstMatch] childrenMatchingType:0];
[[query elementBoundByIndex:0] click]; // 0 is 12-Hour
XCUIElementQuery *mainTableView = [[self.app.tables[@"mainTableView"] cells] staticTexts]; XCUIElementQuery *mainTableView = [[self.app.tables[@"mainTableView"] cells] staticTexts];
NSPredicate *timeCells = [NSPredicate predicateWithFormat:@"identifier like 'ActualTime'"]; NSPredicate *timeCells = [NSPredicate predicateWithFormat:@"identifier like 'ActualTime'"];
XCUIElementQuery *elements = [mainTableView matchingPredicate:timeCells]; XCUIElementQuery *elements = [mainTableView matchingPredicate:timeCells];
@ -121,8 +122,10 @@
XCUIElement *appearance = [[self.app.toolbars buttons] elementBoundByIndex: 1]; XCUIElement *appearance = [[self.app.toolbars buttons] elementBoundByIndex: 1];
[appearance click]; [appearance click];
XCUIElement *timeFormat = self.app.radioButtons[@"24-hour clock"]; XCUIElement *timeFormat = self.app.popUpButtons[@"TimeFormatPopover"];
[timeFormat click]; [timeFormat click];
XCUIElementQuery *const query = [[[timeFormat childrenMatchingType:XCUIElementTypeMenu] firstMatch] childrenMatchingType:0];
[[query elementBoundByIndex:1] click]; // 1 is 24-Hour
XCUIElementQuery *mainTableView = [[self.app.tables[@"mainTableView"] cells] staticTexts]; XCUIElementQuery *mainTableView = [[self.app.tables[@"mainTableView"] cells] staticTexts];

7
Clocker/CoreLoggerKit/Tests/CoreLoggerKitTests/CoreLoggerKitTests.swift

@ -2,13 +2,6 @@
import XCTest import XCTest
final class CoreLoggerKitTests: XCTestCase { final class CoreLoggerKitTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(CoreLoggerKit().text, "Hello, World!")
}
static var allTests = [ static var allTests = [
("testExample", testExample), ("testExample", testExample),
] ]

16
Clocker/Onboarding/Onboarding.storyboard

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="fde-UX-327"> <document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="fde-UX-327">
<dependencies> <dependencies>
<deployment identifier="macosx"/> <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17506"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
@ -613,7 +613,7 @@ DQ
</viewController> </viewController>
<customObject id="VtX-cF-vU0" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> <customObject id="VtX-cF-vU0" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="1984" y="749.5"/> <point key="canvasLocation" x="1983.5" y="749.5"/>
</scene> </scene>
<!--Final Onboarding View Controller--> <!--Final Onboarding View Controller-->
<scene sceneID="5L4-Km-YMW"> <scene sceneID="5L4-Km-YMW">
@ -648,11 +648,11 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nbC-4o-Xjf"> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nbC-4o-Xjf">
<rect key="frame" x="122" y="245" width="294" height="24"/> <rect key="frame" x="122" y="246" width="294" height="23"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="left" imageScaling="proportionallyDown" image="Dark Menubar" id="cZ2-x0-bJ2"/> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="left" imageScaling="proportionallyDown" image="Dark Menubar" id="cZ2-x0-bJ2"/>
</imageView> </imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="kMo-BE-OAn"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="kMo-BE-OAn">
<rect key="frame" x="120" y="189" width="298" height="16"/> <rect key="frame" x="120" y="190" width="298" height="16"/>
<textFieldCell key="cell" selectable="YES" title="Multiline Label" id="M4F-nv-Eyo"> <textFieldCell key="cell" selectable="YES" title="Multiline Label" id="M4F-nv-Eyo">
<font key="font" size="12" name="Avenir-Book"/> <font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -660,7 +660,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6WD-GP-iz1"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6WD-GP-iz1">
<rect key="frame" x="122" y="139" width="288" height="22"/> <rect key="frame" x="122" y="140" width="288" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="22" id="OvB-hh-3zl"/> <constraint firstAttribute="height" constant="22" id="OvB-hh-3zl"/>
</constraints> </constraints>
@ -671,7 +671,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qLP-tx-m41" customClass="UnderlinedButton" customModule="Clocker" customModuleProvider="target"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qLP-tx-m41" customClass="UnderlinedButton" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="117" y="102" width="293" height="14"/> <rect key="frame" x="117" y="103" width="293" height="14"/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="o87-us-e82"> <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="o87-us-e82">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="13" name="Avenir-Book"/> <font key="font" size="13" name="Avenir-Book"/>
@ -718,6 +718,6 @@ DQ
</scenes> </scenes>
<resources> <resources>
<image name="ClockerIcon-512" width="1024" height="1024"/> <image name="ClockerIcon-512" width="1024" height="1024"/>
<image name="Dark Menubar" width="276" height="24"/> <image name="Dark Menubar" width="235" height="23"/>
</resources> </resources>
</document> </document>

1
Clocker/Preferences/Appearance/AppearanceViewController.swift

@ -47,6 +47,7 @@ class AppearanceViewController: ParentViewController {
timeFormat.item(at: 8)?.isEnabled = false timeFormat.item(at: 8)?.isEnabled = false
timeFormat.autoenablesItems = false timeFormat.autoenablesItems = false
timeFormat.selectItem(at: chosenFormat) timeFormat.selectItem(at: chosenFormat)
timeFormat.setAccessibilityIdentifier("TimeFormatPopover")
informationLabel.setAccessibilityIdentifier("InformationLabel") informationLabel.setAccessibilityIdentifier("InformationLabel")

Loading…
Cancel
Save