-
Notifications
You must be signed in to change notification settings - Fork 686
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
PB Banner UI test #3178
PB Banner UI test #3178
Changes from 29 commits
5b885a3
18207c3
2704fcf
7b8ca95
74d6ca8
2fbb749
3d887d2
c16af33
540c40b
e2d1f25
885eec8
9ae6cb3
4215d13
f780ecf
c9a8237
af94826
0f2745a
d5eaec4
872b28e
4679b69
854a7d5
c1ec8f9
034ea0f
e41e4c2
dda099c
2ad48dc
9293252
c54cdd5
f92f48a
4c01a5b
082427f
8e22302
c30ef61
4953327
1c21330
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { | ||
accountTriggerButton, | ||
createAccountInitiateButton, | ||
firstNameTextField, | ||
lastNameTextField, | ||
createAccountEmailTextField, | ||
createAccountPasswordTextField, | ||
createAccountSubmitButton | ||
} from '../../fields/accountAccess'; | ||
|
||
/** | ||
* Utility function to open the login dialog | ||
*/ | ||
export const openLoginDialog = () => { | ||
// open the signin dialog | ||
cy.get(accountTriggerButton).click(); | ||
}; | ||
|
||
/** | ||
* Utility function to create account in Venia using the | ||
* username and password provided. | ||
* | ||
* @param {String} firstName firstName to createAccount | ||
* @param {String} lastName lastName to createAccount | ||
* @param {String} accountEmail accountEmail to createAccount | ||
* @param {String} accountPassword accountPassword to createAccount | ||
*/ | ||
export const createAccount = ( | ||
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. I dont think we need these any more. We moved these to custom cypress actions. Or am I missing something? |
||
firstName, | ||
lastName, | ||
accountEmail, | ||
accountPassword | ||
) => { | ||
// click on create account button | ||
cy.get(createAccountInitiateButton) | ||
.contains('Create an Account') | ||
.click(); | ||
|
||
// enter user name | ||
cy.get(firstNameTextField).type(firstName); | ||
|
||
// Enter password into the password field | ||
cy.get(lastNameTextField).type(lastName); | ||
|
||
// Enter username into the username field | ||
cy.get(createAccountEmailTextField).type(accountEmail); | ||
|
||
// Enter password into the password field | ||
cy.get(createAccountPasswordTextField).type(accountPassword); | ||
|
||
// Enter password into the password field | ||
cy.get(createAccountSubmitButton) | ||
.contains('Create an Account') | ||
.click(); | ||
}; | ||
|
||
export const assertCreateAccount = ( | ||
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. Please move assertions to assertions folder. |
||
firstName, | ||
lastName, | ||
accountEmail, | ||
accountPassword | ||
) => { | ||
// Enter username into the username field | ||
cy.get(firstNameTextField).type(firstName); | ||
|
||
// Enter password into the password field | ||
cy.get(lastNameTextField).type(lastName); | ||
|
||
// Enter username into the username field | ||
cy.get(createAccountEmailTextField).type(accountEmail); | ||
|
||
// Enter password into the password field | ||
cy.get(createAccountPasswordTextField).type(accountPassword); | ||
|
||
// Enter password into the password field | ||
cy.get(createAccountSubmitButton).click; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
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. I dont think we need this any more. We moved these to custom Cypress actions in the wishlist PR. |
||
* Utility function to hit different routes | ||
*/ | ||
export const visitPage = routeUrl => { | ||
cy.visit(routeUrl); | ||
cy.wait(5000); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { | ||
wishlistPageHeading, | ||
wishlistRoot, | ||
wishlistItemPrice, | ||
wishlistItemAddToCartSection, | ||
wishlistItemAddToCartButton, | ||
wishlistItemMoreActionsButton, | ||
removeProduct, | ||
deleteProduct | ||
} from '../../fields/wishlist'; | ||
import { wishlistRemove, removeProductMessage } from '../../fixtures/wishlist'; | ||
|
||
/** | ||
* Utility function to assert empty wishlist | ||
* @param {String} wishlistHeaderText wishlist page header text | ||
*/ | ||
export const assertWishlistHeading = wishlistHeaderText => { | ||
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. Please move assertions to the assertions folder. 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. Dont know how I ended up here but updated all, thanks. Please re-check :) |
||
// assert wishlist header text | ||
cy.get(wishlistPageHeading).contains(wishlistHeaderText); | ||
}; | ||
|
||
/** | ||
* Utility function to assert empty wishlist | ||
*/ | ||
export const assertEmptyWishlist = () => { | ||
// assert product container does not exists | ||
cy.get(wishlistRoot).should('not.exist'); | ||
}; | ||
|
||
/** | ||
* Utility function to assert product exists in wishlist | ||
* @param {String} productName product to verify it exist in wishlist | ||
*/ | ||
export const assertProductInWishlist = productName => { | ||
// assert Product container exists | ||
cy.get(wishlistRoot).should('exist'); | ||
|
||
// assert Product exists | ||
cy.contains(productName).should('exist'); | ||
|
||
// assert Product Price exists | ||
cy.contains('div', productName) | ||
.children(wishlistItemPrice) | ||
.should('exist'); | ||
|
||
// assert Add To Cart Section exists | ||
cy.contains('div', productName) | ||
.children(wishlistItemAddToCartSection) | ||
.should('exist'); | ||
|
||
// assert Add to Cart button exists | ||
cy.contains('div', productName) | ||
.children() | ||
.find(wishlistItemAddToCartButton) | ||
.should('exist'); | ||
|
||
// assert more actions button exists | ||
cy.contains('div', productName) | ||
.children() | ||
.find(wishlistItemMoreActionsButton) | ||
.should('exist'); | ||
}; | ||
|
||
/** | ||
* Utility function to remove given product from wishlist | ||
* @param {String} productName product to be removed | ||
*/ | ||
export const removeProductFromWishlist = productName => { | ||
// click on More actions button | ||
cy.contains('div', productName) | ||
.children() | ||
.find(wishlistItemMoreActionsButton) | ||
.click(); | ||
|
||
// click on Remove button | ||
cy.get(removeProduct) | ||
.contains(wishlistRemove) | ||
.click(); | ||
|
||
// verfiy message is displayed | ||
cy.contains(removeProductMessage).should('exist'); | ||
|
||
// click on Delete button | ||
cy.get(deleteProduct).click(); | ||
}; |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,161 @@ | ||||||||
// TODO add tags CE, EE to test to filter and run tests as needed | ||||||||
describe('verify pagebuilder banner content', () => { | ||||||||
it('verify banner content', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
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.
Suggested change
Just for consistency. |
||||||||
it('verify banner content2', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner2.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page2', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content3', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner3.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page3', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content4', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner4.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page4', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content5', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner5.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page5', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content6', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner6.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page6', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content7', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner7.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page7', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content8', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner8.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page8', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content9', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner9.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page9', | ||||||||
timeout: 60000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
|
||||||||
it('verify banner content10', () => { | ||||||||
cy.intercept('GET', '**/graphql?query=query+GetCmsPage*', { | ||||||||
fixture: 'pageBuilder/banner/banner10.json' | ||||||||
}).as('getCMSMockData'); | ||||||||
cy.visitHomePage(); | ||||||||
cy.wait(['@getCMSMockData']).its('response.body'); | ||||||||
cy.loadFullPage().then(() => { | ||||||||
cy.captureFullPageScreenshot({ | ||||||||
name: 'Page Builder Home Page10', | ||||||||
timeout: 180000, | ||||||||
failureThreshold: 5, | ||||||||
failureThresholdType: 'percent' | ||||||||
}); | ||||||||
}); | ||||||||
}); | ||||||||
}); |
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.
Looks like you'll have to update this PR after the wishlist PR merge.