feat(console): add new step to activate SMTP provider (#7956)

# Which Problems Are Solved

- In #7929 it was detected that it would be better to show the
activate/deactivate action for a SMTP configuration in the wizard as for
some users it'd not be intuitive that the SMTP provider must be
activated so Zitadel can use it to send notifications.

# How the Problems Are Solved

- When a new SMTP provider is added or updated, the wizard has a new
step that allow us to activate or deactivate the provider configured in
the previous step. The following video shows the new wizard:


https://github.com/zitadel/zitadel/assets/30386061/178234d6-73dc-4719-af0b-1d6f19bf3f7d

# Additional Context

- Closes #7929
This commit is contained in:
Miguel Cabrerizo
2024-05-22 11:23:35 +02:00
committed by GitHub
parent 5b1160de1e
commit cca342187b
20 changed files with 350 additions and 37 deletions

View File

@@ -32,6 +32,7 @@ describe('instance notifications', () => {
cy.get('[formcontrolname="replyToAddress"]').clear().type('replyto1@example.com');
cy.get('[data-e2e="create-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="close-button"]').click();
cy.get('tr').contains('mailgun');
cy.get('tr').contains('smtp.mailgun.org:587');
cy.get('tr').contains('sender1@example.com');
@@ -51,6 +52,7 @@ describe('instance notifications', () => {
cy.get('[formcontrolname="senderName"]').clear().type('Change1');
cy.get('[data-e2e="create-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="close-button"]').click();
rowSelector = `tr:contains('mailgun')`;
cy.get(rowSelector).contains('mailgun');
cy.get(rowSelector).contains('smtp.mailgun.org:587');
@@ -81,6 +83,7 @@ describe('instance notifications', () => {
cy.get('[formcontrolname="replyToAddress"]').clear().type('replyto2@example.com');
cy.get('[data-e2e="create-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="close-button"]').click();
rowSelector = `tr:contains('mailjet')`;
cy.get(rowSelector).contains('mailjet');
cy.get(rowSelector).contains('in-v3.mailjet.com:587');
@@ -130,6 +133,51 @@ describe('instance notifications', () => {
rowSelector = `tr:contains('mailgun')`;
cy.get(rowSelector).should('not.exist');
});
it(`should add Mailgun SMTP provider settings and activate it using wizard`, () => {
let rowSelector = `a:contains('Mailgun')`;
cy.visit(smtpPath);
cy.get(rowSelector).click();
cy.get('[formcontrolname="hostAndPort"]').should('have.value', 'smtp.mailgun.org:587');
cy.get('[formcontrolname="user"]').clear().type('user@example.com');
cy.get('[formcontrolname="password"]').clear().type('password');
cy.get('[data-e2e="continue-button"]').click();
cy.get('[formcontrolname="senderAddress"]').clear().type('sender1@example.com');
cy.get('[formcontrolname="senderName"]').clear().type('Test1');
cy.get('[formcontrolname="replyToAddress"]').clear().type('replyto1@example.com');
cy.get('[data-e2e="create-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="activate-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="close-button"]').click();
rowSelector = `tr:contains('smtp.mailgun.org:587')`;
cy.get(rowSelector).find('[data-e2e="active-provider"]');
cy.get(rowSelector).contains('mailgun');
cy.get(rowSelector).contains('smtp.mailgun.org:587');
cy.get(rowSelector).contains('sender1@example.com');
});
it(`should add Mailgun SMTP provider settings and deactivate it using wizard`, () => {
let rowSelector = `tr:contains('mailgun')`;
cy.visit(smtpPath);
cy.get(rowSelector).click();
cy.get('[data-e2e="continue-button"]').click();
cy.get('[data-e2e="create-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="deactivate-button"]').click();
cy.shouldConfirmSuccess();
cy.get('[data-e2e="close-button"]').click();
rowSelector = `tr:contains('mailgun')`;
cy.get(rowSelector).find('[data-e2e="active-provider"]').should('not.exist');
});
it(`should delete Mailgun SMTP provider`, () => {
let rowSelector = `tr:contains('mailgun')`;
cy.visit(smtpPath);
cy.get(rowSelector).find('[data-e2e="delete-provider-button"]').click({ force: true });
cy.get('[data-e2e="confirm-dialog-input"]').focus().type('Test1');
cy.get('[data-e2e="confirm-dialog-button"]').click();
cy.shouldConfirmSuccess();
rowSelector = `tr:contains('mailgun')`;
cy.get(rowSelector).should('not.exist');
});
});
describe('sms settings', () => {

View File

@@ -26,8 +26,9 @@ describe('organizations', () => {
it('should delete an org', () => {
cy.visit(orgsPath);
cy.contains('tr', newOrg).click();
cy.wait(3000);
cy.get('[data-e2e="actions"]').click();
cy.get('[data-e2e="delete"]', { timeout: 3000 }).should('be.visible').click();
cy.get('[data-e2e="delete"]', { timeout: 1000 }).should('be.visible').click();
cy.get('[data-e2e="confirm-dialog-input"]').focus().clear().type(newOrg);
cy.get('[data-e2e="confirm-dialog-button"]').click();
cy.shouldConfirmSuccess();