diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..57f021f Binary files /dev/null and b/.DS_Store differ diff --git a/Landmarks.xcodeproj/project.pbxproj b/Landmarks.xcodeproj/project.pbxproj index c2895d7..43f6120 100644 --- a/Landmarks.xcodeproj/project.pbxproj +++ b/Landmarks.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4B1EC8DE2BE267D600F959C1 /* AlertsUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B1EC8DC2BE267D600F959C1 /* AlertsUITests.m */; }; 989490072B0CE475001B6A7A /* LandmarksUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 989490062B0CE475001B6A7A /* LandmarksUITests.m */; }; 98A2611E28B169B900FEE658 /* LandmarksApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A2611D28B169B900FEE658 /* LandmarksApp.swift */; }; 98A2612028B169B900FEE658 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A2611F28B169B900FEE658 /* ContentView.swift */; }; @@ -45,6 +46,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 4B1EC8DC2BE267D600F959C1 /* AlertsUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AlertsUITests.m; sourceTree = ""; }; 989490042B0CE475001B6A7A /* LandmarksUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LandmarksUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 989490062B0CE475001B6A7A /* LandmarksUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LandmarksUITests.m; sourceTree = ""; }; 9894900F2B0CEB2C001B6A7A /* TestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestPlan.xctestplan; sourceTree = ""; }; @@ -96,6 +98,7 @@ 989490052B0CE475001B6A7A /* LandmarksUITests */ = { isa = PBXGroup; children = ( + 4B1EC8DC2BE267D600F959C1 /* AlertsUITests.m */, 989490062B0CE475001B6A7A /* LandmarksUITests.m */, ); path = LandmarksUITests; @@ -269,6 +272,7 @@ }; 98A2611928B169B900FEE658 = { CreatedOnToolsVersion = 13.4.1; + LastSwiftMigration = 1530; }; }; }; @@ -317,6 +321,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 4B1EC8DE2BE267D600F959C1 /* AlertsUITests.m in Sources */, 989490072B0CE475001B6A7A /* LandmarksUITests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -524,6 +529,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"Landmarks/Preview Content\""; @@ -544,6 +550,7 @@ PRODUCT_BUNDLE_IDENTIFIER = pl.leancode.patrol.Landmarks; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -554,6 +561,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"Landmarks/Preview Content\""; diff --git a/Landmarks.xcodeproj/project.xcworkspace/xcuserdata/fylyppo.xcuserdatad/UserInterfaceState.xcuserstate b/Landmarks.xcodeproj/project.xcworkspace/xcuserdata/fylyppo.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..9cd2de9 Binary files /dev/null and b/Landmarks.xcodeproj/project.xcworkspace/xcuserdata/fylyppo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/LandmarksUITests/AlertsUITests.m b/LandmarksUITests/AlertsUITests.m new file mode 100644 index 0000000..769a06e --- /dev/null +++ b/LandmarksUITests/AlertsUITests.m @@ -0,0 +1,33 @@ +#import + +@interface AlertsUITests : XCTestCase + +@end + +@implementation AlertsUITests + +- (void)testExample { + // UI tests must launch the application that they test. + XCUIApplication *app = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.Maps"]; + // Reset the location permission before starting the test case for debugging purposes + [app resetAuthorizationStatusForResource:XCUIProtectedResourceLocation]; + [app launch]; + + // Register a UI Interruption Monitor + id locationDialogMonitor = [self addUIInterruptionMonitorWithDescription:@"Location Permission Alert" handler:^BOOL(XCUIElement * _Nonnull interruptingElement) { + NSString *partialPermissionMessage = @"to use your location?"; + if ([interruptingElement.label containsString:partialPermissionMessage]) { + [interruptingElement.buttons[@"Don’t Allow"] tap]; + return true; + } + return false; + }]; + + // Performing an arbitrary action in the Maps app + [app swipeUp]; + + // Unregister the UI Interruption Monitor + [self removeUIInterruptionMonitor:locationDialogMonitor]; +} + +@end