From 33d0684a52396626b4b8d2a4efed4bc0571897e2 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Thu, 20 Jul 2023 13:38:05 +0800 Subject: [PATCH] feat: rename commands Signed-off-by: SuZhou-Joe --- .../1_email_senders_and_groups.spec.js | 22 +++++++++---------- .../2_channels.spec.js | 10 ++++----- .../notifications-dashboards/commands.js | 6 ++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cypress/integration/plugins/notifications-dashboards/1_email_senders_and_groups.spec.js b/cypress/integration/plugins/notifications-dashboards/1_email_senders_and_groups.spec.js index 2dbfb82be..5b87afd8d 100644 --- a/cypress/integration/plugins/notifications-dashboards/1_email_senders_and_groups.spec.js +++ b/cypress/integration/plugins/notifications-dashboards/1_email_senders_and_groups.spec.js @@ -19,7 +19,7 @@ import testEmailRecipientGroup from '../../../fixtures/plugins/notifications-das describe('Test create email senders', () => { before(() => { // Delete all Notification configs - cy.deleteAllConfigs(); + cy.deleteAllNotificationConfigs(); }); beforeEach(() => { @@ -102,11 +102,11 @@ describe('Test create email senders', () => { describe('Test edit senders', () => { before(() => { // Delete all Notification configs - cy.deleteAllConfigs(); + cy.deleteAllNotificationConfigs(); - cy.createConfig(testSslSmtpSender); - cy.createConfig(testTlsSmtpSender); - cy.createConfig(testSesSender); + cy.createNotificationConfig(testSslSmtpSender); + cy.createNotificationConfig(testTlsSmtpSender); + cy.createNotificationConfig(testSesSender); }); beforeEach(() => { @@ -143,11 +143,11 @@ describe('Test edit senders', () => { describe('Test delete senders', () => { before(() => { // Delete all Notification configs - cy.deleteAllConfigs(); + cy.deleteAllNotificationConfigs(); - cy.createConfig(testSslSmtpSender); - cy.createConfig(testTlsSmtpSender); - cy.createConfig(testSesSender); + cy.createNotificationConfig(testSslSmtpSender); + cy.createNotificationConfig(testTlsSmtpSender); + cy.createNotificationConfig(testSesSender); }); beforeEach(() => { @@ -184,9 +184,9 @@ describe('Test delete senders', () => { describe('Test create, edit and delete recipient group', () => { beforeEach(() => { // Delete all Notification configs - cy.deleteAllConfigs(); + cy.deleteAllNotificationConfigs(); - cy.createConfig(testEmailRecipientGroup); + cy.createNotificationConfig(testEmailRecipientGroup); cy.visit( `${BASE_PATH}/app/${NOTIFICATIONS_PLUGIN_NAME}#email-recipient-groups` diff --git a/cypress/integration/plugins/notifications-dashboards/2_channels.spec.js b/cypress/integration/plugins/notifications-dashboards/2_channels.spec.js index 579773c4e..bd5766e86 100644 --- a/cypress/integration/plugins/notifications-dashboards/2_channels.spec.js +++ b/cypress/integration/plugins/notifications-dashboards/2_channels.spec.js @@ -21,7 +21,7 @@ describe('Test create channels', () => { // Delete all Notification configs cy.deleteAllNotificationConfigs(); - cy.createConfig(testTlsSmtpSender); + cy.createNotificationConfig(testTlsSmtpSender); }); beforeEach(() => { @@ -193,12 +193,12 @@ describe('Test create channels', () => { describe('Test channels table', () => { before(() => { // Delete all Notification configs - cy.deleteAllConfigs(); + cy.deleteAllNotificationConfigs(); // Create test channels - cy.createConfig(testSlackChannel); - cy.createConfig(testChimeChannel); - cy.createConfig(testWebhookChannel); + cy.createNotificationConfig(testSlackChannel); + cy.createNotificationConfig(testChimeChannel); + cy.createNotificationConfig(testWebhookChannel); cy.createTestEmailChannel(); }); diff --git a/cypress/utils/plugins/notifications-dashboards/commands.js b/cypress/utils/plugins/notifications-dashboards/commands.js index fde683759..54874d82e 100644 --- a/cypress/utils/plugins/notifications-dashboards/commands.js +++ b/cypress/utils/plugins/notifications-dashboards/commands.js @@ -26,7 +26,7 @@ Cypress.Commands.add('deleteAllNotificationConfigs', () => { }); }); -Cypress.Commands.add('createConfig', (notificationConfigJSON) => { +Cypress.Commands.add('createNotificationConfig', (notificationConfigJSON) => { cy.request( 'POST', `${Cypress.env('openSearchUrl')}${API.CONFIGS_BASE}`, @@ -35,6 +35,6 @@ Cypress.Commands.add('createConfig', (notificationConfigJSON) => { }); Cypress.Commands.add('createTestEmailChannel', () => { - cy.createConfig(testTlsSmtpSender); - cy.createConfig(testSmtpEmailChannel); + cy.createNotificationConfig(testTlsSmtpSender); + cy.createNotificationConfig(testSmtpEmailChannel); });