Skip to content

Commit

Permalink
feat: rename commands
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Jul 20, 2023
1 parent 6f96a1e commit 33d0684
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Test create channels', () => {
// Delete all Notification configs
cy.deleteAllNotificationConfigs();

cy.createConfig(testTlsSmtpSender);
cy.createNotificationConfig(testTlsSmtpSender);
});

beforeEach(() => {
Expand Down Expand Up @@ -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();
});

Expand Down
6 changes: 3 additions & 3 deletions cypress/utils/plugins/notifications-dashboards/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand All @@ -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);
});

0 comments on commit 33d0684

Please sign in to comment.