Skip to content

Commit

Permalink
Integration tests Web SDK 14+
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomartins8 committed Mar 15, 2024
1 parent 7546fe2 commit 936b0c0
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 8 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: XCUI Tests
on:
workflow_dispatch:
inputs:
SDK_TARGET_VERSION:
description: "Target a specific SDK version. Otherwise latest"
required: false
push:

jobs:
build:
runs-on: macos-13

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.2.0"

- name: Create env file
env:
API_TOKEN: ${{secrets.API_TOKEN}}
WORKFLOW_ID: ${{secrets.WORKFLOW_ID}}
SDK_TARGET_VERSION: ${{github.event.inputs.SDK_TARGET_VERSION}}
run: |
cd SmartCaptureDemo/EnvironmentVariables
touch Env.xcconfig
echo API_TOKEN="$API_TOKEN" >> Env.xcconfig
echo WORKFLOW_ID="$WORKFLOW_ID" >> Env.xcconfig
echo SDK_TARGET_VERSION="$SDK_TARGET_VERSION" >> Env.xcconfig
- name: Build and test
run: |
xcodebuild \
clean build test \
-project SmartCaptureDemo.xcodeproj \
-scheme SmartCaptureDemo \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro'
146 changes: 138 additions & 8 deletions SmartCaptureDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
701A39852B95D4E500CB1BF8 /* Env.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 701A39842B95D4E500CB1BF8 /* Env.xcconfig */; };
70845DA12BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70845DA02BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.swift */; };
878C0A572B86525700781853 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCB28EB728D358A5008273D4 /* AppDelegate.swift */; };
878C0A582B86525700781853 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCB28EB928D358A5008273D4 /* SceneDelegate.swift */; };
878C0A592B86525700781853 /* WebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCB28ECB28D35937008273D4 /* WebViewViewController.swift */; };
Expand All @@ -24,8 +25,20 @@
FCB28EC428D358A7008273D4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FCB28EC228D358A7008273D4 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
70845DA42BA45EDF00D6D1E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FCB28EAC28D358A5008273D4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = FCB28EB328D358A5008273D4;
remoteInfo = SmartCaptureDemo;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
701A39842B95D4E500CB1BF8 /* Env.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Env.xcconfig; sourceTree = "<group>"; };
70845D9E2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SmartCaptureDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
70845DA02BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmartCaptureDemoUITests.swift; sourceTree = "<group>"; };
8734E7A12B864FE2009D81F1 /* ApiEndpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiEndpoint.swift; sourceTree = "<group>"; };
8734E7A22B864FE2009D81F1 /* ApiManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiManager.swift; sourceTree = "<group>"; };
8734E7A32B864FE2009D81F1 /* ApiManagerError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiManagerError.swift; sourceTree = "<group>"; };
Expand All @@ -45,6 +58,13 @@
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
70845D9B2BA45EDF00D6D1E9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FCB28EB128D358A5008273D4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -55,6 +75,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
70845D9F2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests */ = {
isa = PBXGroup;
children = (
70845DA02BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.swift */,
);
path = SmartCaptureDemoUITests;
sourceTree = "<group>";
};
9BD193192BA1CC4E0076E6E6 /* EnvironmentVariables */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -114,6 +142,7 @@
isa = PBXGroup;
children = (
FCB28EB628D358A5008273D4 /* SmartCaptureDemo */,
70845D9F2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests */,
FCB28EB528D358A5008273D4 /* Products */,
);
sourceTree = "<group>";
Expand All @@ -122,6 +151,7 @@
isa = PBXGroup;
children = (
FCB28EB428D358A5008273D4 /* SmartCaptureDemo.app */,
70845D9E2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -145,6 +175,24 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
70845D9D2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 70845DA62BA45EDF00D6D1E9 /* Build configuration list for PBXNativeTarget "SmartCaptureDemoUITests" */;
buildPhases = (
70845D9A2BA45EDF00D6D1E9 /* Sources */,
70845D9B2BA45EDF00D6D1E9 /* Frameworks */,
70845D9C2BA45EDF00D6D1E9 /* Resources */,
);
buildRules = (
);
dependencies = (
70845DA52BA45EDF00D6D1E9 /* PBXTargetDependency */,
);
name = SmartCaptureDemoUITests;
productName = SmartCaptureDemoUITests;
productReference = 70845D9E2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
FCB28EB328D358A5008273D4 /* SmartCaptureDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = FCB28EC828D358A7008273D4 /* Build configuration list for PBXNativeTarget "SmartCaptureDemo" */;
Expand All @@ -171,9 +219,13 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1400;
LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 1400;
TargetAttributes = {
70845D9D2BA45EDF00D6D1E9 = {
CreatedOnToolsVersion = 15.3;
TestTargetID = FCB28EB328D358A5008273D4;
};
FCB28EB328D358A5008273D4 = {
CreatedOnToolsVersion = 14.0;
};
Expand All @@ -195,11 +247,19 @@
projectRoot = "";
targets = (
FCB28EB328D358A5008273D4 /* SmartCaptureDemo */,
70845D9D2BA45EDF00D6D1E9 /* SmartCaptureDemoUITests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
70845D9C2BA45EDF00D6D1E9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FCB28EB228D358A5008273D4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -214,6 +274,14 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
70845D9A2BA45EDF00D6D1E9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
70845DA12BA45EDF00D6D1E9 /* SmartCaptureDemoUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
878C0A522B86523300781853 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -234,6 +302,14 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
70845DA52BA45EDF00D6D1E9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = FCB28EB328D358A5008273D4 /* SmartCaptureDemo */;
targetProxy = 70845DA42BA45EDF00D6D1E9 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
FCB28EC228D358A7008273D4 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
Expand All @@ -246,6 +322,53 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
70845DA72BA45EDF00D6D1E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 2X946JA9UV;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.onfido.SmartCaptureDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = SmartCaptureDemo;
};
name = Debug;
};
70845DA82BA45EDF00D6D1E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 2X946JA9UV;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.onfido.SmartCaptureDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = SmartCaptureDemo;
};
name = Release;
};
FCB28EC628D358A7008273D4 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 701A39842B95D4E500CB1BF8 /* Env.xcconfig */;
Expand Down Expand Up @@ -370,7 +493,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3DF7TM3Y9C;
DEVELOPMENT_TEAM = 2X946JA9UV;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SmartCaptureDemo/Info.plist;
INFOPLIST_KEY_NSMicrophoneUsageDescription = "Permission needed for Onfido SDK work. You should add your own message here.";
Expand Down Expand Up @@ -401,11 +524,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2X946JA9UV;
DEVELOPMENT_TEAM = 2X946JA9UV;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SmartCaptureDemo/Info.plist;
INFOPLIST_KEY_NSMicrophoneUsageDescription = "Permission needed for Onfido SDK work. You should add your own message here.";
Expand All @@ -422,10 +544,9 @@
MARKETING_VERSION = 1.0;
NEW_SETTING = "";
NEW_SETTING1 = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.onfido.smart-capture-demo-app";
PRODUCT_BUNDLE_IDENTIFIER = "com.onfido.limited.smart-capture-demo-app";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "smart-capture-demo-inhouse-pp";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -435,6 +556,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
70845DA62BA45EDF00D6D1E9 /* Build configuration list for PBXNativeTarget "SmartCaptureDemoUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
70845DA72BA45EDF00D6D1E9 /* Debug */,
70845DA82BA45EDF00D6D1E9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FCB28EAF28D358A5008273D4 /* Build configuration list for PBXProject "SmartCaptureDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "70845D9D2BA45EDF00D6D1E9"
BuildableName = "SmartCaptureDemoUITests.xctest"
BlueprintName = "SmartCaptureDemoUITests"
ReferencedContainer = "container:SmartCaptureDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
18 changes: 18 additions & 0 deletions SmartCaptureDemoUITests/SmartCaptureDemoUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// SmartCaptureDemoUITests.swift
// SmartCaptureDemoUITests
//
// Created by Sérgio de Oliveira Martins on 15/03/2024.
//

import XCTest

final class SmartCaptureDemoUITests: XCTestCase {
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}

0 comments on commit 936b0c0

Please sign in to comment.