-
Notifications
You must be signed in to change notification settings - Fork 369
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
test: [M3-9143] - Cypress test for Service Transfers fetch error #11607
base: develop
Are you sure you want to change the base?
Conversation
Cloud Manager UI test results🎉 500 passing tests on test run #1 ↗︎
|
Coverage Report: ✅ |
// Confirm that an error message is displayed in "Received Service Transfers" panel. | ||
cy.get('[data-qa-panel="Received Service Transfers"]') | ||
.should('be.visible') | ||
.within(() => { | ||
cy.get('[data-testid="KeyboardArrowDownIcon"]').click(); | ||
assertServiceTransfersError(serviceTransferErrorMessage); | ||
}); | ||
|
||
// Confirm that an error message is displayed is in "Sent Service Transfers" panel. | ||
cy.get('[data-qa-panel="Sent Service Transfers"]') | ||
.should('be.visible') | ||
.within(() => { | ||
cy.get('[data-testid="KeyboardArrowDownIcon"]').click(); | ||
assertServiceTransfersError(serviceTransferErrorMessage); | ||
}); |
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.
We can remove the assertServiceTransfersError
function and simplify this to something like:
['Received Service Transfers', 'Sent Service Transfers'].forEach((transfer) => {
cy.get(`[data-qa-panel="${transfer}"]`)
.should('be.visible')
.within(() => {
cy.get('[data-testid="KeyboardArrowDownIcon"]').click();
// Error Icon should shows up.
cy.findByTestId('ErrorOutlineIcon').should('be.visible');
// Error message should be visible.
cy.findByText(serviceTransferErrorMessage, { exact: false }).should('be.visible');
});
})
/* | ||
* - Confirms that an error message is displayed in both the Received and Sent tables when the requests to fetch service transfers fail. | ||
*/ | ||
it('can display an error message when the request fails to fetch service transfer', () => { |
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.
it('can display an error message when the request fails to fetch service transfer', () => { | |
it('should display an error message when the request fails to fetch service transfer', () => { |
Looks like there's also some merge conflicts that need to be addressed |
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.
Thanks @cliu-akamai!
+1 to Hana's suggestions, but aside from that and the merge conflict this looks great!
Description 📝
Add test to check an error message is displayed in both in both the Received and Sent tables when the request fails to fetch Service Transfers.
Major Changes 🔄
mockGetEntityTransfersError
functioncan display an error message when the request fails to fetch service transfer
How to test 🧪