If you’re using Playwright for end-to-end testing, you should check out Playwright Check Suites and start testing in production.
Steps
While discount coupons will be applied in different ways depending on the service or shop they are relevant to, in most cases:- Having selected one or more products will be a prerequisite for applying the coupon
- Entering a valid coupon will result in visible feedback, i.e. a reduction of the previous product/cart price
coupon.js
Takeaways
- We can simply verify that coupons are accepted, or also check that they command the right discount.
- Assertion libraries are useful when non-trivial assertions are required.