Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions Landmarks.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -45,6 +46,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
4B1EC8DC2BE267D600F959C1 /* AlertsUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AlertsUITests.m; sourceTree = "<group>"; };
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 = "<group>"; };
9894900F2B0CEB2C001B6A7A /* TestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestPlan.xctestplan; sourceTree = "<group>"; };
Expand Down Expand Up @@ -96,6 +98,7 @@
989490052B0CE475001B6A7A /* LandmarksUITests */ = {
isa = PBXGroup;
children = (
4B1EC8DC2BE267D600F959C1 /* AlertsUITests.m */,
989490062B0CE475001B6A7A /* LandmarksUITests.m */,
);
path = LandmarksUITests;
Expand Down Expand Up @@ -269,6 +272,7 @@
};
98A2611928B169B900FEE658 = {
CreatedOnToolsVersion = 13.4.1;
LastSwiftMigration = 1530;
};
};
};
Expand Down Expand Up @@ -317,6 +321,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4B1EC8DE2BE267D600F959C1 /* AlertsUITests.m in Sources */,
989490072B0CE475001B6A7A /* LandmarksUITests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -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\"";
Expand All @@ -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";
};
Expand All @@ -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\"";
Expand Down
Binary file not shown.
33 changes: 33 additions & 0 deletions LandmarksUITests/AlertsUITests.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#import <XCTest/XCTest.h>

@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<NSObject> 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