upcoming: [DI-24451] - Added confirmation dialog on enabling/disabling of alert - #11981
Conversation
| const message = `Are you sure you want to disable the alert for ${entityName}?`; | ||
| const title = `Disable ${alert.label} Alert?`; |
There was a problem hiding this comment.
Optional nit: these could be moved out of the test function to live with the constants above, since they're repeated in multiple tests. (And renamed something like disabledMessage, disabledTitle.)
…Confirmation dialogue boxes
| .should('be.visible') | ||
| .should('have.text', `${action} ${alertName} Alert?`); | ||
|
|
||
| cy.get('[data-qa-drawer="true"]') |
There was a problem hiding this comment.
| cy.get('[data-qa-drawer="true"]') | |
| cy.get('[data-qa-drawer]') |
Can't this itself work?
| action: 'Disable' | 'Enable'; | ||
| alertName: string; | ||
| alias: string; |
There was a problem hiding this comment.
can we define a interface for this or it is not needed?
There was a problem hiding this comment.
instead of new interface I've reused already existing interface as partial
|
I've addressed all the comments. Please review it once more and let me know if the text can be further refined |
| // verify dialog title | ||
| cy.get('[data-qa-drawer-title]') | ||
| .should('be.visible') | ||
| .should('have.text', `${action} ${alertName} Alert?`); | ||
|
|
||
| cy.get('[data-qa-drawer]') | ||
| .find('h6') | ||
| .should('be.visible') | ||
| .should('have.text', confirmationText); | ||
|
|
||
| ui.buttonGroup | ||
| .find() | ||
| .find('button') | ||
| .filter(`[label="${action}"]`) | ||
| .should('be.visible') | ||
| .should('be.enabled') | ||
| .click(); |
There was a problem hiding this comment.
| // verify dialog title | |
| cy.get('[data-qa-drawer-title]') | |
| .should('be.visible') | |
| .should('have.text', `${action} ${alertName} Alert?`); | |
| cy.get('[data-qa-drawer]') | |
| .find('h6') | |
| .should('be.visible') | |
| .should('have.text', confirmationText); | |
| ui.buttonGroup | |
| .find() | |
| .find('button') | |
| .filter(`[label="${action}"]`) | |
| .should('be.visible') | |
| .should('be.enabled') | |
| .click(); | |
| ui.dialog | |
| .findByTitle(`${action} ${alertName} Alert?`) | |
| .should('be.visible') | |
| .within(() => { | |
| cy.findByText(confirmationText).should('be.visible'); | |
| ui.button | |
| .findByTitle(action) | |
| .should('be.visible') | |
| .should('be.enabled') | |
| .click(); | |
| }); |
- Check out our UI helpers
- You can use
.within(() => {}to limit the scope of your selections. That's preferable to chaining a bunch of filters. - There's no need to test minor markup details, like confirming that the confirmation text is inside an
h6.
There was a problem hiding this comment.
thanks for suggestion
|
@mjac0bs we got enough approvals & resolved your comments as well, if all good can we merge? |
Cloud Manager UI test results🎉 540 passing tests on test run #10 ↗︎
|
Description 📝
Added the confirmation dialog while enabling & disabling of alert.
Changes 🔄
List any change(s) relevant to the reviewer.
Target release date 🗓️
22nd April
Preview 📷
Include a screenshot or screen recording of the change.
🔒 Use the Mask Sensitive Data setting for security.
💡 Use
<video src="" />tag when including recordings in table.How to test 🧪
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅