From 0468d8300e2abded2c77959a3a327ec29596e081 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 19 Apr 2022 13:20:36 -0700 Subject: [PATCH 01/36] Set up example app for UI automation testing --- .github/workflows/tests.yml | 31 ++ .../project.pbxproj | 510 ++++++++++++++++++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 ++++ .../Assets.xcassets/Contents.json | 6 + .../ContentView.swift | 32 ++ .../GoogleSignInSwiftButtonExampleApp.swift | 26 + .../Preview Assets.xcassets/Contents.json | 6 + ...oogleSignInSwiftButtonExampleUITests.swift | 37 ++ .../Tests/Functional/TestApp/README.md | 18 + .../xcschemes/DaysUntilBirthday(iOS).xcscheme | 78 +++ .../DaysUntilBirthday(macOS).xcscheme | 78 +++ 12 files changed, 931 insertions(+) create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift create mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/README.md create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(macOS).xcscheme diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 72b1c469..d156726a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -65,3 +65,34 @@ jobs: -sdk ${{ matrix.sdk }} \ -destination ${{ matrix.destination }} \ test-without-building + + swift-button-functional-test: + runs-on: macOS-latest + strategy: + matrix: + sdk: ['macosx', 'iphonesimulator'] + include: + - sdk: 'macosx' + destination: '"platform=OS X,arch=x86_64"' + - sdk: 'iphonesimulator' + destination: '"platform=iOS Simulator,name=iPhone 11"' + defaults: + run: + working-directory: GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build test target for Google Sign-in button for Swift + run: | + xcodebuild \ + build-for-testing \ + -scheme GoogleSignInSwiftButtonExample \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 11' + - name: Run test target for Google Sign-in button for Swift + run: | + xcodebuild \ + test-without-building \ + -scheme GoogleSignInSwiftButtonExample \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 11' diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj new file mode 100644 index 00000000..3cd0a835 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj @@ -0,0 +1,510 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 7311B788280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7311B787280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift */; }; + 7311B78A280F39F6002D0D8B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7311B789280F39F6002D0D8B /* ContentView.swift */; }; + 7311B78C280F39F7002D0D8B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7311B78B280F39F7002D0D8B /* Assets.xcassets */; }; + 7311B78F280F39F7002D0D8B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7311B78E280F39F7002D0D8B /* Preview Assets.xcassets */; }; + 7311B7A3280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7311B7A2280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift */; }; + 732F01DA280F42A200D1ACD1 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 732F01D9280F42A200D1ACD1 /* GoogleSignIn */; }; + 732F01DC280F42A200D1ACD1 /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 732F01DB280F42A200D1ACD1 /* GoogleSignInSwift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 7311B79F280F39F7002D0D8B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7311B77C280F39F6002D0D8B /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7311B783280F39F6002D0D8B; + remoteInfo = GoogleSignInSwiftButtonExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 7311B784280F39F6002D0D8B /* GoogleSignInSwiftButtonExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GoogleSignInSwiftButtonExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7311B787280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleSignInSwiftButtonExampleApp.swift; sourceTree = ""; }; + 7311B789280F39F6002D0D8B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 7311B78B280F39F7002D0D8B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 7311B78E280F39F7002D0D8B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 7311B79E280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GoogleSignInSwiftButtonExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 7311B7A2280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleSignInSwiftButtonExampleUITests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7311B781280F39F6002D0D8B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 732F01DA280F42A200D1ACD1 /* GoogleSignIn in Frameworks */, + 732F01DC280F42A200D1ACD1 /* GoogleSignInSwift in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7311B79B280F39F7002D0D8B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7311B77B280F39F6002D0D8B = { + isa = PBXGroup; + children = ( + 7311B786280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */, + 7311B7A1280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */, + 7311B785280F39F6002D0D8B /* Products */, + ); + sourceTree = ""; + }; + 7311B785280F39F6002D0D8B /* Products */ = { + isa = PBXGroup; + children = ( + 7311B784280F39F6002D0D8B /* GoogleSignInSwiftButtonExample.app */, + 7311B79E280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 7311B786280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */ = { + isa = PBXGroup; + children = ( + 7311B787280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift */, + 7311B789280F39F6002D0D8B /* ContentView.swift */, + 7311B78B280F39F7002D0D8B /* Assets.xcassets */, + 7311B78D280F39F7002D0D8B /* Preview Content */, + ); + path = GoogleSignInSwiftButtonExample; + sourceTree = ""; + }; + 7311B78D280F39F7002D0D8B /* Preview Content */ = { + isa = PBXGroup; + children = ( + 7311B78E280F39F7002D0D8B /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 7311B7A1280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */ = { + isa = PBXGroup; + children = ( + 7311B7A2280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift */, + ); + path = GoogleSignInSwiftButtonExampleUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7311B783280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7311B7A8280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExample" */; + buildPhases = ( + 7311B780280F39F6002D0D8B /* Sources */, + 7311B781280F39F6002D0D8B /* Frameworks */, + 7311B782280F39F6002D0D8B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GoogleSignInSwiftButtonExample; + packageProductDependencies = ( + 732F01D9280F42A200D1ACD1 /* GoogleSignIn */, + 732F01DB280F42A200D1ACD1 /* GoogleSignInSwift */, + ); + productName = GoogleSignInSwiftButtonExample; + productReference = 7311B784280F39F6002D0D8B /* GoogleSignInSwiftButtonExample.app */; + productType = "com.apple.product-type.application"; + }; + 7311B79D280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7311B7AE280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExampleUITests" */; + buildPhases = ( + 7311B79A280F39F7002D0D8B /* Sources */, + 7311B79B280F39F7002D0D8B /* Frameworks */, + 7311B79C280F39F7002D0D8B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 7311B7A0280F39F7002D0D8B /* PBXTargetDependency */, + ); + name = GoogleSignInSwiftButtonExampleUITests; + productName = GoogleSignInSwiftButtonExampleUITests; + productReference = 7311B79E280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7311B77C280F39F6002D0D8B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1300; + LastUpgradeCheck = 1300; + TargetAttributes = { + 7311B783280F39F6002D0D8B = { + CreatedOnToolsVersion = 13.0; + }; + 7311B79D280F39F7002D0D8B = { + CreatedOnToolsVersion = 13.0; + TestTargetID = 7311B783280F39F6002D0D8B; + }; + }; + }; + buildConfigurationList = 7311B77F280F39F6002D0D8B /* Build configuration list for PBXProject "GoogleSignInSwiftButtonExample" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 7311B77B280F39F6002D0D8B; + packageReferences = ( + 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */, + ); + productRefGroup = 7311B785280F39F6002D0D8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7311B783280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */, + 7311B79D280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 7311B782280F39F6002D0D8B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7311B78F280F39F7002D0D8B /* Preview Assets.xcassets in Resources */, + 7311B78C280F39F7002D0D8B /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7311B79C280F39F7002D0D8B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7311B780280F39F6002D0D8B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7311B78A280F39F6002D0D8B /* ContentView.swift in Sources */, + 7311B788280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7311B79A280F39F7002D0D8B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7311B7A3280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 7311B7A0280F39F7002D0D8B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7311B783280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */; + targetProxy = 7311B79F280F39F7002D0D8B /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 7311B7A6280F39F7002D0D8B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 7311B7A7280F39F7002D0D8B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 7311B7A9280F39F7002D0D8B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"GoogleSignInSwiftButtonExample/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 7311B7AA280F39F7002D0D8B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"GoogleSignInSwiftButtonExample/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 7311B7AF280F39F7002D0D8B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = GoogleSignInSwiftButtonExample; + }; + name = Debug; + }; + 7311B7B0280F39F7002D0D8B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = GoogleSignInSwiftButtonExample; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7311B77F280F39F6002D0D8B /* Build configuration list for PBXProject "GoogleSignInSwiftButtonExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7311B7A6280F39F7002D0D8B /* Debug */, + 7311B7A7280F39F7002D0D8B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7311B7A8280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7311B7A9280F39F7002D0D8B /* Debug */, + 7311B7AA280F39F7002D0D8B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7311B7AE280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExampleUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7311B7AF280F39F7002D0D8B /* Debug */, + 7311B7B0280F39F7002D0D8B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/google/GoogleSignIn-iOS"; + requirement = { + branch = main; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 732F01D9280F42A200D1ACD1 /* GoogleSignIn */ = { + isa = XCSwiftPackageProductDependency; + package = 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; + productName = GoogleSignIn; + }; + 732F01DB280F42A200D1ACD1 /* GoogleSignInSwift */ = { + isa = XCSwiftPackageProductDependency; + package = 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; + productName = GoogleSignInSwift; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 7311B77C280F39F6002D0D8B /* Project object */; +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift new file mode 100644 index 00000000..512ada44 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift @@ -0,0 +1,32 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import SwiftUI +import GoogleSignInSwift + +struct ContentView: View { + let vm = GoogleSignInButtonViewModel(scheme: .light, style: .standard) + @State private var signInAttempts = 0 + + var body: some View { + Text("Sign In Button Taps: \(signInAttempts)") + .accessibilityIdentifier("SignInButtonTaps") + GoogleSignInButton(viewModel: vm) { + signInAttempts += 1 + } + .accessibilityIdentifier("GoogleSignInButton") + } +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift new file mode 100644 index 00000000..068c6e5b --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift @@ -0,0 +1,26 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import SwiftUI + +@main +struct GoogleSignInSwiftButtonExampleApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift new file mode 100644 index 00000000..50913f95 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift @@ -0,0 +1,37 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import XCTest + +class GoogleSignInSwiftButtonExampleUITests: XCTestCase { + override func setUpWithError() throws { + try super.setUpWithError() + continueAfterFailure = false + } + + func testGoogleSignInSwiftButton() throws { + let app = XCUIApplication() + app.launch() + let signInButton = app.buttons["GoogleSignInButton"] + XCTAssertTrue(signInButton.exists) + signInButton.tap() + + let attemptsText = app.staticTexts["SignInButtonTaps"] + XCTAssertTrue(attemptsText.exists) + XCTAssertEqual(attemptsText.label, "Sign In Button Taps: 1") + } +} + diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/README.md b/GoogleSignInSwift/Tests/Functional/TestApp/README.md new file mode 100644 index 00000000..67a61818 --- /dev/null +++ b/GoogleSignInSwift/Tests/Functional/TestApp/README.md @@ -0,0 +1,18 @@ +This application is in place to help test the SwiftUI Google Sign-in button. +Tests are run via an example application, `GoogleSignInSwiftButtonExample`. +These tests rely on an `XCUIApplication` instance that will launch the app. + +# Usage + +## Testing + +Open `GoogleSignInSwiftButtonExample.xcodeproj` and type "command-u" to +execute the tests. + +## Running the App + +The app isn't very interesting right now; it simply displays an instance of +`GoogleSignInButton` that increments a counter upon tap. +Nonetheless, if you would like to run this app, all you need to do is open +`GoogleSignInSwiftButtonExample.xcodeproj` and hit run. + diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme new file mode 100644 index 00000000..8dfb5e37 --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(macOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(macOS).xcscheme new file mode 100644 index 00000000..e8dc45fe --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(macOS).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f5f7ce76f7b004736efb67b46f7ac7d554559229 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 21 Apr 2022 11:05:05 -0700 Subject: [PATCH 02/36] Add UI test to DaysUntilBirthday sample app --- .../project.pbxproj | 135 +++++++++++++++++- .../DaysUntilBirthdayUITests_iOS_.swift | 38 +++++ .../Shared/Views/SignInView.swift | 1 + 3 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index d0a7ef78..2cb52e89 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 7345AD212703D9C30020AFB1 /* GoogleSignInAuthenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD172703D9C30020AFB1 /* GoogleSignInAuthenticator.swift */; }; 7345AD232703D9C30020AFB1 /* UserProfileImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD192703D9C30020AFB1 /* UserProfileImageLoader.swift */; }; 7345AD242703D9C30020AFB1 /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */; }; + 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */; }; 736F49BA270E05E200580053 /* BirthdayLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49B9270E05E200580053 /* BirthdayLoader.swift */; }; 736F49BC270E102C00580053 /* BirthdayViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49BB270E102C00580053 /* BirthdayViewModel.swift */; }; 739FCC46270E467600C92042 /* BirthdayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC45270E467600C92042 /* BirthdayView.swift */; }; @@ -41,6 +42,16 @@ C1B5D389282AFD3A0068D12B /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C1B5D388282AFD3A0068D12B /* README.md */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 73508ECB2811BD9C00ED7FB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7345ACF72703D9470020AFB1 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7345ACFE2703D9470020AFB1; + remoteInfo = "DaysUntilBirthday(iOS)"; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 7345ACFF2703D9470020AFB1 /* DaysUntilBirthday (iOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DaysUntilBirthday (iOS).app"; sourceTree = BUILT_PRODUCTS_DIR; }; 7345AD022703D9470020AFB1 /* DaysUntilBirthday.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthday.swift; sourceTree = ""; }; @@ -54,6 +65,8 @@ 7345AD172703D9C30020AFB1 /* GoogleSignInAuthenticator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoogleSignInAuthenticator.swift; sourceTree = ""; }; 7345AD192703D9C30020AFB1 /* UserProfileImageLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserProfileImageLoader.swift; sourceTree = ""; }; 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserProfileView.swift; sourceTree = ""; }; + 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DaysUntilBirthdayUITests(iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS_.swift; sourceTree = ""; }; 736F49B9270E05E200580053 /* BirthdayLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayLoader.swift; sourceTree = ""; }; 736F49BB270E102C00580053 /* BirthdayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayViewModel.swift; sourceTree = ""; }; 739FCC45270E467600C92042 /* BirthdayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayView.swift; sourceTree = ""; }; @@ -77,6 +90,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 73508EC22811BD9C00ED7FB7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; FE71737D27ECFAF400910319 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -97,6 +117,7 @@ 7345AD012703D9470020AFB1 /* Shared */, FE7173A927F656AF00910319 /* iOS */, FE71738127ECFAF400910319 /* macOS */, + 73508EC62811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */, 7345AD002703D9470020AFB1 /* Products */, FE71738F27ECFB3300910319 /* Frameworks */, ); @@ -107,6 +128,7 @@ children = ( 7345ACFF2703D9470020AFB1 /* DaysUntilBirthday (iOS).app */, FE71738027ECFAF400910319 /* DaysUntilBirthday (macOS).app */, + 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */, ); name = Products; sourceTree = ""; @@ -138,6 +160,12 @@ C14E3C0C280788C600CF05A9 /* GoogleSignIn-iOS */, ); name = Packages; + 73508EC62811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */ = { + isa = PBXGroup; + children = ( + 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */, + ); + path = "DaysUntilBirthdayUITests(iOS)"; sourceTree = ""; }; FE71738127ECFAF400910319 /* macOS */ = { @@ -238,7 +266,25 @@ productReference = 7345ACFF2703D9470020AFB1 /* DaysUntilBirthday (iOS).app */; productType = "com.apple.product-type.application"; }; - FE71737F27ECFAF400910319 /* DaysUntilBirthday (macOS) */ = { + 73508EC42811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 73508ECF2811BD9C00ED7FB7 /* Build configuration list for PBXNativeTarget "DaysUntilBirthdayUITests(iOS)" */; + buildPhases = ( + 73508EC12811BD9C00ED7FB7 /* Sources */, + 73508EC22811BD9C00ED7FB7 /* Frameworks */, + 73508EC32811BD9C00ED7FB7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 73508ECC2811BD9C00ED7FB7 /* PBXTargetDependency */, + ); + name = "DaysUntilBirthdayUITests(iOS)"; + productName = "DaysUntilBirthdayUITests(iOS)"; + productReference = 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; + FE71737F27ECFAF400910319 /* DaysUntilBirthday(macOS) */ = { isa = PBXNativeTarget; buildConfigurationList = FE71738C27ECFAF600910319 /* Build configuration list for PBXNativeTarget "DaysUntilBirthday (macOS)" */; buildPhases = ( @@ -265,12 +311,16 @@ 7345ACF72703D9470020AFB1 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1310; + LastSwiftUpdateCheck = 1300; LastUpgradeCheck = 1250; TargetAttributes = { 7345ACFE2703D9470020AFB1 = { CreatedOnToolsVersion = 12.5.1; }; + 73508EC42811BD9C00ED7FB7 = { + CreatedOnToolsVersion = 13.0; + TestTargetID = 7345ACFE2703D9470020AFB1; + }; FE71737F27ECFAF400910319 = { CreatedOnToolsVersion = 13.1; }; @@ -294,6 +344,7 @@ targets = ( 7345ACFE2703D9470020AFB1 /* DaysUntilBirthday (iOS) */, FE71737F27ECFAF400910319 /* DaysUntilBirthday (macOS) */, + 73508EC42811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */, ); }; /* End PBXProject section */ @@ -309,6 +360,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 73508EC32811BD9C00ED7FB7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; FE71737E27ECFAF400910319 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -339,6 +397,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 73508EC12811BD9C00ED7FB7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FE71737C27ECFAF400910319 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -360,6 +426,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 73508ECC2811BD9C00ED7FB7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7345ACFE2703D9470020AFB1 /* DaysUntilBirthday(iOS) */; + targetProxy = 73508ECB2811BD9C00ED7FB7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 7345AD0C2703D9480020AFB1 /* Debug */ = { isa = XCBuildConfiguration; @@ -523,6 +597,52 @@ }; name = Release; }; + 73508ECD2811BD9C00ED7FB7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.google.DaysUntilBirthdayUITests-iOS-"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "DaysUntilBirthday(iOS)"; + }; + name = Debug; + }; + 73508ECE2811BD9C00ED7FB7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.google.DaysUntilBirthdayUITests-iOS-"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "DaysUntilBirthday(iOS)"; + }; + name = Release; + }; FE71738D27ECFAF600910319 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -602,7 +722,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - FE71738C27ECFAF600910319 /* Build configuration list for PBXNativeTarget "DaysUntilBirthday (macOS)" */ = { + 73508ECF2811BD9C00ED7FB7 /* Build configuration list for PBXNativeTarget "DaysUntilBirthdayUITests(iOS)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73508ECD2811BD9C00ED7FB7 /* Debug */, + 73508ECE2811BD9C00ED7FB7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FE71738C27ECFAF600910319 /* Build configuration list for PBXNativeTarget "DaysUntilBirthday (macOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( FE71738D27ECFAF600910319 /* Debug */, diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift new file mode 100644 index 00000000..f1ce4b9d --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -0,0 +1,38 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import XCTest + +class DaysUntilBirthdayUITests_iOS_: XCTestCase { + private let signInStaticText = + "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" + private let timeout: TimeInterval = 1 + private let sampleApp = XCUIApplication() + private let springboardApp = XCUIApplication(bundleIdentifier: "com.apple.springboard") + + func testSwiftUIButtonTapStartsFlow() { + sampleApp.launch() + let signInButton = sampleApp.buttons["GoogleSignInButton"] + XCTAssertTrue(signInButton.exists) + signInButton.tap() + + guard springboardApp + .staticTexts[signInStaticText] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to display prompt") + } + } +} diff --git a/Samples/Swift/DaysUntilBirthday/Shared/Views/SignInView.swift b/Samples/Swift/DaysUntilBirthday/Shared/Views/SignInView.swift index 39796794..5eecffcc 100644 --- a/Samples/Swift/DaysUntilBirthday/Shared/Views/SignInView.swift +++ b/Samples/Swift/DaysUntilBirthday/Shared/Views/SignInView.swift @@ -26,6 +26,7 @@ struct SignInView: View { HStack { VStack { GoogleSignInButton(viewModel: vm, action: authViewModel.signIn) + .accessibilityIdentifier("GoogleSignInButton") .accessibility(hint: Text("Sign in with Google button.")) .padding() VStack { From 9e0e46441b35ae1feb2a2b148e2cf13fb87fbae6 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 21 Apr 2022 11:30:50 -0700 Subject: [PATCH 03/36] Delete unused sample app and update workflow --- .github/workflows/tests.yml | 4 +- .../project.pbxproj | 510 ------------------ .../AccentColor.colorset/Contents.json | 11 - .../AppIcon.appiconset/Contents.json | 98 ---- .../Assets.xcassets/Contents.json | 6 - .../ContentView.swift | 32 -- .../GoogleSignInSwiftButtonExampleApp.swift | 26 - .../Preview Assets.xcassets/Contents.json | 6 - ...oogleSignInSwiftButtonExampleUITests.swift | 37 -- .../Tests/Functional/TestApp/README.md | 18 - .../DaysUntilBirthdayUITests_iOS_.swift | 4 +- 11 files changed, 5 insertions(+), 747 deletions(-) delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift delete mode 100644 GoogleSignInSwift/Tests/Functional/TestApp/README.md diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d156726a..27b16d19 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: destination: '"platform=iOS Simulator,name=iPhone 11"' defaults: run: - working-directory: GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample + working-directory: Samples/Swift/DaysUntilBirthday steps: - name: Checkout uses: actions/checkout@v2 @@ -93,6 +93,6 @@ jobs: run: | xcodebuild \ test-without-building \ - -scheme GoogleSignInSwiftButtonExample \ + -scheme DaysUntilBirthday(iOS) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj deleted file mode 100644 index 3cd0a835..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,510 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 55; - objects = { - -/* Begin PBXBuildFile section */ - 7311B788280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7311B787280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift */; }; - 7311B78A280F39F6002D0D8B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7311B789280F39F6002D0D8B /* ContentView.swift */; }; - 7311B78C280F39F7002D0D8B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7311B78B280F39F7002D0D8B /* Assets.xcassets */; }; - 7311B78F280F39F7002D0D8B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7311B78E280F39F7002D0D8B /* Preview Assets.xcassets */; }; - 7311B7A3280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7311B7A2280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift */; }; - 732F01DA280F42A200D1ACD1 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 732F01D9280F42A200D1ACD1 /* GoogleSignIn */; }; - 732F01DC280F42A200D1ACD1 /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 732F01DB280F42A200D1ACD1 /* GoogleSignInSwift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 7311B79F280F39F7002D0D8B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 7311B77C280F39F6002D0D8B /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7311B783280F39F6002D0D8B; - remoteInfo = GoogleSignInSwiftButtonExample; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 7311B784280F39F6002D0D8B /* GoogleSignInSwiftButtonExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GoogleSignInSwiftButtonExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 7311B787280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleSignInSwiftButtonExampleApp.swift; sourceTree = ""; }; - 7311B789280F39F6002D0D8B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 7311B78B280F39F7002D0D8B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 7311B78E280F39F7002D0D8B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - 7311B79E280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GoogleSignInSwiftButtonExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 7311B7A2280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleSignInSwiftButtonExampleUITests.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 7311B781280F39F6002D0D8B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 732F01DA280F42A200D1ACD1 /* GoogleSignIn in Frameworks */, - 732F01DC280F42A200D1ACD1 /* GoogleSignInSwift in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7311B79B280F39F7002D0D8B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 7311B77B280F39F6002D0D8B = { - isa = PBXGroup; - children = ( - 7311B786280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */, - 7311B7A1280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */, - 7311B785280F39F6002D0D8B /* Products */, - ); - sourceTree = ""; - }; - 7311B785280F39F6002D0D8B /* Products */ = { - isa = PBXGroup; - children = ( - 7311B784280F39F6002D0D8B /* GoogleSignInSwiftButtonExample.app */, - 7311B79E280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 7311B786280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */ = { - isa = PBXGroup; - children = ( - 7311B787280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift */, - 7311B789280F39F6002D0D8B /* ContentView.swift */, - 7311B78B280F39F7002D0D8B /* Assets.xcassets */, - 7311B78D280F39F7002D0D8B /* Preview Content */, - ); - path = GoogleSignInSwiftButtonExample; - sourceTree = ""; - }; - 7311B78D280F39F7002D0D8B /* Preview Content */ = { - isa = PBXGroup; - children = ( - 7311B78E280F39F7002D0D8B /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - 7311B7A1280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */ = { - isa = PBXGroup; - children = ( - 7311B7A2280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift */, - ); - path = GoogleSignInSwiftButtonExampleUITests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 7311B783280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7311B7A8280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExample" */; - buildPhases = ( - 7311B780280F39F6002D0D8B /* Sources */, - 7311B781280F39F6002D0D8B /* Frameworks */, - 7311B782280F39F6002D0D8B /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = GoogleSignInSwiftButtonExample; - packageProductDependencies = ( - 732F01D9280F42A200D1ACD1 /* GoogleSignIn */, - 732F01DB280F42A200D1ACD1 /* GoogleSignInSwift */, - ); - productName = GoogleSignInSwiftButtonExample; - productReference = 7311B784280F39F6002D0D8B /* GoogleSignInSwiftButtonExample.app */; - productType = "com.apple.product-type.application"; - }; - 7311B79D280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7311B7AE280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExampleUITests" */; - buildPhases = ( - 7311B79A280F39F7002D0D8B /* Sources */, - 7311B79B280F39F7002D0D8B /* Frameworks */, - 7311B79C280F39F7002D0D8B /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 7311B7A0280F39F7002D0D8B /* PBXTargetDependency */, - ); - name = GoogleSignInSwiftButtonExampleUITests; - productName = GoogleSignInSwiftButtonExampleUITests; - productReference = 7311B79E280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 7311B77C280F39F6002D0D8B /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1300; - LastUpgradeCheck = 1300; - TargetAttributes = { - 7311B783280F39F6002D0D8B = { - CreatedOnToolsVersion = 13.0; - }; - 7311B79D280F39F7002D0D8B = { - CreatedOnToolsVersion = 13.0; - TestTargetID = 7311B783280F39F6002D0D8B; - }; - }; - }; - buildConfigurationList = 7311B77F280F39F6002D0D8B /* Build configuration list for PBXProject "GoogleSignInSwiftButtonExample" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 7311B77B280F39F6002D0D8B; - packageReferences = ( - 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */, - ); - productRefGroup = 7311B785280F39F6002D0D8B /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 7311B783280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */, - 7311B79D280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 7311B782280F39F6002D0D8B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7311B78F280F39F7002D0D8B /* Preview Assets.xcassets in Resources */, - 7311B78C280F39F7002D0D8B /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7311B79C280F39F7002D0D8B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 7311B780280F39F6002D0D8B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7311B78A280F39F6002D0D8B /* ContentView.swift in Sources */, - 7311B788280F39F6002D0D8B /* GoogleSignInSwiftButtonExampleApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7311B79A280F39F7002D0D8B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7311B7A3280F39F7002D0D8B /* GoogleSignInSwiftButtonExampleUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 7311B7A0280F39F7002D0D8B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 7311B783280F39F6002D0D8B /* GoogleSignInSwiftButtonExample */; - targetProxy = 7311B79F280F39F7002D0D8B /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 7311B7A6280F39F7002D0D8B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 7311B7A7280F39F7002D0D8B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 7311B7A9280F39F7002D0D8B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"GoogleSignInSwiftButtonExample/Preview Content\""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 7311B7AA280F39F7002D0D8B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"GoogleSignInSwiftButtonExample/Preview Content\""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 7311B7AF280F39F7002D0D8B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExampleUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = GoogleSignInSwiftButtonExample; - }; - name = Debug; - }; - 7311B7B0280F39F7002D0D8B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.google.GoogleSignInSwiftButtonExampleUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = GoogleSignInSwiftButtonExample; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 7311B77F280F39F6002D0D8B /* Build configuration list for PBXProject "GoogleSignInSwiftButtonExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7311B7A6280F39F7002D0D8B /* Debug */, - 7311B7A7280F39F7002D0D8B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7311B7A8280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7311B7A9280F39F7002D0D8B /* Debug */, - 7311B7AA280F39F7002D0D8B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7311B7AE280F39F7002D0D8B /* Build configuration list for PBXNativeTarget "GoogleSignInSwiftButtonExampleUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7311B7AF280F39F7002D0D8B /* Debug */, - 7311B7B0280F39F7002D0D8B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/google/GoogleSignIn-iOS"; - requirement = { - branch = main; - kind = branch; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - 732F01D9280F42A200D1ACD1 /* GoogleSignIn */ = { - isa = XCSwiftPackageProductDependency; - package = 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; - productName = GoogleSignIn; - }; - 732F01DB280F42A200D1ACD1 /* GoogleSignInSwift */ = { - isa = XCSwiftPackageProductDependency; - package = 732F01D8280F42A200D1ACD1 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; - productName = GoogleSignInSwift; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = 7311B77C280F39F6002D0D8B /* Project object */; -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb878970..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9bb..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift deleted file mode 100644 index 512ada44..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/ContentView.swift +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import SwiftUI -import GoogleSignInSwift - -struct ContentView: View { - let vm = GoogleSignInButtonViewModel(scheme: .light, style: .standard) - @State private var signInAttempts = 0 - - var body: some View { - Text("Sign In Button Taps: \(signInAttempts)") - .accessibilityIdentifier("SignInButtonTaps") - GoogleSignInButton(viewModel: vm) { - signInAttempts += 1 - } - .accessibilityIdentifier("GoogleSignInButton") - } -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift deleted file mode 100644 index 068c6e5b..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleApp.swift +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import SwiftUI - -@main -struct GoogleSignInSwiftButtonExampleApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExample/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift b/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift deleted file mode 100644 index 50913f95..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/GoogleSignInSwiftButtonExample/GoogleSignInSwiftButtonExampleUITests/GoogleSignInSwiftButtonExampleUITests.swift +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import XCTest - -class GoogleSignInSwiftButtonExampleUITests: XCTestCase { - override func setUpWithError() throws { - try super.setUpWithError() - continueAfterFailure = false - } - - func testGoogleSignInSwiftButton() throws { - let app = XCUIApplication() - app.launch() - let signInButton = app.buttons["GoogleSignInButton"] - XCTAssertTrue(signInButton.exists) - signInButton.tap() - - let attemptsText = app.staticTexts["SignInButtonTaps"] - XCTAssertTrue(attemptsText.exists) - XCTAssertEqual(attemptsText.label, "Sign In Button Taps: 1") - } -} - diff --git a/GoogleSignInSwift/Tests/Functional/TestApp/README.md b/GoogleSignInSwift/Tests/Functional/TestApp/README.md deleted file mode 100644 index 67a61818..00000000 --- a/GoogleSignInSwift/Tests/Functional/TestApp/README.md +++ /dev/null @@ -1,18 +0,0 @@ -This application is in place to help test the SwiftUI Google Sign-in button. -Tests are run via an example application, `GoogleSignInSwiftButtonExample`. -These tests rely on an `XCUIApplication` instance that will launch the app. - -# Usage - -## Testing - -Open `GoogleSignInSwiftButtonExample.xcodeproj` and type "command-u" to -execute the tests. - -## Running the App - -The app isn't very interesting right now; it simply displays an instance of -`GoogleSignInButton` that increments a counter upon tap. -Nonetheless, if you would like to run this app, all you need to do is open -`GoogleSignInSwiftButtonExample.xcodeproj` and hit run. - diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index f1ce4b9d..8b0f8e52 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -21,7 +21,9 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" private let timeout: TimeInterval = 1 private let sampleApp = XCUIApplication() - private let springboardApp = XCUIApplication(bundleIdentifier: "com.apple.springboard") + private let springboardApp = XCUIApplication( + bundleIdentifier: "com.apple.springboard" + ) func testSwiftUIButtonTapStartsFlow() { sampleApp.launch() From 297498bb678a4a713607f4145a80eac3ab2e769c Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 21 Apr 2022 11:47:42 -0700 Subject: [PATCH 04/36] Update workflow to use DaysUntilBirthday.xcodeproj --- .github/workflows/tests.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 27b16d19..af77eabe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,14 +68,6 @@ jobs: swift-button-functional-test: runs-on: macOS-latest - strategy: - matrix: - sdk: ['macosx', 'iphonesimulator'] - include: - - sdk: 'macosx' - destination: '"platform=OS X,arch=x86_64"' - - sdk: 'iphonesimulator' - destination: '"platform=iOS Simulator,name=iPhone 11"' defaults: run: working-directory: Samples/Swift/DaysUntilBirthday @@ -85,14 +77,16 @@ jobs: - name: Build test target for Google Sign-in button for Swift run: | xcodebuild \ - build-for-testing \ - -scheme GoogleSignInSwiftButtonExample \ + -project DaysUntilBirthday.xcodeproj \ + test-without-building \ + -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' - name: Run test target for Google Sign-in button for Swift run: | xcodebuild \ + -project DaysUntilBirthday.xcodeproj \ test-without-building \ - -scheme DaysUntilBirthday(iOS) \ + -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' From 0c23a93d2610f483583d2914b9b9b44680e16795 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 21 Apr 2022 12:09:01 -0700 Subject: [PATCH 05/36] Use the correct build command --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index af77eabe..dec98eb0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: run: | xcodebuild \ -project DaysUntilBirthday.xcodeproj \ - test-without-building \ + build-for-testing \ -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' From 9ce227b184997bb1bdcc6573962493d643c844a8 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 21 Apr 2022 12:24:29 -0700 Subject: [PATCH 06/36] Update UI test timeout --- .../DaysUntilBirthdayUITests_iOS_.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index 8b0f8e52..4d06137d 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -19,7 +19,7 @@ import XCTest class DaysUntilBirthdayUITests_iOS_: XCTestCase { private let signInStaticText = "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" - private let timeout: TimeInterval = 1 + private let timeout: TimeInterval = 2 private let sampleApp = XCUIApplication() private let springboardApp = XCUIApplication( bundleIdentifier: "com.apple.springboard" From 31bf98f5170ad567752ff357aa0f35de6aaa7116 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 14:13:30 -0700 Subject: [PATCH 07/36] Add some testing for a test config with secrets --- .gitignore | 1 + .../DaysUntilBirthday/Credentials.xcconfig | 18 ++++++++ .../project.pbxproj | 15 +++++++ .../Credential.swift | 43 +++++++++++++++++++ .../DaysUntilBirthdayUITests_iOS_.swift | 5 +++ 5 files changed, 82 insertions(+) create mode 100644 Samples/Swift/DaysUntilBirthday/Credentials.xcconfig create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift diff --git a/.gitignore b/.gitignore index c3bb99b0..c7c5f2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.xcworkspace/ project.xcworkspace/ xcuserdata/ +Samples/Swift/DaysUntilBirthday/Credentials.xcconfig # CocoaPods Pods/ diff --git a/Samples/Swift/DaysUntilBirthday/Credentials.xcconfig b/Samples/Swift/DaysUntilBirthday/Credentials.xcconfig new file mode 100644 index 00000000..b7101519 --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/Credentials.xcconfig @@ -0,0 +1,18 @@ +// +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +EMAIL_SECRET = secret_fake_email@gmail.com +PASSWORD_SECRET = foobar diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index 2cb52e89..938db3f9 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 7345AD232703D9C30020AFB1 /* UserProfileImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD192703D9C30020AFB1 /* UserProfileImageLoader.swift */; }; 7345AD242703D9C30020AFB1 /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */; }; 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */; }; + 73508ED528134C7300ED7FB7 /* Credential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508ED428134C7300ED7FB7 /* Credential.swift */; }; 736F49BA270E05E200580053 /* BirthdayLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49B9270E05E200580053 /* BirthdayLoader.swift */; }; 736F49BC270E102C00580053 /* BirthdayViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49BB270E102C00580053 /* BirthdayViewModel.swift */; }; 739FCC46270E467600C92042 /* BirthdayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC45270E467600C92042 /* BirthdayView.swift */; }; @@ -67,6 +68,9 @@ 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserProfileView.swift; sourceTree = ""; }; 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DaysUntilBirthdayUITests(iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS_.swift; sourceTree = ""; }; + 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DaysUntilBirthdayUITests-iOS--Info.plist"; sourceTree = SOURCE_ROOT; }; + 73508ED32813391700ED7FB7 /* Credentials.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Credentials.xcconfig; sourceTree = ""; }; + 73508ED428134C7300ED7FB7 /* Credential.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credential.swift; sourceTree = ""; }; 736F49B9270E05E200580053 /* BirthdayLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayLoader.swift; sourceTree = ""; }; 736F49BB270E102C00580053 /* BirthdayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayViewModel.swift; sourceTree = ""; }; 739FCC45270E467600C92042 /* BirthdayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayView.swift; sourceTree = ""; }; @@ -114,6 +118,8 @@ children = ( C1B5D388282AFD3A0068D12B /* README.md */, C14E3C0B280788C600CF05A9 /* Packages */, + 73508ED32813391700ED7FB7 /* Credentials.xcconfig */, + 73DB417E2805F9850028B8D3 /* GoogleSignIn-iOS */, 7345AD012703D9470020AFB1 /* Shared */, FE7173A927F656AF00910319 /* iOS */, FE71738127ECFAF400910319 /* macOS */, @@ -163,7 +169,9 @@ 73508EC62811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */ = { isa = PBXGroup; children = ( + 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */, 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */, + 73508ED428134C7300ED7FB7 /* Credential.swift */, ); path = "DaysUntilBirthdayUITests(iOS)"; sourceTree = ""; @@ -401,6 +409,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73508ED528134C7300ED7FB7 /* Credential.swift in Sources */, 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -557,6 +566,7 @@ }; 7345AD0F2703D9480020AFB1 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 73508ED32813391700ED7FB7 /* Credentials.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -599,11 +609,14 @@ }; 73508ECD2811BD9C00ED7FB7 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 73508ED32813391700ED7FB7 /* Credentials.xcconfig */; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; + INFOPLIST_KEY_LSApplicationCategoryType = ""; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -627,6 +640,8 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; + INFOPLIST_KEY_LSApplicationCategoryType = ""; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift new file mode 100644 index 00000000..690ef0f5 --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Foundation + +enum Credential: String { + private var bundle: Bundle? { + return Bundle(identifier: "com.google.DaysUntilBirthdayUITests-iOS-") + } + private var emailKey: String { return "EMAIL_SECRET" } + private var passwordKey: String { return "PASSWORD_SECRET" } + + case email + case password + + var rawValue: String { + switch self { + case .email: + guard let email = bundle?.object(forInfoDictionaryKey: emailKey) as? String else { + fatalError("Failed to retrieve secret email from UI testing bundle") + } + return email + case .password: + guard let password = bundle?.object(forInfoDictionaryKey: passwordKey) as? String else { + fatalError("Failed to retrieve secret password from UI testing bundle") + } + return password + } + } +} diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index 4d06137d..1c7f2306 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -37,4 +37,9 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { return XCTFail("Failed to display prompt") } } + + func testReadingSecretsFromConfig() { + XCTAssertEqual(Credential.email.rawValue, "secret_fake_email@gmail.com") + XCTAssertEqual(Credential.password.rawValue, "foobar") + } } From 0c6c8e24fccb99000858ed51fbfa7ba08e394050 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 14:16:24 -0700 Subject: [PATCH 08/36] Remove credentials config --- .../DaysUntilBirthday/Credentials.xcconfig | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Samples/Swift/DaysUntilBirthday/Credentials.xcconfig diff --git a/Samples/Swift/DaysUntilBirthday/Credentials.xcconfig b/Samples/Swift/DaysUntilBirthday/Credentials.xcconfig deleted file mode 100644 index b7101519..00000000 --- a/Samples/Swift/DaysUntilBirthday/Credentials.xcconfig +++ /dev/null @@ -1,18 +0,0 @@ -// -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -EMAIL_SECRET = secret_fake_email@gmail.com -PASSWORD_SECRET = foobar From adfa93af5b71a9ba12eddbcb8214afe80a8a1bb6 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 14:18:55 -0700 Subject: [PATCH 09/36] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c7c5f2a2..166e2919 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ *.xcworkspace/ project.xcworkspace/ xcuserdata/ -Samples/Swift/DaysUntilBirthday/Credentials.xcconfig +Credentials.xcconfig # CocoaPods Pods/ From c2148e8fb04d2742f294753f288ca932bfc7a40b Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 14:19:31 -0700 Subject: [PATCH 10/36] Remove config --- .../DaysUntilBirthday.xcodeproj/project.pbxproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index 938db3f9..a2324210 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -69,7 +69,6 @@ 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DaysUntilBirthdayUITests(iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS_.swift; sourceTree = ""; }; 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DaysUntilBirthdayUITests-iOS--Info.plist"; sourceTree = SOURCE_ROOT; }; - 73508ED32813391700ED7FB7 /* Credentials.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Credentials.xcconfig; sourceTree = ""; }; 73508ED428134C7300ED7FB7 /* Credential.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credential.swift; sourceTree = ""; }; 736F49B9270E05E200580053 /* BirthdayLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayLoader.swift; sourceTree = ""; }; 736F49BB270E102C00580053 /* BirthdayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayViewModel.swift; sourceTree = ""; }; @@ -566,7 +565,6 @@ }; 7345AD0F2703D9480020AFB1 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 73508ED32813391700ED7FB7 /* Credentials.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -609,7 +607,6 @@ }; 73508ECD2811BD9C00ED7FB7 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 73508ED32813391700ED7FB7 /* Credentials.xcconfig */; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; From c08c440a661beff81011675cd1833b4c5f6521bf Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 14:24:18 -0700 Subject: [PATCH 11/36] Add plist for testing --- .../DaysUntilBirthday.xcodeproj/project.pbxproj | 5 +++++ .../DaysUntilBirthdayUITests-iOS--Info.plist | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index a2324210..5578a07a 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 7345AD242703D9C30020AFB1 /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */; }; 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */; }; 73508ED528134C7300ED7FB7 /* Credential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508ED428134C7300ED7FB7 /* Credential.swift */; }; + 73508ED9281353E800ED7FB7 /* Credentials.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */; }; 736F49BA270E05E200580053 /* BirthdayLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49B9270E05E200580053 /* BirthdayLoader.swift */; }; 736F49BC270E102C00580053 /* BirthdayViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49BB270E102C00580053 /* BirthdayViewModel.swift */; }; 739FCC46270E467600C92042 /* BirthdayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC45270E467600C92042 /* BirthdayView.swift */; }; @@ -70,6 +71,7 @@ 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS_.swift; sourceTree = ""; }; 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DaysUntilBirthdayUITests-iOS--Info.plist"; sourceTree = SOURCE_ROOT; }; 73508ED428134C7300ED7FB7 /* Credential.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credential.swift; sourceTree = ""; }; + 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Credentials.xcconfig; sourceTree = ""; }; 736F49B9270E05E200580053 /* BirthdayLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayLoader.swift; sourceTree = ""; }; 736F49BB270E102C00580053 /* BirthdayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayViewModel.swift; sourceTree = ""; }; 739FCC45270E467600C92042 /* BirthdayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayView.swift; sourceTree = ""; }; @@ -171,6 +173,7 @@ 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */, 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */, 73508ED428134C7300ED7FB7 /* Credential.swift */, + 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */, ); path = "DaysUntilBirthdayUITests(iOS)"; sourceTree = ""; @@ -371,6 +374,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73508ED9281353E800ED7FB7 /* Credentials.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -607,6 +611,7 @@ }; 73508ECD2811BD9C00ED7FB7 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist new file mode 100644 index 00000000..9054f3ed --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist @@ -0,0 +1,10 @@ + + + + + EMAIL_SECRET + $(EMAIL_SECRET) + PASSWORD_SECRET + $(PASSWORD_SECRET) + + From 80a29e69242fcb804cc11bf98947098f065e33a5 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 14:32:31 -0700 Subject: [PATCH 12/36] Add test to ensure UI testing bundle is not nil --- .../DaysUntilBirthdayUITests(iOS)/Credential.swift | 12 +++++++----- .../DaysUntilBirthdayUITests_iOS_.swift | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift index 690ef0f5..ccb05eb3 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift @@ -17,9 +17,7 @@ import Foundation enum Credential: String { - private var bundle: Bundle? { - return Bundle(identifier: "com.google.DaysUntilBirthdayUITests-iOS-") - } + static let bundle: Bundle? = Bundle(identifier: "com.google.DaysUntilBirthdayUITests-iOS-") private var emailKey: String { return "EMAIL_SECRET" } private var passwordKey: String { return "PASSWORD_SECRET" } @@ -29,12 +27,16 @@ enum Credential: String { var rawValue: String { switch self { case .email: - guard let email = bundle?.object(forInfoDictionaryKey: emailKey) as? String else { + guard let email = Credential + .bundle? + .object(forInfoDictionaryKey: emailKey) as? String else { fatalError("Failed to retrieve secret email from UI testing bundle") } return email case .password: - guard let password = bundle?.object(forInfoDictionaryKey: passwordKey) as? String else { + guard let password = Credential + .bundle? + .object(forInfoDictionaryKey: passwordKey) as? String else { fatalError("Failed to retrieve secret password from UI testing bundle") } return password diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index 1c7f2306..43f39e7d 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -39,6 +39,7 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { } func testReadingSecretsFromConfig() { + XCTAssertNotNil(Credential.bundle) XCTAssertEqual(Credential.email.rawValue, "secret_fake_email@gmail.com") XCTAssertEqual(Credential.password.rawValue, "foobar") } From 1e447227a155091b11b442bd9e5ff126a225f378 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 15:15:51 -0700 Subject: [PATCH 13/36] Update workflow --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dec98eb0..f916c1da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,6 +74,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Create xcconfig file + shell: bash + env: + EMAIL_SECRET : secret_fake_email@gmail.com + PASSWORD_SECRET : foobar + run: | + echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests(iOS)/Credentials.xcconfig - name: Build test target for Google Sign-in button for Swift run: | xcodebuild \ From 509bdae542524b11fcad88711a4b55f3d2ae4ff8 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 15:18:23 -0700 Subject: [PATCH 14/36] Fix typo in path for config --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f916c1da..48867dc3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -80,7 +80,7 @@ jobs: EMAIL_SECRET : secret_fake_email@gmail.com PASSWORD_SECRET : foobar run: | - echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests(iOS)/Credentials.xcconfig + echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig - name: Build test target for Google Sign-in button for Swift run: | xcodebuild \ From a8314032ae799f6e9d4b74aa90ef4057b74523cf Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 15:52:35 -0700 Subject: [PATCH 15/36] Update sample readme for integration testing --- Samples/Swift/DaysUntilBirthday/README.md | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Samples/Swift/DaysUntilBirthday/README.md b/Samples/Swift/DaysUntilBirthday/README.md index 839328aa..3e070877 100644 --- a/Samples/Swift/DaysUntilBirthday/README.md +++ b/Samples/Swift/DaysUntilBirthday/README.md @@ -24,5 +24,27 @@ open DaysUntilBirthdayForPod.xcworkspace ``` open DaysUntilBirthday.xcodeproj ``` - 2. Run the `DaysUntilBirthday (iOS)` or `DaysUntilBirthday (macOS)` target. + +## Integration Tests + +We run integration tests on the `DaysUntilBirthday(iOS)` sample app. +These tests attempt to login via Google Sign-in, and so they need an email and +a password. +The email and password that we use are located in `Credentials.xcconfig`. + +We create this file during a workflow step on PR push by retrieving these values +from [GitHub's Secret's context](https://docs.github.com/en/actions/learn-github-actions/contexts#secrets-context). + +Locally, both email and password are retrived from a `Credentials.xcconfig` +configuration file that is not checked into the repo. +You will need to create an `Credentials.xcconfig` at this path: +`Samples/Swift/DaysUntilBirthday/DaysUnilBirthdayUITests(iOS)/Credentials.xcconfig`. +It will need values for `EMAIL_SECRET` and `PASSWORD_SECRET`: + +``` +EMAIL_SECRET = ... +PASSWORD_SECRET = ... +``` + +Refer to the repo's Secrets for the values to add to this configuration file. From 933297ffd05fa8270ca4a9533cfc19535eb2010b Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 22 Apr 2022 16:21:28 -0700 Subject: [PATCH 16/36] Update workflow to use secrets --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 48867dc3..f2bf99fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -77,8 +77,8 @@ jobs: - name: Create xcconfig file shell: bash env: - EMAIL_SECRET : secret_fake_email@gmail.com - PASSWORD_SECRET : foobar + EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }} + PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }} run: | echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig - name: Build test target for Google Sign-in button for Swift From aa6ee791e09a5ca55694eab8e39250915decc09f Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 28 Apr 2022 17:39:10 -0700 Subject: [PATCH 17/36] Update UI automatic test flow to use test credentials --- .../DaysUntilBirthdayUITests_iOS_.swift | 85 ++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index 43f39e7d..f10f814c 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -19,13 +19,13 @@ import XCTest class DaysUntilBirthdayUITests_iOS_: XCTestCase { private let signInStaticText = "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" - private let timeout: TimeInterval = 2 + private let timeout: TimeInterval = 5 private let sampleApp = XCUIApplication() private let springboardApp = XCUIApplication( bundleIdentifier: "com.apple.springboard" ) - func testSwiftUIButtonTapStartsFlow() { + func testSwiftUIButtonTapStartsFlowForFirstSignIn() { sampleApp.launch() let signInButton = sampleApp.buttons["GoogleSignInButton"] XCTAssertTrue(signInButton.exists) @@ -36,6 +36,87 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { .waitForExistence(timeout: timeout) else { return XCTFail("Failed to display prompt") } + + guard springboardApp + .buttons["Continue"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find 'Continue' button") + } + + springboardApp.buttons["Continue"].tap() + guard sampleApp.textFields["Email or phone"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find email textfield") + } + guard sampleApp + .keyboards + .element + .buttons["return"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find 'Next' button") + } + + sampleApp.textFields["Email or phone"].typeText(Credential.email.rawValue) + sampleApp.keyboards.element.buttons["return"].tap() + + guard sampleApp.secureTextFields["Enter your password"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find password textfield") + } + guard sampleApp + .keyboards + .element + .buttons["go"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find 'Next' button") + } + + sampleApp + .secureTextFields["Enter your password"] + .typeText(Credential.password.rawValue) + sampleApp.keyboards.element.buttons["go"].tap() + + guard sampleApp.wait(for: .runningForeground, timeout: timeout) else { + return XCTFail("Failed to return sample app to foreground") + } + guard sampleApp.staticTexts["User Profile"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to sign in and return to app's User Profile view.") + } + + guard sampleApp.buttons["View Days Until Birthday"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find button revealing days until birthday") + } + sampleApp.buttons["View Days Until Birthday"].tap() + + guard springboardApp + .staticTexts[signInStaticText] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to display prompt") + } + + guard springboardApp + .buttons["Continue"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find 'Continue' button") + } + springboardApp.buttons["Continue"].tap() + + guard sampleApp + .staticTexts["Days Until Birthday wants to access your Google Account"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find permission screen") + } + guard sampleApp.buttons["Allow"].waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find 'Allow' button") + } + sampleApp.buttons["Allow"].tap() + + guard sampleApp.staticTexts["Days Until Birthday"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to return to view showing days until birthday") + } } func testReadingSecretsFromConfig() { From a3dbb80323899def396dc2b0ae96a62ac40cc085 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 28 Apr 2022 17:50:02 -0700 Subject: [PATCH 18/36] Remove sanity check test for GH secrets --- .../DaysUntilBirthdayUITests_iOS_.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index f10f814c..6e96731e 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -118,10 +118,4 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { return XCTFail("Failed to return to view showing days until birthday") } } - - func testReadingSecretsFromConfig() { - XCTAssertNotNil(Credential.bundle) - XCTAssertEqual(Credential.email.rawValue, "secret_fake_email@gmail.com") - XCTAssertEqual(Credential.password.rawValue, "foobar") - } } From b0557b7e2951fa34a6ce1bff3010d92df93677f7 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 28 Apr 2022 18:11:00 -0700 Subject: [PATCH 19/36] Try using disconnect to reset for each test run --- .../DaysUntilBirthdayUITests_iOS_.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index 6e96731e..37737125 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -90,6 +90,7 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { } sampleApp.buttons["View Days Until Birthday"].tap() + // This won't succeed if the app has already granted access; disconnect is needed here in this case guard springboardApp .staticTexts[signInStaticText] .waitForExistence(timeout: timeout) else { @@ -117,5 +118,15 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { .waitForExistence(timeout: timeout) else { return XCTFail("Failed to return to view showing days until birthday") } + + sampleApp.buttons["Back"].tap() + + guard sampleApp.buttons["Disconnect"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to navigate back to User Profile screen") + } + + // Clean up this run so the next works as if it is the first time + sampleApp.buttons["Disconnect"].tap() } } From 7f102cd823f7ee55bf360e1c18a4784fde48530a Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Thu, 28 Apr 2022 22:16:42 -0700 Subject: [PATCH 20/36] Use the correct label for the disconnect button --- .../DaysUntilBirthdayUITests_iOS_.swift | 10 ++++++---- .../Swift/DaysUntilBirthday/iOS/UserProfileView.swift | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index 37737125..a06c4234 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -119,14 +119,16 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { return XCTFail("Failed to return to view showing days until birthday") } - sampleApp.buttons["Back"].tap() + sampleApp.navigationBars.buttons["User Profile"].tap() - guard sampleApp.buttons["Disconnect"] + guard sampleApp + .navigationBars + .buttons["Disconnect scope button"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to navigate back to User Profile screen") + return XCTFail("Failed to find the 'Disconnect' button") } // Clean up this run so the next works as if it is the first time - sampleApp.buttons["Disconnect"].tap() + sampleApp.navigationBars.buttons["Disconnect scope button"].tap() } } diff --git a/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift b/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift index 93366f47..cfa4569c 100644 --- a/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift +++ b/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift @@ -55,6 +55,7 @@ struct UserProfileView: View { .toolbar { ToolbarItemGroup(placement: .navigationBarTrailing) { Button(NSLocalizedString("Disconnect", comment: "Disconnect button"), action: disconnect) + .accessibilityLabel(Text("Disconnect scope button")) Button(NSLocalizedString("Sign Out", comment: "Sign out button"), action: signOut) } } From f8d2513c762e172478cbd23e710e18296281bb9c Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 29 Apr 2022 13:30:03 -0700 Subject: [PATCH 21/36] Update UI tests to detect first or existing sign in --- .../Credential.swift | 2 + .../DaysUntilBirthdayUITests_iOS_.swift | 190 ++++++++++++++---- .../iOS/UserProfileView.swift | 1 - 3 files changed, 152 insertions(+), 41 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift index ccb05eb3..94f41abc 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift @@ -16,6 +16,8 @@ import Foundation +/// An enumeration helping to interact with the configuration file containing +/// the email and password secrets used for testing the Google sign-in flow. enum Credential: String { static let bundle: Bundle? = Bundle(identifier: "com.google.DaysUntilBirthdayUITests-iOS-") private var emailKey: String { return "EMAIL_SECRET" } diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index a06c4234..f8174ced 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -20,40 +20,115 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { private let signInStaticText = "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" private let timeout: TimeInterval = 5 + private let sampleApp = XCUIApplication() private let springboardApp = XCUIApplication( bundleIdentifier: "com.apple.springboard" ) - func testSwiftUIButtonTapStartsFlowForFirstSignIn() { + func testSignInNavigateToDaysUntilBirthdayAndDisconnect() { sampleApp.launch() + + XCTAssertTrue(signIn()) + XCTAssertTrue(navigateToDaysUntilBirthday()) + XCTAssertTrue(navigateBackToUserProfileView()) + + // Disconnect so the next test run works as if it is the first time + sampleApp.navigationBars.buttons["Disconnect"].tap() + + guard sampleApp + .buttons["GoogleSignInButton"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Disconnecting should return user to sign in view") + } + } + + func testSignInAndSignOut() { + sampleApp.launch() + XCTAssertTrue(signIn()) + + guard sampleApp + .navigationBars + .buttons["Sign Out"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Failed to find the 'Disconnect' button") + } + sampleApp.buttons["Sign Out"].tap() + + guard sampleApp + .buttons["GoogleSignInButton"] + .waitForExistence(timeout: timeout) else { + return XCTFail("Signing out should return user to sign in view") + } + } +} + +extension DaysUntilBirthdayUITests_iOS_ { + /// Performs a sign in. + /// - returns: `true` if the sign in was succesfull. + func signIn() -> Bool { let signInButton = sampleApp.buttons["GoogleSignInButton"] - XCTAssertTrue(signInButton.exists) + guard signInButton.exists else { + XCTFail("Sign in button does not exist") + return false + } signInButton.tap() guard springboardApp .staticTexts[signInStaticText] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to display prompt") + XCTFail("Failed to display permission prompt") + return false } guard springboardApp .buttons["Continue"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find 'Continue' button") + XCTFail("Failed to find 'Continue' button") + return false } - springboardApp.buttons["Continue"].tap() + + if sampleApp + .staticTexts[Credential.email.rawValue] + .waitForExistence(timeout: timeout) { + // This email was previously used to sign in + XCTAssertTrue(useExistingSignIn()) + } else { + // This is a first time sign in + XCTAssertTrue(signInForTheFirstTime()) + } + + guard sampleApp.wait(for: .runningForeground, timeout: timeout) else { + XCTFail("Failed to return sample app to foreground") + return false + } + guard sampleApp.staticTexts["User Profile"] + .waitForExistence(timeout: timeout) else { + XCTFail("Failed to sign in and return to app's User Profile view.") + return false + } + + return true + } + + /// Signs in expecting the first time flow. + /// @discussion + /// This will assumme the full flow where a user must type in an email and + /// password to sign in with. + func signInForTheFirstTime() -> Bool { guard sampleApp.textFields["Email or phone"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find email textfield") + XCTFail("Failed to find email textfield") + return false } guard sampleApp .keyboards .element .buttons["return"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find 'Next' button") + XCTFail("Failed to find 'return' button") + return false } sampleApp.textFields["Email or phone"].typeText(Credential.email.rawValue) @@ -61,14 +136,16 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { guard sampleApp.secureTextFields["Enter your password"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find password textfield") + XCTFail("Failed to find password textfield") + return false } guard sampleApp .keyboards .element .buttons["go"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find 'Next' button") + XCTFail("Failed to find 'go' button") + return false } sampleApp @@ -76,59 +153,92 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { .typeText(Credential.password.rawValue) sampleApp.keyboards.element.buttons["go"].tap() - guard sampleApp.wait(for: .runningForeground, timeout: timeout) else { - return XCTFail("Failed to return sample app to foreground") + return true + } + + /// Signs in expecting a prior sign in. + /// @discussion + /// This will assume that there is a `Credential.email` in a list to select + /// and sign in with. + func useExistingSignIn() -> Bool { + guard sampleApp.staticTexts[Credential.email.rawValue].exists else { + XCTFail("Email used for previous sign-in not in list") + return false } - guard sampleApp.staticTexts["User Profile"] - .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to sign in and return to app's User Profile view.") + guard sampleApp.staticTexts[Credential.email.rawValue].isHittable else { + XCTFail("Email used for previous sign-in not tappable") + return false } + sampleApp.staticTexts[Credential.email.rawValue].tap() + return true + } + + /// Navigates to the days until birthday view from the user profile view. + /// - returns: `true` if the navigation was performed successfully. + /// - note: If `firstSignIn` is `true`, then we should expect a pop up asking + /// for permission. + func navigateToDaysUntilBirthday() -> Bool { guard sampleApp.buttons["View Days Until Birthday"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find button revealing days until birthday") + XCTFail("Failed to find button navigating to days until birthday view") + return false } sampleApp.buttons["View Days Until Birthday"].tap() - // This won't succeed if the app has already granted access; disconnect is needed here in this case - guard springboardApp - .staticTexts[signInStaticText] - .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to display prompt") + if springboardApp + .staticTexts[signInStaticText] + .waitForExistence(timeout: timeout) { + guard springboardApp + .buttons["Continue"] + .waitForExistence(timeout: timeout) else { + XCTFail("Failed to find 'Continue' button") + return false + } + springboardApp.buttons["Continue"].tap() + + guard sampleApp + .staticTexts["Days Until Birthday wants to access your Google Account"] + .waitForExistence(timeout: timeout) else { + XCTFail("Failed to find permission screen") + return false + } + guard sampleApp.buttons["Allow"].waitForExistence(timeout: timeout) else { + XCTFail("Failed to find 'Allow' button") + return false + } + sampleApp.buttons["Allow"].tap() } - guard springboardApp - .buttons["Continue"] + guard sampleApp.staticTexts["Days Until Birthday"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find 'Continue' button") + XCTFail("Failed to show days until birthday view") + return false } - springboardApp.buttons["Continue"].tap() - guard sampleApp - .staticTexts["Days Until Birthday wants to access your Google Account"] - .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find permission screen") - } - guard sampleApp.buttons["Allow"].waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find 'Allow' button") - } - sampleApp.buttons["Allow"].tap() + return true + } - guard sampleApp.staticTexts["Days Until Birthday"] + /// Navigates back to the User Profile view from the Days Until Birthday View. + /// - returns: `true` if the navigation was successfully performed. + func navigateBackToUserProfileView() -> Bool { + guard sampleApp + .navigationBars + .buttons["User Profile"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to return to view showing days until birthday") + XCTFail("Failed to show navigation button back to user profile view") + return false } - sampleApp.navigationBars.buttons["User Profile"].tap() guard sampleApp .navigationBars - .buttons["Disconnect scope button"] + .buttons["Disconnect"] .waitForExistence(timeout: timeout) else { - return XCTFail("Failed to find the 'Disconnect' button") + XCTFail("Failed to find the 'Disconnect' button") + return false } - // Clean up this run so the next works as if it is the first time - sampleApp.navigationBars.buttons["Disconnect scope button"].tap() + return true } } diff --git a/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift b/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift index cfa4569c..93366f47 100644 --- a/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift +++ b/Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift @@ -55,7 +55,6 @@ struct UserProfileView: View { .toolbar { ToolbarItemGroup(placement: .navigationBarTrailing) { Button(NSLocalizedString("Disconnect", comment: "Disconnect button"), action: disconnect) - .accessibilityLabel(Text("Disconnect scope button")) Button(NSLocalizedString("Sign Out", comment: "Sign out button"), action: signOut) } } From 9d9bac406d61439d534076fb8656d880190118cb Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 29 Apr 2022 13:36:59 -0700 Subject: [PATCH 22/36] Update comments --- .../DaysUntilBirthdayUITests_iOS_.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift index f8174ced..95895634 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift @@ -33,7 +33,6 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { XCTAssertTrue(navigateToDaysUntilBirthday()) XCTAssertTrue(navigateBackToUserProfileView()) - // Disconnect so the next test run works as if it is the first time sampleApp.navigationBars.buttons["Disconnect"].tap() guard sampleApp @@ -158,8 +157,8 @@ extension DaysUntilBirthdayUITests_iOS_ { /// Signs in expecting a prior sign in. /// @discussion - /// This will assume that there is a `Credential.email` in a list to select - /// and sign in with. + /// This will check that there is a `Credential.email` in a list to select and + /// sign in with. func useExistingSignIn() -> Bool { guard sampleApp.staticTexts[Credential.email.rawValue].exists else { XCTFail("Email used for previous sign-in not in list") @@ -176,8 +175,8 @@ extension DaysUntilBirthdayUITests_iOS_ { /// Navigates to the days until birthday view from the user profile view. /// - returns: `true` if the navigation was performed successfully. - /// - note: If `firstSignIn` is `true`, then we should expect a pop up asking - /// for permission. + /// - note: This method will attempt to find a pop up asking for permission to + /// sign in with Google. func navigateToDaysUntilBirthday() -> Bool { guard sampleApp.buttons["View Days Until Birthday"] .waitForExistence(timeout: timeout) else { From 90cf2b9ea5f4e6e80896cd7bdcf2265ad68205fd Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 10 Jun 2022 17:16:59 -0700 Subject: [PATCH 23/36] Fix project file --- .../project.pbxproj | 98 +++++++------------ ...ift => DaysUntilBirthdayUITests_iOS.swift} | 4 +- 2 files changed, 38 insertions(+), 64 deletions(-) rename Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/{DaysUntilBirthdayUITests_iOS_.swift => DaysUntilBirthdayUITests_iOS.swift} (98%) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index 5578a07a..21c4d132 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -17,13 +17,17 @@ 7345AD212703D9C30020AFB1 /* GoogleSignInAuthenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD172703D9C30020AFB1 /* GoogleSignInAuthenticator.swift */; }; 7345AD232703D9C30020AFB1 /* UserProfileImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD192703D9C30020AFB1 /* UserProfileImageLoader.swift */; }; 7345AD242703D9C30020AFB1 /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */; }; - 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */; }; + 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift */; }; 73508ED528134C7300ED7FB7 /* Credential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508ED428134C7300ED7FB7 /* Credential.swift */; }; 73508ED9281353E800ED7FB7 /* Credentials.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */; }; 736F49BA270E05E200580053 /* BirthdayLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49B9270E05E200580053 /* BirthdayLoader.swift */; }; 736F49BC270E102C00580053 /* BirthdayViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49BB270E102C00580053 /* BirthdayViewModel.swift */; }; 739FCC46270E467600C92042 /* BirthdayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC45270E467600C92042 /* BirthdayView.swift */; }; 739FCC48270E659A00C92042 /* Birthday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC47270E659A00C92042 /* Birthday.swift */; }; + 73DB41802805FA0D0028B8D3 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 73DB417F2805FA0D0028B8D3 /* GoogleSignIn */; }; + 73DB41822805FA120028B8D3 /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 73DB41812805FA120028B8D3 /* GoogleSignInSwift */; }; + 73DB41842805FA190028B8D3 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 73DB41832805FA190028B8D3 /* GoogleSignIn */; }; + 73DB41882805FAA70028B8D3 /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 73DB41872805FAA70028B8D3 /* GoogleSignInSwift */; }; 73DB41892805FBA90028B8D3 /* DaysUntilBirthday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD022703D9470020AFB1 /* DaysUntilBirthday.swift */; }; 73DB418A2805FBC00028B8D3 /* GoogleSignInAuthenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD172703D9C30020AFB1 /* GoogleSignInAuthenticator.swift */; }; 73DB418B2805FBC40028B8D3 /* BirthdayLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49B9270E05E200580053 /* BirthdayLoader.swift */; }; @@ -37,11 +41,6 @@ 73DB41932805FC3B0028B8D3 /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE7173A527F5110F00910319 /* UserProfileView.swift */; }; 73DB41952805FC5F0028B8D3 /* Birthday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC47270E659A00C92042 /* Birthday.swift */; }; 73DB419628060A9A0028B8D3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7345AD062703D9480020AFB1 /* Assets.xcassets */; }; - C1B5D37E282AE2B60068D12B /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = C1B5D37D282AE2B60068D12B /* GoogleSignIn */; }; - C1B5D380282AE2B60068D12B /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = C1B5D37F282AE2B60068D12B /* GoogleSignInSwift */; }; - C1B5D382282AE3370068D12B /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = C1B5D381282AE3370068D12B /* GoogleSignIn */; }; - C1B5D384282AE3370068D12B /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = C1B5D383282AE3370068D12B /* GoogleSignInSwift */; }; - C1B5D389282AFD3A0068D12B /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = C1B5D388282AFD3A0068D12B /* README.md */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -67,8 +66,8 @@ 7345AD172703D9C30020AFB1 /* GoogleSignInAuthenticator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoogleSignInAuthenticator.swift; sourceTree = ""; }; 7345AD192703D9C30020AFB1 /* UserProfileImageLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserProfileImageLoader.swift; sourceTree = ""; }; 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserProfileView.swift; sourceTree = ""; }; - 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DaysUntilBirthdayUITests(iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS_.swift; sourceTree = ""; }; + 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests (iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DaysUntilBirthdayUITests (iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS.swift; sourceTree = ""; }; 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DaysUntilBirthdayUITests-iOS--Info.plist"; sourceTree = SOURCE_ROOT; }; 73508ED428134C7300ED7FB7 /* Credential.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credential.swift; sourceTree = ""; }; 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Credentials.xcconfig; sourceTree = ""; }; @@ -76,8 +75,7 @@ 736F49BB270E102C00580053 /* BirthdayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayViewModel.swift; sourceTree = ""; }; 739FCC45270E467600C92042 /* BirthdayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayView.swift; sourceTree = ""; }; 739FCC47270E659A00C92042 /* Birthday.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Birthday.swift; sourceTree = ""; }; - C14E3C0C280788C600CF05A9 /* GoogleSignIn-iOS */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "GoogleSignIn-iOS"; path = ../../..; sourceTree = ""; }; - C1B5D388282AFD3A0068D12B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 73DB417E2805F9850028B8D3 /* GoogleSignIn-iOS */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "GoogleSignIn-iOS"; path = ../../..; sourceTree = ""; }; FE2F2ABC2800D9C1005EA17F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FE71738027ECFAF400910319 /* DaysUntilBirthday (macOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DaysUntilBirthday (macOS).app"; sourceTree = BUILT_PRODUCTS_DIR; }; FE71738927ECFAF600910319 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; @@ -90,8 +88,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1B5D37E282AE2B60068D12B /* GoogleSignIn in Frameworks */, - C1B5D380282AE2B60068D12B /* GoogleSignInSwift in Frameworks */, + 73DB41802805FA0D0028B8D3 /* GoogleSignIn in Frameworks */, + 73DB41822805FA120028B8D3 /* GoogleSignInSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -106,8 +104,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C1B5D382282AE3370068D12B /* GoogleSignIn in Frameworks */, - C1B5D384282AE3370068D12B /* GoogleSignInSwift in Frameworks */, + 73DB41842805FA190028B8D3 /* GoogleSignIn in Frameworks */, + 73DB41882805FAA70028B8D3 /* GoogleSignInSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -117,9 +115,6 @@ 7345ACF62703D9470020AFB1 = { isa = PBXGroup; children = ( - C1B5D388282AFD3A0068D12B /* README.md */, - C14E3C0B280788C600CF05A9 /* Packages */, - 73508ED32813391700ED7FB7 /* Credentials.xcconfig */, 73DB417E2805F9850028B8D3 /* GoogleSignIn-iOS */, 7345AD012703D9470020AFB1 /* Shared */, FE7173A927F656AF00910319 /* iOS */, @@ -135,7 +130,7 @@ children = ( 7345ACFF2703D9470020AFB1 /* DaysUntilBirthday (iOS).app */, FE71738027ECFAF400910319 /* DaysUntilBirthday (macOS).app */, - 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */, + 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests (iOS).xctest */, ); name = Products; sourceTree = ""; @@ -161,17 +156,11 @@ path = "Preview Content"; sourceTree = ""; }; - C14E3C0B280788C600CF05A9 /* Packages */ = { - isa = PBXGroup; - children = ( - C14E3C0C280788C600CF05A9 /* GoogleSignIn-iOS */, - ); - name = Packages; 73508EC62811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */ = { isa = PBXGroup; children = ( 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */, - 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift */, + 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift */, 73508ED428134C7300ED7FB7 /* Credential.swift */, 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */, ); @@ -269,16 +258,16 @@ ); name = "DaysUntilBirthday (iOS)"; packageProductDependencies = ( - C1B5D37D282AE2B60068D12B /* GoogleSignIn */, - C1B5D37F282AE2B60068D12B /* GoogleSignInSwift */, + 73DB417F2805FA0D0028B8D3 /* GoogleSignIn */, + 73DB41812805FA120028B8D3 /* GoogleSignInSwift */, ); productName = "GSI-Swift-Sample"; productReference = 7345ACFF2703D9470020AFB1 /* DaysUntilBirthday (iOS).app */; productType = "com.apple.product-type.application"; }; - 73508EC42811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */ = { + 73508EC42811BD9C00ED7FB7 /* DaysUntilBirthdayUITests (iOS) */ = { isa = PBXNativeTarget; - buildConfigurationList = 73508ECF2811BD9C00ED7FB7 /* Build configuration list for PBXNativeTarget "DaysUntilBirthdayUITests(iOS)" */; + buildConfigurationList = 73508ECF2811BD9C00ED7FB7 /* Build configuration list for PBXNativeTarget "DaysUntilBirthdayUITests (iOS)" */; buildPhases = ( 73508EC12811BD9C00ED7FB7 /* Sources */, 73508EC22811BD9C00ED7FB7 /* Frameworks */, @@ -289,12 +278,12 @@ dependencies = ( 73508ECC2811BD9C00ED7FB7 /* PBXTargetDependency */, ); - name = "DaysUntilBirthdayUITests(iOS)"; + name = "DaysUntilBirthdayUITests (iOS)"; productName = "DaysUntilBirthdayUITests(iOS)"; - productReference = 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS).xctest */; + productReference = 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests (iOS).xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; - FE71737F27ECFAF400910319 /* DaysUntilBirthday(macOS) */ = { + FE71737F27ECFAF400910319 /* DaysUntilBirthday (macOS) */ = { isa = PBXNativeTarget; buildConfigurationList = FE71738C27ECFAF600910319 /* Build configuration list for PBXNativeTarget "DaysUntilBirthday (macOS)" */; buildPhases = ( @@ -308,8 +297,8 @@ ); name = "DaysUntilBirthday (macOS)"; packageProductDependencies = ( - C1B5D381282AE3370068D12B /* GoogleSignIn */, - C1B5D383282AE3370068D12B /* GoogleSignInSwift */, + 73DB41832805FA190028B8D3 /* GoogleSignIn */, + 73DB41872805FAA70028B8D3 /* GoogleSignInSwift */, ); productName = DaysUntilBirthdayOnMac; productReference = FE71738027ECFAF400910319 /* DaysUntilBirthday (macOS).app */; @@ -346,7 +335,6 @@ ); mainGroup = 7345ACF62703D9470020AFB1; packageReferences = ( - C1B5D37C282AE2B60068D12B /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */, ); productRefGroup = 7345AD002703D9470020AFB1 /* Products */; projectDirPath = ""; @@ -354,7 +342,7 @@ targets = ( 7345ACFE2703D9470020AFB1 /* DaysUntilBirthday (iOS) */, FE71737F27ECFAF400910319 /* DaysUntilBirthday (macOS) */, - 73508EC42811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */, + 73508EC42811BD9C00ED7FB7 /* DaysUntilBirthdayUITests (iOS) */, ); }; /* End PBXProject section */ @@ -364,7 +352,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C1B5D389282AFD3A0068D12B /* README.md in Resources */, 7345AD0A2703D9480020AFB1 /* Preview Assets.xcassets in Resources */, 7345AD072703D9480020AFB1 /* Assets.xcassets in Resources */, ); @@ -413,7 +400,7 @@ buildActionMask = 2147483647; files = ( 73508ED528134C7300ED7FB7 /* Credential.swift in Sources */, - 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS_.swift in Sources */, + 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -441,7 +428,7 @@ /* Begin PBXTargetDependency section */ 73508ECC2811BD9C00ED7FB7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 7345ACFE2703D9470020AFB1 /* DaysUntilBirthday(iOS) */; + target = 7345ACFE2703D9470020AFB1 /* DaysUntilBirthday (iOS) */; targetProxy = 73508ECB2811BD9C00ED7FB7 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -500,7 +487,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -557,7 +544,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -679,7 +666,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = Google.DaysUntilBirthdayOnMac; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -708,7 +695,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = Google.DaysUntilBirthdayOnMac; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -739,7 +726,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 73508ECF2811BD9C00ED7FB7 /* Build configuration list for PBXNativeTarget "DaysUntilBirthdayUITests(iOS)" */ = { + 73508ECF2811BD9C00ED7FB7 /* Build configuration list for PBXNativeTarget "DaysUntilBirthdayUITests (iOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( 73508ECD2811BD9C00ED7FB7 /* Debug */, @@ -748,7 +735,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - FE71738C27ECFAF600910319 /* Build configuration list for PBXNativeTarget "DaysUntilBirthday (macOS)" */ = { + FE71738C27ECFAF600910319 /* Build configuration list for PBXNativeTarget "DaysUntilBirthday (macOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( FE71738D27ECFAF600910319 /* Debug */, @@ -759,33 +746,20 @@ }; /* End XCConfigurationList section */ -/* Begin XCRemoteSwiftPackageReference section */ - C1B5D37C282AE2B60068D12B /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/google/GoogleSignIn-iOS.git"; - requirement = { - branch = main; - kind = branch; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - /* Begin XCSwiftPackageProductDependency section */ - C1B5D37D282AE2B60068D12B /* GoogleSignIn */ = { + 73DB417F2805FA0D0028B8D3 /* GoogleSignIn */ = { isa = XCSwiftPackageProductDependency; - package = C1B5D37C282AE2B60068D12B /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; productName = GoogleSignIn; }; - C1B5D37F282AE2B60068D12B /* GoogleSignInSwift */ = { + 73DB41812805FA120028B8D3 /* GoogleSignInSwift */ = { isa = XCSwiftPackageProductDependency; - package = C1B5D37C282AE2B60068D12B /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; productName = GoogleSignInSwift; }; - C1B5D381282AE3370068D12B /* GoogleSignIn */ = { + 73DB41832805FA190028B8D3 /* GoogleSignIn */ = { isa = XCSwiftPackageProductDependency; productName = GoogleSignIn; }; - C1B5D383282AE3370068D12B /* GoogleSignInSwift */ = { + 73DB41872805FAA70028B8D3 /* GoogleSignInSwift */ = { isa = XCSwiftPackageProductDependency; productName = GoogleSignInSwift; }; diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift similarity index 98% rename from Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift rename to Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift index 95895634..ab39dbbe 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS_.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift @@ -16,7 +16,7 @@ import XCTest -class DaysUntilBirthdayUITests_iOS_: XCTestCase { +class DaysUntilBirthdayUITests_iOS: XCTestCase { private let signInStaticText = "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" private let timeout: TimeInterval = 5 @@ -62,7 +62,7 @@ class DaysUntilBirthdayUITests_iOS_: XCTestCase { } } -extension DaysUntilBirthdayUITests_iOS_ { +extension DaysUntilBirthdayUITests_iOS { /// Performs a sign in. /// - returns: `true` if the sign in was succesfull. func signIn() -> Bool { From c7c9b9ee53cb14a3826ba1827f9e612352052c8c Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 10 Jun 2022 18:45:00 -0700 Subject: [PATCH 24/36] Add space to expected text --- .../DaysUntilBirthday.xcodeproj/project.pbxproj | 6 ++++-- .../DaysUntilBirthdayUITests_iOS.swift | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index 21c4d132..ce454cac 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -615,10 +615,11 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.google.DaysUntilBirthdayUITests-iOS-"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = "DaysUntilBirthday(iOS)"; + TEST_TARGET_NAME = "DaysUntilBirthday (iOS)"; }; name = Debug; }; @@ -640,10 +641,11 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.google.DaysUntilBirthdayUITests-iOS-"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = "DaysUntilBirthday(iOS)"; + TEST_TARGET_NAME = "DaysUntilBirthday (iOS)"; }; name = Release; }; diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift index ab39dbbe..607acbcb 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift @@ -18,7 +18,7 @@ import XCTest class DaysUntilBirthdayUITests_iOS: XCTestCase { private let signInStaticText = - "“DaysUntilBirthday(iOS)” Wants to Use “google.com” to Sign In" + "“DaysUntilBirthday (iOS)” Wants to Use “google.com” to Sign In" private let timeout: TimeInterval = 5 private let sampleApp = XCUIApplication() From f82f77ebf0aed72cb3e82290e1316618babaa920 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 10 Jun 2022 23:22:12 -0700 Subject: [PATCH 25/36] List schemes --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f2bf99fd..c1841fcf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -83,6 +83,7 @@ jobs: echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig - name: Build test target for Google Sign-in button for Swift run: | + echo xcodebuild -project Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj -list xcodebuild \ -project DaysUntilBirthday.xcodeproj \ build-for-testing \ From 18d79f4951df7bc8113f2ac331a2b7c77a3c0faa Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 10 Jun 2022 23:27:26 -0700 Subject: [PATCH 26/36] Add DaysUntilBirthday iOS scheme --- .../xcschemes/DaysUntilBirthday(iOS).xcscheme | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme new file mode 100644 index 00000000..0edad324 --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8185e9c72622d3436169488e3f18fe5277aef5f8 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 10 Jun 2022 23:37:34 -0700 Subject: [PATCH 27/36] Do not echo schemes --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c1841fcf..f2bf99fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -83,7 +83,6 @@ jobs: echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig - name: Build test target for Google Sign-in button for Swift run: | - echo xcodebuild -project Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj -list xcodebuild \ -project DaysUntilBirthday.xcodeproj \ build-for-testing \ From a6fb9ee2b88e5564c284383f4a1161d66da6a35e Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 13:25:51 -0700 Subject: [PATCH 28/36] Add test for env variable --- .../DaysUntilBirthdayUITests_iOS.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift index 607acbcb..b469675f 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift @@ -60,6 +60,13 @@ class DaysUntilBirthdayUITests_iOS: XCTestCase { return XCTFail("Signing out should return user to sign in view") } } + + func testFooBarPassedIntoEnvironment() { + guard let fooBar = ProcessInfo.processInfo.environment["FOO_BAR"] else { + return XCTFail("No `FOO_BAR`.") + } + XCTAssertEqual(fooBar, "testValue") + } } extension DaysUntilBirthdayUITests_iOS { From f6bfa6d03a1f672ad17573769fd27ce003e5f7b7 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 13:29:07 -0700 Subject: [PATCH 29/36] Add FOO_BAR to xcodebuild call for integration test --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f2bf99fd..4494604c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,3 +97,4 @@ jobs: -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' + FOO_BAR = ${{ secrets.FOO_BAR }} From 94864e2f57a2c98c7ca07f19ea970a63199eefc9 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 13:44:02 -0700 Subject: [PATCH 30/36] Remove spaces --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4494604c..d811ce45 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,6 +78,7 @@ jobs: shell: bash env: EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }} + FOO_BAR : ${{ secrets.FOO_BAR }} PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }} run: | echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig @@ -97,4 +98,4 @@ jobs: -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' - FOO_BAR = ${{ secrets.FOO_BAR }} + FOO_BAR=$FOO_BAR From 5573a7009bb57d32122897f28a65d85eaad81c9c Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 15:16:50 -0700 Subject: [PATCH 31/36] Test FOO_BAR --- .../DaysUntilBirthday.xcodeproj/project.pbxproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index ce454cac..0bb97be5 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -603,6 +603,12 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + FOO_BAR = defaultValue; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + "FOO_BAR=$(FOO_BAR)", + ); GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = ""; @@ -629,6 +635,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + FOO_BAR = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = ""; From cde90104f6e00a9b4844013a80f865c63944bb91 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 16:21:28 -0700 Subject: [PATCH 32/36] Add env in the right spot --- .github/workflows/tests.yml | 3 ++- .../DaysUntilBirthday.xcodeproj/project.pbxproj | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d811ce45..657015ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,6 @@ jobs: shell: bash env: EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }} - FOO_BAR : ${{ secrets.FOO_BAR }} PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }} run: | echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig @@ -91,6 +90,8 @@ jobs: -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' - name: Run test target for Google Sign-in button for Swift + env: + FOO_BAR : ${{ secrets.FOO_BAR }} run: | xcodebuild \ -project DaysUntilBirthday.xcodeproj \ diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index 0bb97be5..0995af46 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -603,11 +603,9 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - FOO_BAR = defaultValue; GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", "$(inherited)", - "FOO_BAR=$(FOO_BAR)", + "DEBUG=1", ); GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; @@ -635,7 +633,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - FOO_BAR = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = ""; From 4b4af4628d33fd984770abc6fcc7bda303789f5a Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 16:56:47 -0700 Subject: [PATCH 33/36] Update instructions --- .github/workflows/tests.yml | 15 +++++-------- .../project.pbxproj | 9 -------- .../xcschemes/DaysUntilBirthday(iOS).xcscheme | 9 ++++++-- .../Credential.swift | 11 +++------- .../DaysUntilBirthdayUITests_iOS.swift | 7 ------ .../DaysUntilBirthdayUITests-iOS--Info.plist | 10 --------- Samples/Swift/DaysUntilBirthday/README.md | 22 +++++-------------- 7 files changed, 21 insertions(+), 62 deletions(-) delete mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 657015ca..0faa5ae6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,13 +74,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Create xcconfig file - shell: bash - env: - EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }} - PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }} - run: | - echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig - name: Build test target for Google Sign-in button for Swift run: | xcodebuild \ @@ -91,12 +84,14 @@ jobs: -destination 'platform=iOS Simulator,name=iPhone 11' - name: Run test target for Google Sign-in button for Swift env: - FOO_BAR : ${{ secrets.FOO_BAR }} + EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }} + PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }} run: | xcodebuild \ -project DaysUntilBirthday.xcodeproj \ test-without-building \ -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 11' - FOO_BAR=$FOO_BAR + -destination 'platform=iOS Simulator,name=iPhone 11' \ + EMAIL_SECRET=$EMAIL_SECRET \ + PASSWORD_SECRET=$PASSWORD_SECRET diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj index 0995af46..329cad53 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj @@ -19,7 +19,6 @@ 7345AD242703D9C30020AFB1 /* UserProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */; }; 73508EC82811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift */; }; 73508ED528134C7300ED7FB7 /* Credential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73508ED428134C7300ED7FB7 /* Credential.swift */; }; - 73508ED9281353E800ED7FB7 /* Credentials.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */; }; 736F49BA270E05E200580053 /* BirthdayLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49B9270E05E200580053 /* BirthdayLoader.swift */; }; 736F49BC270E102C00580053 /* BirthdayViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736F49BB270E102C00580053 /* BirthdayViewModel.swift */; }; 739FCC46270E467600C92042 /* BirthdayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739FCC45270E467600C92042 /* BirthdayView.swift */; }; @@ -68,9 +67,7 @@ 7345AD1A2703D9C30020AFB1 /* UserProfileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserProfileView.swift; sourceTree = ""; }; 73508EC52811BD9C00ED7FB7 /* DaysUntilBirthdayUITests (iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DaysUntilBirthdayUITests (iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthdayUITests_iOS.swift; sourceTree = ""; }; - 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DaysUntilBirthdayUITests-iOS--Info.plist"; sourceTree = SOURCE_ROOT; }; 73508ED428134C7300ED7FB7 /* Credential.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credential.swift; sourceTree = ""; }; - 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Credentials.xcconfig; sourceTree = ""; }; 736F49B9270E05E200580053 /* BirthdayLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayLoader.swift; sourceTree = ""; }; 736F49BB270E102C00580053 /* BirthdayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayViewModel.swift; sourceTree = ""; }; 739FCC45270E467600C92042 /* BirthdayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BirthdayView.swift; sourceTree = ""; }; @@ -159,10 +156,8 @@ 73508EC62811BD9C00ED7FB7 /* DaysUntilBirthdayUITests(iOS) */ = { isa = PBXGroup; children = ( - 73508ED2281337AE00ED7FB7 /* DaysUntilBirthdayUITests-iOS--Info.plist */, 73508EC72811BD9C00ED7FB7 /* DaysUntilBirthdayUITests_iOS.swift */, 73508ED428134C7300ED7FB7 /* Credential.swift */, - 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */, ); path = "DaysUntilBirthdayUITests(iOS)"; sourceTree = ""; @@ -361,7 +356,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 73508ED9281353E800ED7FB7 /* Credentials.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -598,7 +592,6 @@ }; 73508ECD2811BD9C00ED7FB7 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 73508ED8281353E800ED7FB7 /* Credentials.xcconfig */; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; @@ -608,7 +601,6 @@ "DEBUG=1", ); GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = ""; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -635,7 +627,6 @@ CURRENT_PROJECT_VERSION = 1; GCC_PREPROCESSOR_DEFINITIONS = ""; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = "DaysUntilBirthdayUITests-iOS--Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = ""; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme index 0edad324..cabf8937 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme @@ -38,8 +38,13 @@ + + diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift index 94f41abc..505fb4b3 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/Credential.swift @@ -16,10 +16,9 @@ import Foundation -/// An enumeration helping to interact with the configuration file containing +/// An enumeration helping to interact with the environment variables containing /// the email and password secrets used for testing the Google sign-in flow. enum Credential: String { - static let bundle: Bundle? = Bundle(identifier: "com.google.DaysUntilBirthdayUITests-iOS-") private var emailKey: String { return "EMAIL_SECRET" } private var passwordKey: String { return "PASSWORD_SECRET" } @@ -29,16 +28,12 @@ enum Credential: String { var rawValue: String { switch self { case .email: - guard let email = Credential - .bundle? - .object(forInfoDictionaryKey: emailKey) as? String else { + guard let email = ProcessInfo.processInfo.environment[emailKey] else { fatalError("Failed to retrieve secret email from UI testing bundle") } return email case .password: - guard let password = Credential - .bundle? - .object(forInfoDictionaryKey: passwordKey) as? String else { + guard let password = ProcessInfo.processInfo.environment[passwordKey] else { fatalError("Failed to retrieve secret password from UI testing bundle") } return password diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift index b469675f..607acbcb 100644 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift @@ -60,13 +60,6 @@ class DaysUntilBirthdayUITests_iOS: XCTestCase { return XCTFail("Signing out should return user to sign in view") } } - - func testFooBarPassedIntoEnvironment() { - guard let fooBar = ProcessInfo.processInfo.environment["FOO_BAR"] else { - return XCTFail("No `FOO_BAR`.") - } - XCTAssertEqual(fooBar, "testValue") - } } extension DaysUntilBirthdayUITests_iOS { diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist deleted file mode 100644 index 9054f3ed..00000000 --- a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests-iOS--Info.plist +++ /dev/null @@ -1,10 +0,0 @@ - - - - - EMAIL_SECRET - $(EMAIL_SECRET) - PASSWORD_SECRET - $(PASSWORD_SECRET) - - diff --git a/Samples/Swift/DaysUntilBirthday/README.md b/Samples/Swift/DaysUntilBirthday/README.md index 3e070877..9b49509c 100644 --- a/Samples/Swift/DaysUntilBirthday/README.md +++ b/Samples/Swift/DaysUntilBirthday/README.md @@ -31,20 +31,10 @@ open DaysUntilBirthday.xcodeproj We run integration tests on the `DaysUntilBirthday(iOS)` sample app. These tests attempt to login via Google Sign-in, and so they need an email and a password. -The email and password that we use are located in `Credentials.xcconfig`. +The email and password that we use are defined as +[secrets](https://docs.github.com/en/actions/learn-github-actions/contexts#secrets-context) +on our GitHub repo, and we retrieve these from the workflow environment. -We create this file during a workflow step on PR push by retrieving these values -from [GitHub's Secret's context](https://docs.github.com/en/actions/learn-github-actions/contexts#secrets-context). - -Locally, both email and password are retrived from a `Credentials.xcconfig` -configuration file that is not checked into the repo. -You will need to create an `Credentials.xcconfig` at this path: -`Samples/Swift/DaysUntilBirthday/DaysUnilBirthdayUITests(iOS)/Credentials.xcconfig`. -It will need values for `EMAIL_SECRET` and `PASSWORD_SECRET`: - -``` -EMAIL_SECRET = ... -PASSWORD_SECRET = ... -``` - -Refer to the repo's Secrets for the values to add to this configuration file. +Locally, both the email and password need to be passed to `xcodebuild` as +arguments: `xcodebuild EMAIL_SECRET=... PASSWORD_SECRET=...`. +Refer to the repo's Secrets for these values. From 34d26b2e1eab652d41a97f879a4f31d46ec22a12 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 14 Jun 2022 17:11:39 -0700 Subject: [PATCH 34/36] Remove space --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0faa5ae6..1ac2adca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,5 +93,5 @@ jobs: -scheme DaysUntilBirthday\(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' \ - EMAIL_SECRET=$EMAIL_SECRET \ + EMAIL_SECRET=$EMAIL_SECRET \ PASSWORD_SECRET=$PASSWORD_SECRET From 9ba5ca33933f47bff4bf52e5b454e4e4ecf02b80 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Tue, 28 Jun 2022 17:29:11 -0700 Subject: [PATCH 35/36] Add scheme and update in tests.yml --- .github/workflows/tests.yml | 4 +- ...cheme => DaysUntilBirthday (iOS).xcscheme} | 0 .../DaysUntilBirthday (macOS).xcscheme | 78 +++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) rename Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/{DaysUntilBirthday(iOS).xcscheme => DaysUntilBirthday (iOS).xcscheme} (100%) create mode 100644 Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (macOS).xcscheme diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ac2adca..07af345d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -79,7 +79,7 @@ jobs: xcodebuild \ -project DaysUntilBirthday.xcodeproj \ build-for-testing \ - -scheme DaysUntilBirthday\(iOS\) \ + -scheme DaysUntilBirthday\ \(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' - name: Run test target for Google Sign-in button for Swift @@ -90,7 +90,7 @@ jobs: xcodebuild \ -project DaysUntilBirthday.xcodeproj \ test-without-building \ - -scheme DaysUntilBirthday\(iOS\) \ + -scheme DaysUntilBirthday\ \(iOS\) \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 11' \ EMAIL_SECRET=$EMAIL_SECRET \ diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (iOS).xcscheme similarity index 100% rename from Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme rename to Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (iOS).xcscheme diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (macOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (macOS).xcscheme new file mode 100644 index 00000000..1b8ddc87 --- /dev/null +++ b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (macOS).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 03fc4af9dd9bdfde500fe978e0681a3ab19be111 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Wed, 29 Jun 2022 19:58:54 -0700 Subject: [PATCH 36/36] Update scheme names --- ...tilBirthday(iOS).xcscheme => DaysUntilBirthday (iOS).xcscheme} | 0 ...irthday(macOS).xcscheme => DaysUntilBirthday (macOS).xcscheme} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/{DaysUntilBirthday(iOS).xcscheme => DaysUntilBirthday (iOS).xcscheme} (100%) rename Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/{DaysUntilBirthday(macOS).xcscheme => DaysUntilBirthday (macOS).xcscheme} (100%) diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (iOS).xcscheme similarity index 100% rename from Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(iOS).xcscheme rename to Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (iOS).xcscheme diff --git a/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(macOS).xcscheme b/Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (macOS).xcscheme similarity index 100% rename from Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday(macOS).xcscheme rename to Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayForPod.xcodeproj/xcshareddata/xcschemes/DaysUntilBirthday (macOS).xcscheme