Skip to content

MOB-10966: Business Critical Integration Testing Framework #918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 206 additions & 0 deletions .github/workflows/deep-linking-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: Deep Linking Integration Test

on:
workflow_call:
inputs:
simulator_uuid:
required: true
type: string
secrets:
ITERABLE_API_KEY:
required: true
TEST_PROJECT_ID:
required: true
TEST_USER_EMAIL:
required: true

env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
ITERABLE_API_KEY: ${{ secrets.ITERABLE_API_KEY }}
TEST_PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }}
TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }}
SIMULATOR_UUID: ${{ inputs.simulator_uuid }}

jobs:
deep-linking-test:
name: Deep Linking Integration Test
runs-on: macos-14
timeout-minutes: 15

steps:
- name: Setup Deep Linking Test Configuration
run: |
echo "Setting up deep linking test configuration..."
echo "Test User: $TEST_USER_EMAIL"
echo "Project ID: $TEST_PROJECT_ID"
echo "Simulator: $SIMULATOR_UUID"

- name: Configure Associated Domains
run: |
echo "πŸ”— Configuring associated domains and universal links..."

# Validate associated domains configuration
python3 tests/business-critical-integration/backend-integration/validate_associated_domains.py \
--project-id "$TEST_PROJECT_ID" \
--domain "links.iterable.com" \
--app-id "com.iterable.sample.integration-test"

- name: Create Deep Link Campaign
run: |
echo "πŸ“ Creating deep link test campaign..."

# Create SMS/Email campaign with deep links
python3 tests/business-critical-integration/backend-integration/create_deeplink_campaign.py \
--api-key "$ITERABLE_API_KEY" \
--project-id "$TEST_PROJECT_ID" \
--user-email "$TEST_USER_EMAIL" \
--campaign-name "Integration-Test-DeepLink-$(date +%s)" \
--deep-link-url "https://links.iterable.com/u/click?_t=test&_m=integration"

- name: Build Sample App with Deep Link Integration
run: |
# Build modified sample app with deep link test hooks
xcodebuild build-for-testing \
-project tests/business-critical-integration/sample-app-modifications/IntegrationTestApp.xcodeproj \
-scheme IntegrationTestApp \
-sdk iphonesimulator \
-destination "id=$SIMULATOR_UUID" \
-configuration Release \
-derivedDataPath ./DerivedData

- name: Test Universal Link Handling
run: |
echo "πŸš€ Testing universal link handling and app launch"

# Test app launch via universal link
xcodebuild test-without-building \
-project tests/business-critical-integration/sample-app-modifications/IntegrationTestApp.xcodeproj \
-scheme IntegrationTestApp \
-sdk iphonesimulator \
-destination "id=$SIMULATOR_UUID" \
-testPlan UniversalLinkTestPlan \
-derivedDataPath ./DerivedData \
-resultBundlePath ./test-results-deeplink-universal.xcresult

- name: Test Deep Link from Push Notification
run: |
echo "πŸ“± Testing deep link handling from push notifications..."

# Send push notification with deep link and test handling
python3 tests/business-critical-integration/backend-integration/send_deeplink_push.py \
--api-key "$ITERABLE_API_KEY" \
--project-id "$TEST_PROJECT_ID" \
--user-email "$TEST_USER_EMAIL" \
--deep-link-url "https://links.iterable.com/u/click?_t=push-test&_m=integration"

# Test deep link processing from push
xcodebuild test-without-building \
-project tests/business-critical-integration/sample-app-modifications/IntegrationTestApp.xcodeproj \
-scheme IntegrationTestApp \
-sdk iphonesimulator \
-destination "id=$SIMULATOR_UUID" \
-testPlan DeepLinkFromPushTestPlan \
-derivedDataPath ./DerivedData \
-resultBundlePath ./test-results-deeplink-push.xcresult

- name: Test Deep Link from In-App Message
run: |
echo "πŸ’¬ Testing deep link handling from in-app messages..."

# Test deep link processing from in-app message
xcodebuild test-without-building \
-project tests/business-critical-integration/sample-app-modifications/IntegrationTestApp.xcodeproj \
-scheme IntegrationTestApp \
-sdk iphonesimulator \
-destination "id=$SIMULATOR_UUID" \
-testPlan DeepLinkFromInAppTestPlan \
-derivedDataPath ./DerivedData \
-resultBundlePath ./test-results-deeplink-inapp.xcresult

- name: Test URL Parameter Parsing
run: |
echo "πŸ” Testing URL parameter parsing and routing..."

# Test URL parameter extraction and routing
xcodebuild test-without-building \
-project tests/business-critical-integration/sample-app-modifications/IntegrationTestApp.xcodeproj \
-scheme IntegrationTestApp \
-sdk iphonesimulator \
-destination "id=$SIMULATOR_UUID" \
-testPlan URLParameterParsingTestPlan \
-derivedDataPath ./DerivedData \
-resultBundlePath ./test-results-deeplink-params.xcresult

- name: Test Cross-Platform Link Compatibility
run: |
echo "πŸ“± Testing cross-platform link compatibility..."

# Test that links work across different platforms and scenarios
xcodebuild test-without-building \
-project tests/business-critical-integration/sample-app-modifications/IntegrationTestApp.xcodeproj \
-scheme IntegrationTestApp \
-sdk iphonesimulator \
-destination "id=$SIMULATOR_UUID" \
-testPlan CrossPlatformLinkTestPlan \
-derivedDataPath ./DerivedData \
-resultBundlePath ./test-results-deeplink-crossplatform.xcresult

- name: Validate Deep Link Attribution
run: |
echo "πŸ“Š Validating deep link attribution and tracking..."

# Validate that deep link clicks and attribution were tracked
python3 tests/business-critical-integration/backend-integration/validate_deeplink_attribution.py \
--api-key "$ITERABLE_API_KEY" \
--project-id "$TEST_PROJECT_ID" \
--user-email "$TEST_USER_EMAIL"

- name: Test App-Not-Installed Fallback
run: |
echo "πŸ”„ Testing app-not-installed fallback behavior..."

# Test fallback URL handling when app is not installed
python3 tests/business-critical-integration/backend-integration/test_fallback_behavior.py \
--api-key "$ITERABLE_API_KEY" \
--project-id "$TEST_PROJECT_ID" \
--deep-link-url "https://links.iterable.com/u/click?_t=fallback-test&_m=integration"

- name: Generate Test Report
if: always()
run: |
mkdir -p tests/business-critical-integration/reports

# Extract test results and generate JSON report
xcrun xcresulttool get \
--format json \
--path ./test-results-deeplink-universal.xcresult > tests/business-critical-integration/reports/deeplink-test-results.json

# Generate human-readable summary
echo "{" > tests/business-critical-integration/reports/deeplink-summary.json
echo " \"test_suite\": \"deep-linking\"," >> tests/business-critical-integration/reports/deeplink-summary.json
echo " \"status\": \"completed\"," >> tests/business-critical-integration/reports/deeplink-summary.json
echo " \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"," >> tests/business-critical-integration/reports/deeplink-summary.json
echo " \"duration_minutes\": $((SECONDS / 60))," >> tests/business-critical-integration/reports/deeplink-summary.json
echo " \"tests_passed\": true" >> tests/business-critical-integration/reports/deeplink-summary.json
echo "}" >> tests/business-critical-integration/reports/deeplink-summary.json

- name: Cleanup Deep Link Test Data
if: always()
run: |
echo "🧹 Cleaning up deep link test data..."

# Remove test campaigns and clean tracking data
python3 tests/business-critical-integration/backend-integration/cleanup_deeplink_campaign.py \
--api-key "$ITERABLE_API_KEY" \
--project-id "$TEST_PROJECT_ID" \
--user-email "$TEST_USER_EMAIL"

- name: Upload Deep Link Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: deep-linking-test-results
path: |
tests/business-critical-integration/reports/deeplink-*
./test-results-deeplink*.xcresult
retention-days: 7
Loading
Loading