Skip to content

Commit 893ccd8

Browse files
authored
Update UI Test CI. (#2830)
1 parent a5c98ee commit 893ccd8

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/reusable-ui-workflow.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ jobs:
4545
if: success() || failure()
4646
run: |
4747
./gradlew native:NativeSampleApps:AuthFlowTester:assembleDebug
48-
- name: Build Tests for PR
49-
if: ${{ inputs.is_pr }}
50-
run: |
51-
./gradlew native:NativeSampleApps:AuthFlowTester:assembleAndroidTest --tests "com.salesforce.samples.authflowtester.loginTest"
52-
- name: Build Tests for Nightly
53-
if: ${{ !inputs.is_pr }}
48+
- name: Build Tests
5449
run: |
5550
./gradlew native:NativeSampleApps:AuthFlowTester:assembleAndroidTest
5651
- uses: 'google-github-actions/auth@v2'
@@ -72,28 +67,32 @@ jobs:
7267
run: |
7368
LEVELS_TO_TEST=$FULL_API_RANGE
7469
RETRIES=0
70+
TEST_TARGETS=""
7571
7672
if $IS_PR ; then
7773
LEVELS_TO_TEST=$PR_API_VERSION
7874
RETRIES=1
75+
# Run only a single test named "testLogin"
76+
TEST_TARGETS="--test-targets \"class com.salesforce.samples.authflowtester.LoginTest#testLogin\""
7977
fi
8078
8179
mkdir firebase_results
8280
for LEVEL in $LEVELS_TO_TEST
8381
do
8482
GCLOUD_RESULTS_DIR=authflowtester-api-${LEVEL}-build-${{github.run_number}}
8583
86-
eval gcloud beta firebase test android run \
84+
eval gcloud firebase test android run \
8785
--project mobile-apps-firebase-test \
8886
--type instrumentation \
8987
--app "native/NativeSampleApps/AuthFlowTester/build/outputs/apk/debug/AuthFlowTester-debug.apk" \
90-
--test="native/NativeSampleApps/AuthFlowTester/build/outputs/apk/androidTest/debug/AuthFlowTester-debug-androidTest.apk" \
88+
--test "native/NativeSampleApps/AuthFlowTester/build/outputs/apk/androidTest/debug/AuthFlowTester-debug-androidTest.apk" \
9189
--device model=MediumPhone.arm,version=${LEVEL},locale=en,orientation=portrait \
9290
--environment-variables username=${CI_USER_USERNAME},password=${CI_USER_PASSWORD} \
9391
--directories-to-pull=/sdcard \
9492
--results-dir=${GCLOUD_RESULTS_DIR} \
9593
--results-history-name=AuthFlowTester \
96-
--timeout=30m --no-performance-metrics \
94+
--timeout=5m --no-performance-metrics \
95+
$TEST_TARGETS \
9796
--num-flaky-test-attempts=${RETRIES} || true
9897
done
9998
- name: Copy Test Results
@@ -141,4 +140,4 @@ jobs:
141140
include_passed: true
142141
include_empty_in_summary: false
143142
simplified_summary: true
144-
report_paths: 'firebase_results/**.xml'
143+
report_paths: 'firebase_results/**.xml'

native/NativeSampleApps/AuthFlowTester/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ android {
8686
getByName("androidTest") {
8787
java.srcDirs(
8888
"src/androidTest/java",
89-
"${rootDir}/external/SalesforceMobileSDK-UITests/Android/app/src/androidTest/java"
89+
"${rootDir}/external/SalesforceMobileSDK-UITests/Android/app/src/androidTest/java/PageObjects",
90+
"${rootDir}/external/SalesforceMobileSDK-UITests/Android/app/src/androidTest/java/TestUtility"
9091
)
9192
}
9293
}
@@ -100,4 +101,4 @@ repositories {
100101

101102
kotlin {
102103
jvmToolchain(17)
103-
}
104+
}

0 commit comments

Comments
 (0)