Skip to content

feat: add the create newsletter recipient request#648

Open
suri-ta777 wants to merge 8 commits into
trunkfrom
test/add-checkout-with-promotion-discount-rule
Open

feat: add the create newsletter recipient request#648
suri-ta777 wants to merge 8 commits into
trunkfrom
test/add-checkout-with-promotion-discount-rule

Conversation

@suri-ta777

@suri-ta777 suri-ta777 commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • adding the support func for create newsletter recipient in the TestDataService
  • adding the product line items locator for checkout confirm and off canvas cart page

Test Scenario Detail

  1. Admin creates promotion with rule Newsletter recipient = Yes (will automatically receive discount - 10% at checkout)
  2. Shop user:
  • registers the newsletter recipient
  • adds product to cart
  • validate promotion applied on checkout + confirm page and creating order

Related to test CheckoutWithPromotionRule.spec.ts in PR 17408

@suri-ta777 suri-ta777 requested a review from a team as a code owner June 19, 2026 06:46
@pkg-pr-new

pkg-pr-new Bot commented Jun 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/shopware/acceptance-test-suite/@shopware-ag/acceptance-test-suite@648

commit: 9688af6

@suri-ta777 suri-ta777 changed the title test/add-the-create-newsletter-recipient-request test: add-the-create-newsletter-recipient-request Jun 19, 2026
@suri-ta777 suri-ta777 changed the title test: add-the-create-newsletter-recipient-request test: add the create newsletter recipient request Jun 19, 2026
@suri-ta777 suri-ta777 force-pushed the test/add-checkout-with-promotion-discount-rule branch from 7eda74e to cf5e02a Compare June 21, 2026 07:37
@suri-ta777 suri-ta777 self-assigned this Jun 22, 2026
@suri-ta777 suri-ta777 force-pushed the test/add-checkout-with-promotion-discount-rule branch 2 times, most recently from f224c4f to 017ed00 Compare June 22, 2026 10:35
Comment thread src/page-objects/storefront/CheckoutConfirm.ts
Comment thread src/page-objects/storefront/CheckoutConfirm.ts
Comment thread src/services/TestDataService.ts Outdated
@suri-ta777 suri-ta777 force-pushed the test/add-checkout-with-promotion-discount-rule branch from 38ef4df to 318a28e Compare June 25, 2026 08:55
@suri-ta777 suri-ta777 requested review from a team and Stefan Guder (sguder) June 25, 2026 09:15
@suri-ta777 suri-ta777 changed the title test: add the create newsletter recipient request feat: add the create newsletter recipient request Jun 25, 2026
this.promotionLineItems = this.confirmProductTable.locator(".line-item-promotion");
}

getLineItemByProductName(lineItem: Locator, productName: string): Record<string, Locator> {

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.

Why you have to provide a lineItem locator here? Could you not just take a line items and filter down to the specific one with .filter() like here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As each lineItem can be different types and will have many same assertion elements inside so i tried to make the code reusable but i updated the code based on your suggestion to align with existing code and easy to read

}

async getLineItemByPromotionName(name: string): Promise<Record<string, Locator>> {
let promotionItem = this.page.locator(".line-item-promotion", { hasText: name });

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.

why you use let as keyword here and not const?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

my mistake, i updated it

Comment thread src/services/TestDataService.ts Outdated
*
* @param customer - The customer whose email and profile data will be used for the newsletter recipient.
*/
async createNewsletterRecipient(customer: Customer): Promise<NewsletterRecipient> {

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.

I miss the overrides here so that we can modify the date etc. (see other create functions)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

the overrides parameter is now added to createNewsletterRecipient func similar to other func

@suri-ta777 suri-ta777 force-pushed the test/add-checkout-with-promotion-discount-rule branch from 56cc2cb to 9688af6 Compare July 3, 2026 04:24
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.

3 participants