Fix: Correct free gift selectors for develop version#981
Closed
mattgoud wants to merge 1 commit into
Closed
Conversation
The selectors introduced in PR PrestaShop#972 were wrong: the _product_ segment does not exist in the generated HTML ids. The Symfony form field is named 'free_gift' directly under the root 'discount' form, so the rendered ids are: - #discount_free_gift_search_input (not _product_search_input) - #discount_free_gift_list (not _product_list) - #discount_free_gift_{row} (not _product_{row}) The _product_ suffix was a confusion with the specific_products pattern which is genuinely nested under discount_conditions_product_. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
No need : we wait the PR of @nicosomb to be Merged. |
Contributor
Author
ah ok ! thanks for the info @Progi1984 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The selectors for the free gift product search in the
developversion page object were wrong since PR #972.The
_product_segment was added to the IDs but it does not exist in the rendered HTML. The Symfony form field is namedfree_giftdirectly under the rootdiscountform:Which generates these IDs:
#discount_free_gift#discount_free_gift_search_input#discount_free_gift_listRoot cause
The
_product_suffix was a confusion with thespecific_productspattern which IS genuinely nested underdiscount_conditions_product_(a different sub-form). Thefree_giftfield has no such nesting.The bug was masked until commit
96815717be6in PrestaShop fixed the test data fromdiscountType: 'Free gift'todiscountType: 'free_gift'— this activated the code path that callssetValue()on the broken selector.Fix
Revert the 3 selectors introduced in PR #972 to their correct values (matching the
9.1version).After merge
tests/UI/package.jsonin the PrestaShop repository already points to#main:There is no version bump to do. Once this PR is merged, a
npm installrun intests/UI/is enough to regeneratepackage-lock.jsonwith the new commit SHA, and a dedicated PR must be opened in the PrestaShop repository to commit the updatedpackage-lock.json.