Skip to content

Commit

Permalink
feat(e2e): add test for clear wishlist (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
kstala authored Jul 27, 2023
1 parent b2fe2bc commit 0e36833
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/e2e-tests/page-objects/WishlistPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export class WishlistPage {
readonly addToCartButton: Locator;
readonly wishlistButton: Locator;
readonly productInWishlistButton: Locator;
readonly clearWishlistButton: Locator;

constructor(page: Page) {
this.page = page;
Expand All @@ -13,6 +14,7 @@ export class WishlistPage {
this.productInWishlistButton = page
.getByTestId("product-box-toggle-wishlist-button")
.first();
this.clearWishlistButton = page.getByTestId("clear-wishlist-button");
}

async openWishlist() {
Expand All @@ -23,4 +25,9 @@ export class WishlistPage {
await this.page.waitForLoadState("networkidle");
await this.productInWishlistButton.click();
}

async clearWishlist() {
await this.page.waitForLoadState("networkidle");
await this.clearWishlistButton.click();
}
}
7 changes: 7 additions & 0 deletions apps/e2e-tests/tests/addToWishlist.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@ test.describe.parallel
await wishlistPage.removeProductFromWishlist();
await expect(page.getByTestId("wishlist-empty")).toHaveCount(1);
});

test("Clear whole wishlist", async ({ page }) => {
await homePage.addProductToWishlist();
await wishlistPage.openWishlist();
await wishlistPage.clearWishlist();
await expect(page.getByTestId("wishlist-empty")).toHaveCount(1);
});
});

2 comments on commit 0e36833

@vercel
Copy link

@vercel vercel bot commented on 0e36833 Jul 27, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 0e36833 Jul 27, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

frontends-demo – ./templates/vue-demo-store

frontends-demo.vercel.app
frontends-demo-git-main-shopware-frontends.vercel.app
frontends-demo-shopware-frontends.vercel.app

Please sign in to comment.