Skip to content

Commit 7c821ad

Browse files
authored
Properly handle UI Test Config. (#2827)
* Fix PR and Nightly workflows after reusable-workflow rename. * Move UI Test Config to shared/test. * Add users section to ui_test_config.json.sample.
1 parent 8d4e806 commit 7c821ad

5 files changed

Lines changed: 29 additions & 8 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
env:
1212
BUNDLE_GEMFILE: ${{ github.workspace }}/.github/DangerFiles/Gemfile
13-
CI_USER_USERNAME: ${{ secrets.CI_USER_USERNAME }}
14-
CI_USER_PASSWORD: ${{ secrets.CI_USER_PASSWORD }}
15-
TEST_CONFIG: ${{ secrets.UI_TEST_CONFIG }}
1613
steps:
1714
- uses: actions/checkout@v4
1815
if: ${{ inputs.is_pr }}
@@ -27,10 +24,11 @@ jobs:
2724
- name: Install Dependencies
2825
env:
2926
TEST_CREDENTIALS: ${{ secrets.TEST_CREDENTIALS }}
27+
UI_TEST_CONFIG: ${{ secrets.UI_TEST_CONFIG }}
3028
run: |
3129
./install.sh
3230
echo $TEST_CREDENTIALS > ./shared/test/test_credentials.json
33-
echo $TEST_CONFIG > ./native/NativeSampleApps/AuthFlowTester/src/main/assets/test_config.json
31+
echo $UI_TEST_CONFIG > ./shared/test/ui_test_config.json
3432
- uses: actions/setup-java@v4
3533
with:
3634
distribution: 'zulu'
@@ -69,6 +67,8 @@ jobs:
6967
PR_API_VERSION: "35"
7068
FULL_API_RANGE: "28 29 30 31 32 33 34 35 36"
7169
IS_PR: ${{ inputs.is_pr }}
70+
CI_USER_USERNAME: ${{ secrets.CI_USER_USERNAME }}
71+
CI_USER_PASSWORD: ${{ secrets.CI_USER_PASSWORD }}
7272
run: |
7373
LEVELS_TO_TEST=$FULL_API_RANGE
7474
RETRIES=0

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ package-lock.json
2020
yarn.lock
2121
index.android.bundle*
2222
shared/test/test_credentials.json
23-
.vscode/
24-
test_config.json
23+
shared/test/ui_test_config.json
24+
native/NativeSampleApps/AuthFlowTester/src/main/assets/
25+
.vscode/

native/NativeSampleApps/AuthFlowTester/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ android {
8080
}
8181

8282
sourceSets {
83+
getByName("main") {
84+
assets.srcDirs("${rootDir}/shared/test")
85+
}
8386
getByName("androidTest") {
8487
java.srcDirs(
8588
"src/androidTest/java",

native/NativeSampleApps/AuthFlowTester/src/main/java/com/salesforce/samples/authflowtester/AuthFlowTesterApplication.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AuthFlowTesterApplication : Application() {
5656
var oauthConfig: OAuthConfig? = null
5757
val jsonConfig = ResourceReaderHelper.readAssetFile(
5858
/* ctx = */ this@AuthFlowTesterApplication,
59-
/* assetFilePath = */ "test_config.json",
59+
/* assetFilePath = */ "ui_test_config.json",
6060
)
6161

6262
if (jsonConfig != null) {
@@ -92,4 +92,4 @@ class AuthFlowTesterApplication : Application() {
9292
}
9393
}
9494
}
95-
}
95+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"loginHost": "__INSERT_LOGIN_URL__",
3+
"apps": [
4+
{
5+
"name": "__INSERT_APP_NAME__",
6+
"consumerKey": "__INSERT_CONSUMER_KEY__",
7+
"redirectUri": "__INSERT_REDIRECT_URI__",
8+
"scopes": "__INSERT_SCOPES__"
9+
}
10+
],
11+
"users": [
12+
{
13+
"username": "__INSERT_USERNAME__",
14+
"password": "__INSERT_PASSWORD__"
15+
}
16+
]
17+
}

0 commit comments

Comments
 (0)