Skip to content

Let checkout tests check the address step before validating it - #1135

Open
oleksandrmaslov wants to merge 1 commit into
PrestaShop:mainfrom
oleksandrmaslov:fix/checkout-fill-addresses
Open

oleksandrmaslov wants to merge 1 commit into
PrestaShop:mainfrom
oleksandrmaslov:fix/checkout-fill-addresses

Conversation

@oleksandrmaslov

Copy link
Copy Markdown
Questions Answers
Description? setAddress() fills the delivery and invoice addresses and validates the step in one call, so a test cannot check the invoice form in between. fillAddresses() does the filling and setAddress() now calls it, its behaviour is unchanged. isUseSameAddressCheckboxVisible() waits for jQuery.active to drop to 0 before it looks, because selecting a country reloads the address form by ajax and a check for a missing checkbox would otherwise pass before the reloaded markup is in. Needed by the UI test for PrestaShop/PrestaShop#42887.
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? N/A
Sponsor company headissue GmbH
How to test? See below

How to test

  1. Load this branch into a shop's UI tests with MAKECMDGOALS=/path/to/shop make test.
  2. Run the 02_useDifferentInvoiceAddress campaigns (Classic and Hummingbird) with the change for Keep the address type when refreshing the address form over AJAX PrestaShop#42887, which calls fillAddresses(), isUseSameAddressCheckboxVisible() and clickOnContinueButtonFromAddressStep() instead of setAddress(): oleksandrmaslov/PrestaShop@fix/39545-keep-address-type-on-refresh...fix/39545-ui-test
  3. Without #42887's fix the checkbox check fails, with it the campaigns pass.

Checked on a 9.2.0-rc.1 shop with Classic and Hummingbird. With the stock code the checkbox check fails with expected true to equal false and every other step passes. With #42887's code both campaigns pass.

Local checks passed (ESLint and library build).

setAddress() fills the addresses and validates the step in one call, so a test
cannot look at the invoice form in between. fillAddresses() does the filling,
and setAddress() now calls it, so its behaviour is unchanged.

isUseSameAddressCheckboxVisible() waits for the address form to be reloaded
after a country change before it checks the checkbox. Without the wait a check
for a missing checkbox passes before the reloaded markup is in.
@oleksandrmaslov
oleksandrmaslov requested a review from a team as a code owner October 26, 2026 09:59
@ps-jarvis

Copy link
Copy Markdown

Hello @oleksandrmaslov!

This is your first pull request on ui-testing-library repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants