-
Notifications
You must be signed in to change notification settings - Fork 4
Promote cart-hardcoded-buyer-identity test to run on swift/kotlin
#560
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
Merged
kieran-osgood-shopify
merged 1 commit into
main
from
kieran-osgood/e2e-checkout-hardcoded-buyer-identity
Aug 18, 2026
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| appId: ${E2E_APP_ID} | ||
| --- | ||
| # The payment provider and the order creation both run before the page changes, so this | ||
| # wait covers two remote systems rather than a render. | ||
| - extendedWaitUntil: | ||
| visible: "${POST_SUBMIT_RESULT_PATTERN}" | ||
| timeout: 10000 | ||
| timeout: 60000 |
This file contains hidden or 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 hidden or 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 hidden or 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,43 @@ | ||
| appId: ${E2E_APP_ID} | ||
| --- | ||
| # Checkout offers a "use the shipping address" control only when it can copy the address | ||
| # the cart supplied. The samples build their carts through different mutations, so one | ||
| # target gets the control and another gets an empty billing form. The scroll below stops | ||
| # at whichever the target shows, and the branch fills the form only when there is one. | ||
| - scrollUntilVisible: | ||
| element: | ||
| text: "^(Billing address|Use shipping address as billing address)$" | ||
| direction: DOWN | ||
| centerElement: true | ||
| - runFlow: | ||
| when: | ||
| visible: "^Billing address$" | ||
| commands: | ||
| # Country/Region and Province already hold the shop defaults, so this flow leaves | ||
| # them alone and supplies an address that suits those defaults. | ||
| - scrollUntilVisible: | ||
| element: | ||
| text: "^First name( \\(optional\\))?$" | ||
| direction: DOWN | ||
| centerElement: true | ||
| - tapOn: | ||
| text: "^First name( \\(optional\\))?$" | ||
| - inputText: "${BILLING_FIRST_NAME}" | ||
| - runFlow: dismiss-active-field.yaml | ||
| - tapOn: | ||
| text: "^Last name$" | ||
| - inputText: "${BILLING_LAST_NAME}" | ||
| - runFlow: dismiss-active-field.yaml | ||
| - tapOn: | ||
| text: "^Address$" | ||
| - inputText: "${BILLING_ADDRESS_LINE1}" | ||
| - runFlow: dismiss-active-field.yaml | ||
| - tapOn: | ||
| text: "^City$" | ||
| - inputText: "${BILLING_CITY}" | ||
| - runFlow: dismiss-active-field.yaml | ||
| - tapOn: | ||
| text: "^Postal code$" | ||
| - inputText: "${BILLING_POSTAL_CODE}" | ||
| - runFlow: dismiss-active-field.yaml | ||
| - waitForAnimationToEnd |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,10 +1,32 @@ | ||
| appId: ${E2E_APP_ID} | ||
| --- | ||
| # The keyboard from the last payment field can still cover the foot of the page, so the | ||
| # control has to reach the middle of the screen before the tap. `centerElement` does that. | ||
| # A `visibilityPercentage` below 100 rounds down to zero, which lets the scroll stop early, | ||
| # and a tap that lands on the keyboard does nothing while Maestro still reports it as done. | ||
| - scrollUntilVisible: | ||
| element: | ||
| text: "^(Pay now|Complete order)$" | ||
| text: "^(Pay now|Complete order|Review order)$" | ||
| direction: DOWN | ||
| visibilityPercentage: 90 | ||
| centerElement: true | ||
|
|
||
| # A shop that shows shipping options keeps the pay action behind a review step. One button | ||
| # carries both labels, so the review tap comes first and the pay tap follows it. | ||
| - runFlow: | ||
| when: | ||
| visible: "^Review order$" | ||
| commands: | ||
| - tapOn: | ||
| text: "^Review order$" | ||
| enabled: true | ||
| - extendedWaitUntil: | ||
| visible: "^(Pay now|Complete order)$" | ||
| timeout: 30000 | ||
| - scrollUntilVisible: | ||
| element: | ||
| text: "^(Pay now|Complete order)$" | ||
| direction: DOWN | ||
| centerElement: true | ||
| - tapOn: | ||
| text: "^(Pay now|Complete order)$" | ||
| enabled: true |
This file contains hidden or 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,31 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require "minitest/autorun" | ||
| require "yaml" | ||
|
|
||
| class CheckoutPaymentFixtureTest < Minitest::Test | ||
| E2E_ROOT = File.expand_path("..", __dir__) | ||
| CHECKOUT_PATH = File.join(E2E_ROOT, "tests", "shared", "checkout-hardcoded-buyer-identity.yaml") | ||
| PAYMENT_FLOW_PATH = File.join(E2E_ROOT, "flows", "checkout", "fill-payment-card.yaml") | ||
|
|
||
| def yaml_documents(path) | ||
| File.read(path).split(/^---\s*$/).map { |document| YAML.safe_load(document) } | ||
| end | ||
|
|
||
| def test_successful_checkout_uses_the_bogus_gateway_approval_number | ||
| checkout = yaml_documents(CHECKOUT_PATH).first | ||
|
|
||
| assert_equal "1", checkout.fetch("env").fetch("CARD_NUMBER") | ||
| assert_equal "1", checkout.fetch("env").fetch("CARD_NUMBER_DISPLAY") | ||
| end | ||
|
|
||
| def test_payment_flow_replaces_the_prefilled_cardholder_name | ||
| commands = yaml_documents(PAYMENT_FLOW_PATH).last | ||
| name_field_index = commands.index { |command| command.is_a?(Hash) && command.dig("tapOn", "text") == "^Name on card$" } | ||
| erase_index = commands.index("eraseText") | ||
| cardholder_name_index = commands.index { |command| command == {"inputText" => "${CARD_HOLDER_NAME}"} } | ||
|
|
||
| assert_equal name_field_index + 2, erase_index | ||
| assert_equal erase_index + 1, cardholder_name_index | ||
| end | ||
| end |
This file contains hidden or 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 hidden or 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
24 changes: 0 additions & 24 deletions
24
e2e/tests/react-native/checkout-hardcoded-buyer-identity.yaml
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,39 @@ | ||
| appId: ${E2E_APP_ID} | ||
|
Contributor
Author
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. Moved here from e2e/tests/react-native |
||
| name: Checkout with hardcoded buyer identity | ||
| tags: | ||
| - checkout | ||
| # This test submits a real order, so it belongs to the expensive tier. | ||
| - full | ||
|
|
||
| env: | ||
| # The cart carries the contact and the delivery address, so checkout asks for payment | ||
| # only. That makes this the shortest real order, and the first one to fix when checkout | ||
| # breaks. | ||
| E2E_CART_PARAMS: "productIndex=0&quantity=1&buyerIdentityMode=hardcoded" | ||
|
|
||
| # Checkout payment fixture. The shop runs the bogus gateway, which rejects real card | ||
| # brands and reads a single digit instead: 1 approves, 2 declines, 3 fails the gateway. | ||
| CARD_NUMBER: "1" | ||
| CARD_NUMBER_DISPLAY: "1" | ||
| CARD_SECURITY_CODE: "123" | ||
| CARD_HOLDER_NAME: "Maestro Shopify" | ||
|
|
||
| # Checkout billing fixture. The cart supplies a one-time delivery address, which the | ||
| # billing section cannot copy, so the test types a billing address of its own. Country | ||
| # and province keep the shop defaults, so this address stays in Canada. | ||
| BILLING_FIRST_NAME: "Maestro" | ||
| BILLING_LAST_NAME: "Shopify" | ||
| BILLING_ADDRESS_LINE1: "620 King Street West" | ||
| BILLING_CITY: "Toronto" | ||
| BILLING_POSTAL_CODE: "M5V 1M7" | ||
|
|
||
| # Accepted successful checkout states for this smoke test. | ||
| POST_SUBMIT_RESULT_PATTERN: ".*(Thank you|Your order|Order confirmed|confirmation).*" | ||
| --- | ||
| - runFlow: ../../flows/app/bootstrap-cart-from-link.yaml | ||
| - runFlow: ../../flows/checkout/present.yaml | ||
| - runFlow: ../../flows/checkout/fill-payment-card.yaml | ||
| - runFlow: ../../flows/checkout/fill-billing-address.yaml | ||
| - runFlow: ../../flows/checkout/submit.yaml | ||
| - runFlow: ../../flows/checkout/assert-complete.yaml | ||
| - runFlow: ../../flows/checkout/assert-returned-to-empty-cart.yaml | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
This gets removed in #561 when we promote guest to run on kotlin/swift