Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7ed64c9
Icons and styles
Jul 23, 2025
b4dcc20
Instruction files
Jul 23, 2025
c0b588a
All Basic Empty Activities added
Jul 23, 2025
3fc227a
IMP - Integration Test suite
Jul 23, 2025
db7b314
Workflow for CI
Jul 23, 2025
2342d48
Adding ignore to /.idea
Jul 23, 2025
652d2f9
Campaign Trigger Page added
Jul 29, 2025
5bf3a50
In App Message test suite setup
Aug 20, 2025
504fe8c
E2E
Aug 22, 2025
45f5363
Merge branch 'master' into InApp-Display-E2E
Sep 4, 2025
fc46a0d
At a state where things are running
Sep 5, 2025
d3e61a8
Some Important Changes
Sep 6, 2025
547d267
Testing on Github action
Sep 18, 2025
95d5197
google services json template in yml
Sep 18, 2025
fab1dd9
AVD fix
Sep 18, 2025
e1fdc90
Remove multiple device configuration
Sep 19, 2025
e9a0f23
Add time out for waiting for emulator
Sep 19, 2025
cacc3d4
Going to refer an ready to use framework
Sep 19, 2025
6d08c04
Removing unneccessary tasks for now
Sep 19, 2025
99b1a27
turning to intel mac to prevent HVF
Sep 19, 2025
e542c78
Adding BCIT secret keys to android SDK repo
Sep 22, 2025
58789a4
Concentrated tests
Sep 22, 2025
a0f798f
Attempting to parallelize gradle download
Sep 22, 2025
380adf6
Adding debug logs
Sep 22, 2025
26c2560
trigger campaign update
Sep 22, 2025
91af967
Attempt to have only one MVP test
Oct 9, 2025
b08ee02
Emulator configuration changes
Oct 9, 2025
ce6fd3b
"Better Robust Approach" by cursir
Oct 9, 2025
ee52719
Added logs
Oct 9, 2025
e715bd3
Resolving initialization problem
Oct 9, 2025
b3cfc45
Correcting the format. Looks like test ran all ok
Oct 9, 2025
a758765
Verifies Actual display of inapp
Oct 15, 2025
2f85420
Removed lot of unnecessary code
Oct 20, 2025
32c6def
Two config initialization problem
Oct 22, 2025
e0d9444
Retry For sync now removed
Oct 22, 2025
46256fa
URL handler functionality tested
Oct 22, 2025
f5833f9
Using server campaign send in InApp Activity
Oct 22, 2025
02106ba
Added retry if button not found for reliabililty
Oct 22, 2025
2b00b3b
Merge branch 'master' into InApp-Display-E2E
Ayyanchira Oct 22, 2025
81bd57d
Cleaning up further
Oct 22, 2025
e1cd37b
Deleting md files for integration
Oct 22, 2025
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
220 changes: 220 additions & 0 deletions .github/workflows/inapp-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
name: In-App Message E2E Tests

on:
push:
branches: [ InApp-Display-E2E ]
pull_request:
branches: [ InApp-Display-E2E, master, develop ]
workflow_dispatch: # Allow manual triggering

jobs:
inapp-e2e-tests:
name: In-App Message E2E Tests
runs-on: macos-13 # Intel host → HVF works, emulator boots

strategy:
matrix:
api-level: [34] # MVP testing on most relevant API level only

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Android SDK
uses: android-actions/setup-android@v2

- name: Create local.properties
run: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
echo "ndk.dir=$ANDROID_SDK_ROOT/ndk" >> local.properties

- name: Accept Android SDK Licenses
run: |
echo "Accepting Android SDK licenses..."
yes | sdkmanager --licenses || true
echo "SDK licenses accepted"

- name: Setup Google Services Configuration
run: |
echo "Setting up Google Services configuration for CI..."
# Ensure the google-services.json file exists for the build
if [ ! -f "integration-tests/google-services.json" ]; then
echo "Creating google-services.json from template..."
cp integration-tests/google-services.json.template integration-tests/google-services.json
fi
echo "Google Services configuration ready"

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Pre-download Gradle and Build (Parallel with Emulator)
run: |
echo "Pre-downloading Gradle and building while emulator boots..."
# Download Gradle wrapper in background
./gradlew --version &
# Start building APKs in background
./gradlew :integration-tests:assembleDebug :integration-tests:assembleDebugAndroidTest --no-daemon &
echo "Build started in background..."

- name: Run UI Tests with Emulator (Intel / x86_64)
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
profile: pixel_6
cores: 2
ram-size: 3072M
heap-size: 576M
force-avd-creation: true
disable-animations: true
emulator-boot-timeout: 900
emulator-options: -no-window -no-snapshot -gpu swiftshader_indirect -no-boot-anim -camera-back none -partition-size 6000
pre-emulator-launch-script: |
# Clean + start adb after platform-tools exist (avoids tcp:5037 noise)
adb kill-server >/dev/null 2>&1 || true
adb start-server
script: |
echo "Emulator is ready! Running tests..."
echo "Setting up permissions..."
adb shell pm grant com.iterable.integration.tests android.permission.POST_NOTIFICATIONS
adb shell pm grant com.iterable.integration.tests android.permission.INTERNET
adb shell pm grant com.iterable.integration.tests android.permission.ACCESS_NETWORK_STATE
adb shell pm grant com.iterable.integration.tests android.permission.WAKE_LOCK

echo "Running In-App Message MVP test..."
echo "Debug: Checking if APKs are ready..."
ls -la integration-tests/build/outputs/apk/ || echo "APK directory not found"

echo "Debug: Verifying API keys are set..."
echo "ITERABLE_API_KEY length: ${#ITERABLE_API_KEY}"
echo "ITERABLE_SERVER_API_KEY length: ${#ITERABLE_SERVER_API_KEY}"
echo "ITERABLE_TEST_USER_EMAIL: $ITERABLE_TEST_USER_EMAIL"

# Start logcat in background for crash debugging
adb logcat > /tmp/test-logcat.log &
LOGCAT_PID=$!

# Run the specific test with better error handling
./gradlew :integration-tests:connectedDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.iterable.integration.tests.InAppMessageIntegrationTest#testInAppMessageMVP \
--stacktrace --no-daemon || {
echo "Test failed! Collecting crash logs..."
kill $LOGCAT_PID 2>/dev/null || true
echo "=== CRASH LOGS ==="
tail -100 /tmp/test-logcat.log
echo "=== END CRASH LOGS ==="
exit 1
}

# Stop logcat
kill $LOGCAT_PID 2>/dev/null || true
env:
ITERABLE_API_KEY: ${{ secrets.BCIT_ITERABLE_API_KEY }}
ITERABLE_SERVER_API_KEY: ${{ secrets.BCIT_ITERABLE_SERVER_API_KEY }}
ITERABLE_TEST_USER_EMAIL: ${{ secrets.BCIT_ITERABLE_TEST_USER_EMAIL }}

# - name: Generate Test Report
# if: always()
# run: |
# echo "Generating E2E test report..."
# ./gradlew :integration-tests:jacocoIntegrationTestReport

# - name: Collect Test Logs
# if: always()
# run: |
# echo "Collecting E2E test logs..."
# adb logcat -d > integration-tests/build/e2e-test-logs.txt

# # Also collect specific test logs
# adb logcat -d | grep -E "(InAppMessageIntegrationTest|BaseIntegrationTest|IterableApi)" > integration-tests/build/inapp-specific-logs.txt

# - name: Take Screenshots for Debugging
# if: always()
# run: |
# echo "Taking screenshots for debugging..."
# mkdir -p integration-tests/screenshots
# adb shell screencap -p /sdcard/screenshot.png
# adb pull /sdcard/screenshot.png integration-tests/screenshots/final-state-api-${{ matrix.api-level }}.png

# - name: Upload Test Results
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: inapp-e2e-test-results-api-${{ matrix.api-level }}
# path: |
# integration-tests/build/reports/
# integration-tests/build/outputs/
# integration-tests/build/e2e-test-logs.txt
# integration-tests/build/inapp-specific-logs.txt

# - name: Upload Coverage Report
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: inapp-e2e-coverage-api-${{ matrix.api-level }}
# path: integration-tests/build/reports/jacoco/

# - name: Upload Screenshots
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: inapp-e2e-screenshots-api-${{ matrix.api-level }}
# path: integration-tests/screenshots/

# - name: Cleanup
# if: always()
# run: |
# echo "Test cleanup completed"

# test-summary:
# name: Test Summary
# runs-on: ubuntu-latest
# needs: inapp-e2e-tests
# if: always()

# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Download Test Results
# uses: actions/download-artifact@v4
# with:
# name: inapp-e2e-test-results-api-34
# path: test-results/

# - name: Generate Test Summary
# run: |
# echo "## In-App Message E2E Test Results" >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# echo "### Test Execution Summary" >> $GITHUB_STEP_SUMMARY
# echo "- **Branch**: InApp-Display-E2E" >> $GITHUB_STEP_SUMMARY
# echo "- **API Level Tested**: 34" >> $GITHUB_STEP_SUMMARY
# echo "- **Test Method**: testInAppMessageMVP" >> $GITHUB_STEP_SUMMARY
# echo "- **Test Type**: E2E Integration Test" >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# echo "### E2E Test Scenarios" >> $GITHUB_STEP_SUMMARY
# echo "- ✅ User Sign-in Verification" >> $GITHUB_STEP_SUMMARY
# echo "- ✅ In-App Message Trigger" >> $GITHUB_STEP_SUMMARY
# echo "- ✅ Message Display Verification" >> $GITHUB_STEP_SUMMARY
# echo "- ✅ Button Click Interaction" >> $GITHUB_STEP_SUMMARY
# echo "- ✅ Message Dismissal" >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# echo "### Artifacts Available" >> $GITHUB_STEP_SUMMARY
# echo "- Test execution reports" >> $GITHUB_STEP_SUMMARY
# echo "- Code coverage reports" >> $GITHUB_STEP_SUMMARY
# echo "- Debug screenshots" >> $GITHUB_STEP_SUMMARY
# echo "- Detailed test logs" >> $GITHUB_STEP_SUMMARY
Loading
Loading