Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: wishlist feature added * smaller improvements after review * refactor: set wishlist breadcrumb in effect * changes after review * refactor: use upsert * refactor: suppress warning of missing wishlist feature * feat: select preferred wishlist in wishlist-link when available * ui improvements for wishlist items * i18n: unified wording in English and adapted localizations Co-authored-by: cbratsch <57700960+cbratsch@users.noreply.github.com> Co-authored-by: Danilo Hoffmann <dhhyi@aol.com> Co-authored-by: MWallnisch <42213577+MWallnisch@users.noreply.github.com>
- Loading branch information
1 parent
0062272
commit 199f25b
Showing
104 changed files
with
4,339 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
e2e/cypress/integration/pages/account/add-to-wishlist.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export class AddToWishlistModule { | ||
constructor(private contextSelector: string = 'ish-product-listing') {} | ||
|
||
addProductToWishlistFromPage(title: string = '', modal: boolean = false) { | ||
if (modal) { | ||
cy.get(`[data-testing-id="${title}"]`).click(); | ||
cy.get('[class="modal-footer"] button.btn-primary').click(); | ||
} | ||
this.closeAddProductToWishlistModal('link'); | ||
} | ||
|
||
addProductToWishlistFromList(product: string, title: string, modal: boolean = true) { | ||
if (modal) { | ||
cy.get(this.contextSelector) | ||
.find(`ish-product-item div[data-testing-sku="${product}"] button.add-to-wishlist`) | ||
.click(); | ||
cy.get(`[data-testing-id="${title}"]`).click(); | ||
cy.get('[class="modal-footer"] button.btn-primary').click(); | ||
this.closeAddProductToWishlistModal('link'); | ||
} else { | ||
cy.get(this.contextSelector) | ||
.find(`ish-product-item div[data-testing-sku="${product}"] button.add-to-wishlist`) | ||
.click(); | ||
this.closeAddProductToWishlistModal('link'); | ||
} | ||
} | ||
|
||
private closeAddProductToWishlistModal(mode: 'link' | 'x') { | ||
cy.wait(500); | ||
mode === 'link' | ||
? cy.get('[data-testing-id="wishlist-success-link"] a').click() | ||
: cy.get('[class="modal-header"] button').click(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
e2e/cypress/integration/pages/account/wishlists-details.page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { HeaderModule } from '../header.module'; | ||
|
||
export class WishlistsDetailsPage { | ||
readonly tag = 'ish-account-wishlist-detail-page'; | ||
|
||
readonly header = new HeaderModule(); | ||
|
||
static navigateToOverviewPage() { | ||
cy.get('[href="/account/wishlists"]') | ||
.first() | ||
.click(); | ||
} | ||
|
||
get listItem() { | ||
return cy.get('ish-account-wishlist-detail-line-item'); | ||
} | ||
|
||
get listItemLink() { | ||
return cy.get('ish-account-wishlist-detail-line-item').find('a[data-testing-id="wishlist-product-link"]'); | ||
} | ||
|
||
get wishlistTitle() { | ||
return cy | ||
.get('ish-account-wishlist-detail-page') | ||
.find('h1') | ||
.invoke('text'); | ||
} | ||
|
||
get wishlistPreferredTextElement() { | ||
return cy.get('[data-testing-id="preferred-wishlist-text"]'); | ||
} | ||
|
||
getWishlistItemById(id: string) { | ||
return cy | ||
.get('span') | ||
.contains(id) | ||
.closest('ish-account-wishlist-detail-line-item') | ||
.parent(); | ||
} | ||
|
||
editWishlistDetails(name: string, preferred: boolean) { | ||
cy.get('[data-testing-id="wishlist-details-edit"]').click(); | ||
cy.get('ngb-modal-window') | ||
.find('[data-testing-id="title"]') | ||
.clear() | ||
.type(name); | ||
cy.get('[data-testing-id="preferred"]').uncheck(); | ||
if (preferred) { | ||
cy.get('[data-testing-id="preferred"]').check(); | ||
} | ||
cy.get('[data-testing-id="wishlist-dialog-submit"]').click(); | ||
} | ||
|
||
deleteWishlist(id: string) { | ||
this.getWishlistItemById(id) | ||
.find('[data-testing-id="delete-wishlist"]') | ||
.click(); | ||
} | ||
|
||
moveProductToWishlist(productId: string, listName: string) { | ||
this.getWishlistItemById(productId) | ||
.find('[data-testing-id="move-wishlist"]') | ||
.click(); | ||
cy.get(`[data-testing-id="${listName}"]`).check(); | ||
cy.get('ngb-modal-window') | ||
.find('button[class="btn btn-primary"]') | ||
.click(); | ||
cy.get('[data-testing-id="wishlist-success-link"] a').click(); | ||
} | ||
|
||
addProductToBasket(productId: string, quantity: number) { | ||
this.getWishlistItemById(productId) | ||
.find('[data-testing-id="quantity"]') | ||
.clear() | ||
.type(quantity.toString()); | ||
this.getWishlistItemById(productId) | ||
.find('[data-testing-id="addToCartButton"]') | ||
.click(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
e2e/cypress/integration/pages/account/wishlists-overview.page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { HeaderModule } from '../header.module'; | ||
|
||
export class WishlistsOverviewPage { | ||
readonly tag = 'ish-account-wishlist-page'; | ||
|
||
readonly header = new HeaderModule(); | ||
|
||
static navigateTo() { | ||
cy.visit('/account/wishlists'); | ||
} | ||
|
||
addWishlist(name: string, preferred: boolean) { | ||
cy.get('a[data-testing-id="add-wishlist"').click(); | ||
cy.get('[data-testing-id="wishlist-dialog-name"]') | ||
.find('[data-testing-id="title"]') | ||
.clear() | ||
.type(name); | ||
if (preferred) { | ||
cy.get('[data-testing-id="wishlist-dialog-preferred"]') | ||
.find('[data-testing-id="preferred"]') | ||
.check(); | ||
} | ||
cy.get('[data-testing-id="wishlist-dialog-submit"]').click(); | ||
} | ||
|
||
deleteWishlistById(id: string) { | ||
this.wishlistsArray | ||
.find('a') | ||
.contains(id) | ||
.closest('[data-testing-id="wishlist-list-item-container"]') | ||
.find('[data-testing-id="delete-wishlist"]') | ||
.click(); | ||
cy.get('[data-testing-id="confirm"]').click(); | ||
} | ||
|
||
goToWishlistDetailLink(name: string) { | ||
cy.get('a') | ||
.contains(name) | ||
.click(); | ||
} | ||
|
||
get wishlistsArray() { | ||
return cy.get('[data-testing-id="wishlist-list-item"]'); | ||
} | ||
|
||
get wishlistsTitlesArray() { | ||
return this.wishlistsArray.find('[data-testing-id="wishlist-list-title"]').invoke('text'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
e2e/cypress/integration/pages/shopping/product-list.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.