Skip to content
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

[FC] Add livetesting OAuth tests + some Maestro improvements #7514

Merged
Merged
Show file tree
Hide file tree
Changes from 7 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
16 changes: 11 additions & 5 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ project_type: android
trigger_map:
- push_branch: 'master'
pipeline: main-trigger-pipeline
- pull_request_source_branch: '*'
pipeline: main-trigger-pipeline
- pull_request_source_branch: 'carlosmuvi/BANKCON-8162/fc-add-livetesting-oauth-tests'
pipeline: pipeline-connections-e2e-release-tests
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temp - revert once tests run.

app:
envs:
- GRADLE_OPTS: -Dkotlin.incremental=false
Expand Down Expand Up @@ -46,6 +46,7 @@ stages:
workflows:
- run-connections-e2e-payments-tests: { }
- run-connections-e2e-data-tests: { }
- run-connections-e2e-livemode-tests: { }
stage-notify-connections-e2e-failure:
should_always_run: true
workflows:
Expand Down Expand Up @@ -101,12 +102,17 @@ workflows:
- pipeline_intermediate_files: "$BITRISE_APK_PATH:BITRISE_APK_PATH"
run-connections-e2e-payments-tests:
envs:
- MAESTRO_TAGS: payment
- MAESTRO_TAGS: testmode-payments
before_run:
- _run-connections-e2e-tests
run-connections-e2e-data-tests:
envs:
- MAESTRO_TAGS: data
- MAESTRO_TAGS: testmode-data
before_run:
- _run-connections-e2e-tests
run-connections-e2e-livemode-tests:
envs:
- MAESTRO_TAGS: livemode-data
before_run:
- _run-connections-e2e-tests
_run-connections-e2e-tests:
Expand Down Expand Up @@ -165,7 +171,7 @@ workflows:
inputs:
- content: |-
#!/usr/bin/env bash
bash ./scripts/execute_maestro_tests.sh -t all
bash ./scripts/execute_maestro_tests.sh -t edge
- slack@3:
is_always_run: true
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ enum class Merchant(val apiValue: String) {
App2App("app2app"),
Networking("networking"),
NetworkingTestMode("networking_testmode"),
Livetesting("live_testing"),
Other("other");

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
Expand All @@ -43,12 +43,16 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTagsAsResourceId
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
Expand Down Expand Up @@ -319,9 +323,16 @@ private fun SearchInstitutionsList(
}
}
} else {
items(institutions().data, key = { it.id }) { institution ->
InstitutionResultTile({ onInstitutionSelected(it, false) }, institution)
}
itemsIndexed(
items = institutions().data,
key = { _, institution -> institution.id },
itemContent = { index, institution ->
InstitutionResultTile(
institution = institution,
index = index
) { onInstitutionSelected(it, false) }
}
)
if (institutions().showManualEntry == true) {
item {
Divider(
Expand Down Expand Up @@ -413,15 +424,19 @@ private fun ManualEntryRow(onManualEntryClick: () -> Unit) {
}
}

@OptIn(ExperimentalComposeUiApi::class)
@Composable
private fun InstitutionResultTile(
onInstitutionSelected: (FinancialConnectionsInstitution) -> Unit,
institution: FinancialConnectionsInstitution
institution: FinancialConnectionsInstitution,
index: Int,
onInstitutionSelected: (FinancialConnectionsInstitution) -> Unit
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxSize()
.semantics { testTagsAsResourceId = true }
.testTag("search_result_$index")
Comment on lines +438 to +439
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes result list clickable by index in tests.

.clickableSingle { onInstitutionSelected(institution) }
.padding(
vertical = 8.dp,
Expand Down
48 changes: 48 additions & 0 deletions maestro/financial-connections/Livemode-Data-Finbank.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
appId: com.stripe.android.financialconnections.example
tags:
- all
- livemode-data
---
- startRecording: /tmp/test_results/testmode-data-testoauthinstitution
- openLink: stripeconnectionsexample://playground?flow=Data&financial_connections_override_native=native&merchant=live_testing
- tapOn: "Connect Accounts!"
# Wait until the consent button is visible
- extendedWaitUntil:
visible:
id: "consent_cta"
timeout: 30000
# Common: web AuthFlow - connect OAuth institution
- tapOn: "Agree and continue"
# SEARCH AND SELECT FINBANK INSTITUTION
- tapOn: "Search"
- inputText: "finbank"
- tapOn:
id: "search_result_0"
####### Bypass Chrome on-boarding screen #######
- runFlow:
file: ../common/subflow-skip-chrome-welcome.yaml
# LOG IN WITH TEST FINBANK INSTITUTION
- extendedWaitUntil:
visible:
text: "Image of FinBank logo"
timeout: 30000
- tapOn: "Banking Userid "
- inputText: "f_i_n"
- tapOn: "Banking Password "
- inputText: "b_a_n_k"
- tapOn: "Submit"
###############################################
# SELECT ALL ACCOUNTS
- extendedWaitUntil:
visible: "Select all accounts"
timeout: 60000
- tapOn: "Select all accounts" # select all accounts
- tapOn:
text: "Link accounts"
retryTapIfNoChange: false
# CONFIRM AND COMPLETE
- assertVisible: ".*Success.*"
- tapOn: "Done"
- assertVisible: ".*Completed!.*"
- assertVisible: ".*FinBank.*"
- stopRecording
35 changes: 35 additions & 0 deletions maestro/financial-connections/Livemode-Data-MXBank.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
appId: com.stripe.android.financialconnections.example
tags:
- all
- livemode-data
---
- startRecording: /tmp/test_results/testmode-data-testoauthinstitution
- openLink: stripeconnectionsexample://playground?flow=Data&financial_connections_override_native=native&merchant=live_testing
- tapOn: "Connect Accounts!"
# Wait until the consent button is visible
- extendedWaitUntil:
visible:
id: "consent_cta"
timeout: 30000
# Common: web AuthFlow - connect OAuth institution
- tapOn: "Agree and continue"
# SEARCH AND SELECT FINBANK INSTITUTION
- tapOn: "Search"
- inputText: "mx"
- tapOn:
id: "search_result_1"
- tapOn: "Continue"
####### Bypass Chrome on-boarding screen #######
- runFlow:
file: ../common/subflow-skip-chrome-welcome.yaml
# LOG IN WITH TEST FINBANK INSTITUTION
- tapOn: "Authorize"
###############################################
# SELECT ALL ACCOUNTS
# - Mx bank skips account selection
# CONFIRM AND COMPLETE
- assertVisible: ".*Success.*"
- tapOn: "Done"
- assertVisible: ".*Completed!.*"
- assertVisible: ".*MX Bank.*"
- stopRecording
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
appId: com.stripe.android.financialconnections.example
tags:
- all
- testmode
- native
- data
- edge
- testmode-data
---
- startRecording: /tmp/test_results/testmode-data-testoauthinstitution
- openLink: stripeconnectionsexample://playground?flow=Data&financial_connections_override_native=native&merchant=testmode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
appId: com.stripe.android.financialconnections.example
tags:
- all
- testmode
- native
- payment
- edge
- testmode-payments
---
- startRecording: /tmp/test_results/testmode-paymentintent-testinstitution-networking
- openLink: stripeconnectionsexample://playground?flow=PaymentIntent&financial_connections_override_native=native&merchant=networking_testmode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
appId: com.stripe.android.financialconnections.example
tags:
- all
- testmode
- native
- payment
- edge
- testmode-payments
---
- startRecording: /tmp/test_results/testmode-paymentintent-testinstitution
- openLink: stripeconnectionsexample://playground?flow=PaymentIntent&financial_connections_override_native=native&merchant=testmode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
appId: com.stripe.android.financialconnections.example
tags:
- all
- testmode
- native
- token
- edge
- testmode-data
---
- startRecording: /tmp/test_results/testmode-token_manualentry
- openLink: stripeconnectionsexample://playground?flow=Token&financial_connections_override_native=native&merchant=testmode
Expand Down
2 changes: 1 addition & 1 deletion scripts/execute_maestro_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ then
exit 1
fi

export MAESTRO_VERSION=1.31.0
export MAESTRO_VERSION=1.33.1

# Retry mechanism for Maestro installation
MAX_RETRIES=3
Expand Down
Loading