Skip to content

Wait for the page load after a legacy bulk action, not for the # navigation [OS-161] - #1143

Open
mattgoud wants to merge 1 commit into
PrestaShop:mainfrom
mattgoud:fix/legacy-bulk-action-wait-for-page-load
Open

mattgoud wants to merge 1 commit into
PrestaShop:mainfrom
mattgoud:fix/legacy-bulk-action-wait-for-page-load

Conversation

@mattgoud

@mattgoud mattgoud commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Questions Answers
Branch? main
Description? The bulk action links of the core legacy lists are <a href="#" onclick="...sendBulkAction(...)">, so on the cores released so far the click first navigates to <current URL>#, then the form is posted. clickAndWaitForURL waits for any URL change and resolves on that #, before the POST is even sent, so the page object reads the page of the previous step. This is how BO - Catalog price Rules : Bulk actions > should try to bulk delete cart rules failed twice in a row on 9.2.x (PrestaShop/PrestaShop#43420): it found the "Successful creation" alert of the previous step, then waited for a success alert on the POST page, which only has the error. This adds clickAndWaitForPageLoad, which waits for the load event of the new page (a same-document navigation fires none), and uses it for every legacy bulk action link: catalog price rules, cart rules, shop URLs, customer groups, stores (develop), countries, tax rules, quick access, tags (9.1), carriers and aliases (8.2). clickAndWaitForURL itself is left as it is, other callers may wait for an anchor navigation on purpose. Waiting for the submitBulk URL would not do either: on success the controller redirects to &conf=2, and that URL never shows.
Type? bug fix
Category? TE
BC breaks? no
Deprecations? no
How to test? The full UI campaign of the validation pull requests below must be green, and functional:BO:catalog:07-08 should pass "BO - Catalog price Rules : Bulk actions" without retries.
UI Tests 9.2.x: ⏳ https://github.com/mattgoud/ga.tests.ui.pr/actions/runs/41435208637 (PrestaShop/PrestaShop#43422), develop: ⏳ https://github.com/mattgoud/ga.tests.ui.pr/actions/runs/41435214413 (PrestaShop/PrestaShop#43423)
Fixed issue or discussion? Part of PrestaShop/PrestaShop#43420
Related PRs PrestaShop/PrestaShop#43421 (removes the # navigation in the core, from 9.2.x on)
Sponsor company @PrestaShopCorp

.ai conventions: 🟢 .ai/CONTEXT.md, .ai/Component/Playwright/CONTEXT.md (core); hygiene script clean, tsc and ESLint clean on the touched files

Verification

bulkDeletePriceRules from the built library, called the way the campaign does it: on the list right after "Successful creation" (&conf=3), with no row selected (expects "You must select at least one element to delete.") and with all rows selected (expects "The selection has been successfully deleted."), on a local 9.2.x shop:

Core Library No row selected All rows selected
9.2.x (with the #) main 3 / 10 passed, 7 timeouts as on the CI 10 / 10
9.2.x (with the #) this branch 10 / 10 10 / 10
9.2.x + PrestaShop/PrestaShop#43421 main 10 / 10 10 / 10
9.2.x + PrestaShop/PrestaShop#43421 this branch 5 / 5 5 / 5

The library is needed even once the core fix is merged: it also runs against released cores that keep the #. The 9.1 and 8.2 overrides are only used against those cores, which no core branch campaign runs; they get the same one-word change.

@Progi1984 Progi1984 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have you tested on differents versions of PrestaShop (8.2, 9, 9.1, 9.2) ?

@nicosomb nicosomb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Waiting for the load event works with and without the core fix (PrestaShop#43421), and the develop pages that keep clickAndWaitForURL on bulk links are Symfony grids. Progi1984's question is still open: only 9.2.x and develop have UI runs (PrestaShop#43422 / #43423), while 8.2 and 9.1 page objects change too.

@ps-jarvis ps-jarvis added the Waiting for QA Status: Action required, Waiting for test feedback label Nov 3, 2026
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Nov 3, 2026
@Progi1984 Progi1984 removed the Waiting for QA Status: Action required, Waiting for test feedback label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To be tested

Development

Successfully merging this pull request may close these issues.

4 participants