This repo contains a tests I previously wrote and wanted to use as practice in transferring into a test that utilizes the POM classes. With the help from my mentor and this video https://www.youtube.com/watch?v=rAec3mZFhF0&t=1582s
- Javascript
- Node.js
- Playwright
originalPodcastTest.spec.jsis the original test.refactorPodcastTest.spec.jsis the refactored test.pagesfolder contains the POM classes.addToCart2yearWarranty.spec.js,addToCartDenyWarranty.spec.js,ASINproductSearches.spec.jsare also refactored tests, you can view the original repo containing them here
- Go to amazon music page.
- Click on the podcast section.
- Click on the first podcast.
- Click on the share button.
- Read the share link shown the text field.
- Click the copy button which automatically adds the link to the clipboard.
- Compare the link in the clipboard with the link shown in the text field and assert that they are the same.
- Navigate to the product page
- Add the product to the cart
- Verify the 2-year warranty checkbox is visible and select it
- Confirm the warranty checkbox is checked
- Ensure the "Add Protection" button is visible and click it
- Verify the success message is displayed
- Check the cart item count is visible and matches the expected count
- View the cart and verify the item subtotal is correct
- Proceed to checkout and confirm the URL redirects to the sign-in page
- Navigate to the product page
- Add the product to the cart
- When the warranty panel is visible, click the "No thanks" button
- After the warranty panel is dismissed, verify the success message is displayed
- Check the cart item count is visible and matches the expected count
- View the cart and verify the item subtotal is correct
- Proceed to checkout and confirm the URL redirects to the sign-in page
- Navigate to the Amazon website
- Search for a product using the search box and the enter key
- Click on the first search result
- Verify the product page is displayed and save the product title
- Extract the ASIN number from an attribute in the customer reviews section
- Go back to amazon home page and search for the same product using the ASIN number and clicking on the search button
- Verifies that the product page found with the ASIN number is the same product initially searched for
- I used the
page.getByTestIdmethod to locate some elements. testIdAttribute: 'id'is added in theplaywright.config.js file.- DUE TO AMAZON'S ANTI BOT DETECTION, THIS PROJECT TYPICALLY FAILS IN CI :(




