-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cypress multiple wishlist #3218
Changes from all commits
e1ebeb6
37d2d97
f0e822c
4f73a2c
b494c9c
25f8e1c
266532f
65fb903
c2fd5c2
3fc43f2
2645cf0
72cf48c
1299b10
96fcfe9
a058a7c
4f791d9
37919b6
1f6b1c0
04aa427
2a14585
3f63f5b
c306b7b
2edabbf
e56c9a8
2dbf23f
8d48f53
623a8c0
c34f0b7
739e033
8eef00d
58cc442
dcc7b92
74bc078
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * as categoryPage from './categoryPage'; | ||
export * as myAccountMenu from './myAccountMenu'; | ||
export * as productPage from './productPage'; | ||
export * as wishlistPage from './wishlistPage'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import { | ||
productPageAddToWishListButton, | ||
productPageSelectedWishlistButton | ||
addProductToWishlist | ||
} from '../../fields/productPage'; | ||
|
||
/** | ||
* Utility function to add product to wishlist from product page | ||
* Utility function to add product to wishlist from product page | ||
*/ | ||
export const addProductToWishlistFromProductPage = () => { | ||
// add product to wishlist | ||
cy.get(productPageAddToWishListButton).click(); | ||
}; | ||
|
||
// assert product selected indicator | ||
cy.get(productPageSelectedWishlistButton).should('exist'); | ||
/** | ||
* Utility function to add product to wishlist from product page Dialog window | ||
*/ | ||
export const addProductToExistingWishlistFromDialog = wishlistName => { | ||
// add product to wishlist | ||
cy.get(addProductToWishlist) | ||
.contains(wishlistName) | ||
.click(); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { | ||
createWishlistButton, | ||
wishlistNameField, | ||
createWishlistConfirmButton | ||
} from '../../fields/wishlist'; | ||
|
||
/** | ||
* Utility function to create wishlist | ||
* | ||
* @param {String} wishlistName wishlist name | ||
*/ | ||
export const createWishlist = wishlistName => { | ||
// click on Create a List link | ||
cy.get(createWishlistButton).click(); | ||
|
||
// enter wishlist name | ||
cy.get(wishlistNameField).type(wishlistName); | ||
|
||
// Create wishlist | ||
cy.get(createWishlistConfirmButton).click(); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { categoryPageSelectedWishlistButton } from '../../fields/categoryPage'; | ||
|
||
/** | ||
* Utility function to assert selected product in wishlist | ||
*/ | ||
export const assertWishlistSelectedProductOnCategoryPage = selectedProduct => { | ||
// assert product selected indicator | ||
cy.contains(selectedProduct) | ||
.siblings() | ||
.find(categoryPageSelectedWishlistButton) | ||
.should('exist'); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * as myAccountMenu from './myAccountMenu'; | ||
export * as wishlist from './wishlist'; | ||
export * as categoryPage from './categoryPage'; | ||
export * as productPage from './productPage'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { productPageSelectedWishlistButton } from '../../fields/productPage'; | ||
|
||
/** | ||
* Utility function to assert the product is in wishlist | ||
*/ | ||
export const assertProductSelectIndicator = () => { | ||
// assert product selected indicator | ||
cy.get(productPageSelectedWishlistButton).should('exist'); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const categoryTops = 'venia-tops.html?page=1'; | ||
|
||
export const categorySweaters = './venia-tops/venia-sweaters.html?page=1'; | ||
|
||
export const productCarinaCardigan = 'Carina Cardigan'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const hitGraphqlPath = '**/graphql'; | ||
|
||
export const getCMSPage = '**/graphql?query=query+GetCmsPage*'; | ||
|
||
export const getCustomerWishlistCall = | ||
'**/graphql?query=query+GetCustomerWishlist*'; | ||
|
||
export const getMultipleWishlistConfigCall = | ||
'**/graphql?query=query+getMultipleWishlistsEnabled*'; | ||
|
||
export const getWishlistDialogDataCall = | ||
'**/graphql?query=query+getWishlistsDialogData*'; | ||
|
||
export const getWishlistitemsForLocalFieldsCall = | ||
'**/graphql?query=query+GetWishlistItemsForLocalField*'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slight discrepancy between the |
||
|
||
export const getWishlistConfigForGalleryCall = | ||
'**/graphql?query=query+GetWishlistConfigForGallery*'; | ||
|
||
export const getWishlistConfigForProductPageCall = | ||
'**/graphql?query=query+wishlistConfig*'; | ||
|
||
export const getCustomerWishlist = | ||
'**/graphql?query=query+GetCustomerWishlist*'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
export const productValeriaTwoLayeredTankUrl = './valeria-two-layer-tank.html'; | ||
export const productAugustaEarrings = { | ||
name: 'Augusta Earrings', | ||
url: '/augusta-earrings.html' | ||
}; | ||
|
||
export const productValeriaTwoLayeredTankName = 'Valeria Two-Layer Tank'; | ||
export const productValeriaTwoLayeredTank = { | ||
name: 'Valeria Two-Layer Tank', | ||
url: '/valeria-two-layer-tank.html' | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
export const wishistRoute = './wishlist'; | ||
export const wishlistRoute = 'wishlist'; | ||
|
||
export const wishlistRemove = 'Remove'; | ||
|
||
export const removeProductMessage = | ||
'Are you sure you want to delete this product from the list?'; | ||
|
||
export const singleWishlistHeading = 'Remove'; | ||
|
||
export const multipleWishlistHeading = 'Remove'; | ||
|
||
export const emptyWishlistMessage = 'There are currently no items in this list'; | ||
dpatil-magento marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"data": { | ||
"addProductsToWishlist": { | ||
"user_errors": [], | ||
"wishlist": { | ||
"id": "31", | ||
"name": "Test List1", | ||
"__typename": "Wishlist" | ||
}, | ||
"__typename": "AddProductsToWishlistOutput" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"data": { | ||
"addProductsToWishlist": { | ||
"user_errors": [], | ||
"wishlist": { | ||
"id": "32", | ||
"name": "Test List2", | ||
"__typename": "Wishlist" | ||
}, | ||
"__typename": "AddProductsToWishlistOutput" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"data": { | ||
"createWishlist": { | ||
"wishlist": { | ||
"id": "32", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These don't actually get created on the backend so these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it does not needed. As soon as page reloads or test is complete the data is wiped. |
||
"__typename": "Wishlist" | ||
}, | ||
"__typename": "CreateWishlistOutput" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"data": { | ||
"customer": { | ||
"id": null, | ||
"wishlists": [ | ||
{ | ||
"id": "31", | ||
"items_v2": { | ||
"items": [], | ||
"page_info": { | ||
"current_page": 1, | ||
"total_pages": 1, | ||
"__typename": "SearchResultPageInfo" | ||
}, | ||
"__typename": "WishlistItems" | ||
}, | ||
"__typename": "Wishlist" | ||
} | ||
], | ||
"__typename": "Customer" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"data": { | ||
"customer": { | ||
"id": null, | ||
"wishlists": [ | ||
{ | ||
"id": "31", | ||
"items_v2": { | ||
"items": [], | ||
"page_info": { | ||
"current_page": 1, | ||
"total_pages": 1, | ||
"__typename": "SearchResultPageInfo" | ||
}, | ||
"__typename": "WishlistItems" | ||
}, | ||
"__typename": "Wishlist" | ||
}, | ||
{ | ||
"id": "32", | ||
"items_v2": { | ||
"items": [ | ||
{ | ||
"id": "70", | ||
"product": { | ||
"id": 1120, | ||
"sku": "VSW01", | ||
"__typename": "ConfigurableProduct" | ||
}, | ||
"__typename": "ConfigurableWishlistItem" | ||
} | ||
], | ||
"page_info": { | ||
"current_page": 1, | ||
"total_pages": 1, | ||
"__typename": "SearchResultPageInfo" | ||
}, | ||
"__typename": "WishlistItems" | ||
}, | ||
"__typename": "Wishlist" | ||
} | ||
], | ||
"__typename": "Customer" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"data": { | ||
"storeConfig": { | ||
"id": 1, | ||
"magento_wishlist_general_is_enabled": "1", | ||
"enable_multiple_wishlists": "1", | ||
"__typename": "StoreConfig" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider dropping this comment. You've already captured it in the function name and the function block comment.