Skip to content

VCST-2925: Add wishlist management components and end-to-end tests#167

Open
ToxaKZ wants to merge 4 commits into
devfrom
feat/VCST-2925
Open

VCST-2925: Add wishlist management components and end-to-end tests#167
ToxaKZ wants to merge 4 commits into
devfrom
feat/VCST-2925

Conversation

@ToxaKZ
Copy link
Copy Markdown

@ToxaKZ ToxaKZ commented May 27, 2026

Added E2E coverage for wishlist add/remove/list-management/cart flows.

Changes

  • Added wishlist E2E tests covering:
    • add product to wishlist from category grid view
    • add product to wishlist from category list view
    • add product to wishlist from PDP
    • remove product from wishlist
    • create/edit/delete wishlist
    • create wishlists with Private, Anyone, and Organization scopes
    • add wishlist products to cart
  • Added page objects for:
    • account lists page
    • account list details page
    • product page
    • add/update wishlist modal
    • add-to-wishlists modal
    • delete wishlist modal
    • wishlist card
  • Extended product card page object with add-to-list button.
  • Added cleanup for test-created wishlists and cart state inside the wishlist test module.

Verification

  • python -m compileall page_objects tests\e2e\test_wishlist.py
  • Wishlist E2E passed locally with a valid seeded user.
  • Related cart/category checks passed locally.

@ToxaKZ ToxaKZ requested review from Andrew-Orlov and Lenajava1 May 27, 2026 19:13
Lenajava1 and others added 2 commits May 28, 2026 11:45
- Split test_wishlist.py into four focused files by scenario
- Use `client=` kwarg on ShoppingListOperations/CartOperations
- Move scope-selector capability probe to top of test (was mid-loop)
- Replace prefix-based cleanup with per-test created_ids/try-finally
- Modal components now use Component(root: Locator) contract
- Reuse utils.polling_utils.poll_until instead of custom sleep loops
- Match wishlist/cart GraphQL mutations by operation name
- Use explicit kwarg constructors on AccountListDetailsPage and ProductPage

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add Callable type hint to open_add_to_list parametrize arg
- Move modal locators onto AccountListsPage as settings_modal / delete_modal
- Wrap wishlist and cart teardown blocks in independent try/except
- Use data-test-id locator selector for AddToWishlistsModal checkboxes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Lenajava1
Copy link
Copy Markdown
Collaborator

Hi Anton,

I pushed two follow-up commits on top of your cf594cf to address PR review feedback and a CI regression. Summary of changes:

Refactor (commit be5f733)

  • Split test_wishlist.py (379 lines) into 4 focused files by scenario:
    • test_wishlist_add_product.py — add product to wishlist from grid / list view / PDP
    • test_wishlist_remove_product.py — remove via add-to-list modal
    • test_wishlist_add_all_to_cart.py — add all wishlist products to cart
    • test_wishlist_manage_lists.py — create / edit / remove + scope coverage
  • Use client= kwarg on ShoppingListOperations / CartOperations constructors (matches project convention).
  • Moved scope-selector capability probe to the top of the test instead of mid-loop, so we skip cleanly when the user can''t access org sharing.
  • Replaced prefix-based teardown with per-test created_ids + try/finally — no more cross-test interference, each test cleans up only what it created.
  • Reused utils.polling_utils.poll_until instead of inline sleep loops.
  • Modal components now use the Component(root: Locator) contract — pages own their locators, components don''t take page. This matches AddOrUpdateWishlistModal / DeleteWishlistModal patterns elsewhere.
  • Explicit kwarg constructors on AccountListDetailsPage and ProductPage.

CI regression fix

The be5f733 refactor introduced two issues that broke all 6 wishlist tests on CI (run 26567478109):

  1. get_by_test_id looks for the wrong attribute. Playwright''s get_by_test_id defaults to data-testid (no hyphen), but the storefront uses data-test-id. Reverted the two locators in add_to_wishlists_modal.py to explicit locator("[data-test-id=''...'']").
  2. Strict operationName matchers in page.expect_response(...) never matched the actual GraphQL traffic, causing 30s timeouts. Reverted to the fuzzy "mutation" in post and "wishlist" in post (or "cart") approach you had originally — it''s good enough for these tests and resilient to operation-name churn.

Verified green on run 26568516179 — postgres / mysql / sqlserver all pass.

Let me know if anything looks off!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants