Skip to content

Commit

Permalink
test: fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber committed Sep 26, 2024
1 parent 050a780 commit 06b8920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions e2e/cypress/e2e/pages/account/wishlists-details.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class WishlistsDetailsPage {
}

get listItems() {
return cy.get('ish-account-wishlist-detail-line-item');
return cy.get('ish-wishlist-line-item');
}

get listItemLinks() {
Expand All @@ -29,11 +29,11 @@ export class WishlistsDetailsPage {
}

getWishlistItemById(id: string) {
return cy.get('span').contains(id).closest('ish-account-wishlist-detail-line-item').parent();
return cy.get('span').contains(id).closest('ish-wishlist-line-item').parent();
}

editWishlistDetails(name: string, preferred: boolean) {
cy.get('[data-testing-id="wishlist-details-edit"]').click();
cy.get('[data-testing-id="wishlist-details-edit"] .share-label').click();
cy.get('ngb-modal-window').find('[data-testing-id="title"]').clear().type(name);
cy.get('[data-testing-id="preferred"]').uncheck();
if (preferred) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Wishlist MyAccount Functionality', () => {
});
});

it('user adds 2 products from the product detail page to wishlist (using preferred wishlist)', () => {
it('user adds a product from the product detail page to wishlist (using preferred wishlist)', () => {
at(WishlistsOverviewPage, page => {
page.addWishlist(anotherWishlist, false);
page.header.gotoCategoryPage(_.category);
Expand All @@ -82,9 +82,13 @@ describe('Wishlist MyAccount Functionality', () => {
page.breadcrumb.items.should('have.length', 4);
page.breadcrumb.items.eq(3).should('contain', preferredWishlist);
page.listItemLinks.invoke('attr', 'href').should('contain', _.product2);
page.header.gotoCategoryPage(_.category);
});
});

it('user adds another product from the product detail page to wishlist (using preferred wishlist)', () => {
at(WishlistsDetailsPage, page => {
page.header.gotoCategoryPage(_.category);
});
at(CategoryPage, page => page.gotoSubCategory(_.subcategory));
at(FamilyPage, page => page.productList.gotoProductDetailPageBySku(_.product1));
at(ProductDetailPage, page => {
Expand Down

0 comments on commit 06b8920

Please sign in to comment.