-
Notifications
You must be signed in to change notification settings - Fork 659
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
carlosmuvi-stripe
merged 23 commits into
master
from
carlosmuvi/BANKCON-8162/fc-add-livetesting-oauth-tests
Oct 30, 2023
Merged
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1110a0f
[skip ci] Start PR
carlosmuvi-stripe 8d03a67
Adds livemode tests.
carlosmuvi-stripe 0da01d1
Merge remote-tracking branch 'origin/master' into carlosmuvi/BANKCON-…
carlosmuvi-stripe e6eacec
Updates banks.
carlosmuvi-stripe 081864e
Updates bank check.
carlosmuvi-stripe e7f83fb
Adds test tag to search results.
carlosmuvi-stripe 39d09dc
Runs tests.
carlosmuvi-stripe dadef5f
Updates recording names.
carlosmuvi-stripe 82d47a8
Adds retry policy to maestro tests
carlosmuvi-stripe b0c7c05
Tests
carlosmuvi-stripe 8428ad4
global install
carlosmuvi-stripe d150b77
Retries.
carlosmuvi-stripe dc4b469
Test
carlosmuvi-stripe ae69782
Removes merger.
carlosmuvi-stripe 890bcfe
clones repo.
carlosmuvi-stripe d6a0ec8
clones repo.
carlosmuvi-stripe 5dba540
Adds prepare - conclude.
carlosmuvi-stripe 604a420
Adds prepare - conclude.
carlosmuvi-stripe 01318e8
Updates script.
carlosmuvi-stripe aee7638
Fix button.
carlosmuvi-stripe c09e86e
Test
carlosmuvi-stripe 2c5360d
Reverts test yaml.
carlosmuvi-stripe 6098639
Merge remote-tracking branch 'origin/master' into carlosmuvi/BANKCON-…
carlosmuvi-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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( | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
5 changes: 2 additions & 3 deletions
5
maestro/financial-connections/Testmode-Data-TestOauthInstitution.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
maestro/financial-connections/Testmode-PaymentIntent-TestInstitution-Networking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
maestro/financial-connections/Testmode-PaymentIntent-TestInstitution.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
maestro/financial-connections/Testmode-Token-ManualEntry.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.