-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:derek-ho/opensearch-dashboards-func…
…tional-test
- Loading branch information
Showing
21 changed files
with
343 additions
and
32 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
cypress/fixtures/plugins/notifications-dashboards/test_chime_channel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"config": { | ||
"name": "Test chime channel", | ||
"description": "A test chime channel", | ||
"config_type": "chime", | ||
"is_enabled": true, | ||
"chime": { | ||
"url": "https://sample-chime-webhook" | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
cypress/fixtures/plugins/notifications-dashboards/test_email_recipient_group.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"config": { | ||
"name": "Test recipient group", | ||
"description": "A test email recipient group", | ||
"config_type": "email_group", | ||
"is_enabled": true, | ||
"email_group": { | ||
"recipient_list": [ | ||
{ | ||
"recipient": "[email protected]" | ||
}, | ||
{ | ||
"recipient": "[email protected]" | ||
}, | ||
{ | ||
"recipient": "[email protected]" | ||
}, | ||
{ | ||
"recipient": "[email protected]" | ||
}, | ||
{ | ||
"recipient": "[email protected]" | ||
}, | ||
{ | ||
"recipient": "[email protected]" | ||
} | ||
] | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
cypress/fixtures/plugins/notifications-dashboards/test_ses_sender.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"config": { | ||
"name": "test-ses-sender", | ||
"description": "A test SES sender", | ||
"config_type": "ses_account", | ||
"is_enabled": true, | ||
"ses_account": { | ||
"region": "us-east-1", | ||
"role_arn": "arn:aws:iam::012345678912:role/NotificationsSESRole", | ||
"from_address": "[email protected]" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
cypress/fixtures/plugins/notifications-dashboards/test_slack_channel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"config": { | ||
"name": "Test slack channel", | ||
"description": "A test slack channel", | ||
"config_type": "slack", | ||
"is_enabled": true, | ||
"slack": { | ||
"url": "https://sample-slack-webhook" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
cypress/fixtures/plugins/notifications-dashboards/test_smtp_email_channel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"config": { | ||
"name": "Test email channel", | ||
"description": "A test SMTP email channel", | ||
"config_type": "email", | ||
"is_enabled": true, | ||
"email": { | ||
"email_account_id": "test_smtp_sender_id", | ||
"recipient_list": [ | ||
{ | ||
"recipient": "[email protected]" | ||
} | ||
], | ||
"email_group_id_list": [] | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
cypress/fixtures/plugins/notifications-dashboards/test_sns_channel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"config": { | ||
"name": "test-sns-channel", | ||
"description": "A test SNS channel", | ||
"config_type": "sns", | ||
"is_enabled": true, | ||
"sns": { | ||
"topic_arn": "arn:aws:sns:us-west-2:123456789012:notifications-test", | ||
"role_arn": "arn:aws:iam::012345678901:role/NotificationsSNSRole" | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
cypress/fixtures/plugins/notifications-dashboards/test_ssl_smtp_sender.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"config": { | ||
"name": "test-ssl-sender", | ||
"description": "A test SSL SMTP sender", | ||
"config_type": "smtp_account", | ||
"is_enabled": true, | ||
"smtp_account": { | ||
"host": "test-host.com", | ||
"port": 123, | ||
"method": "ssl", | ||
"from_address": "[email protected]" | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
cypress/fixtures/plugins/notifications-dashboards/test_tls_smtp_sender.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"config_id": "test_smtp_sender_id", | ||
"config": { | ||
"name": "test-tls-sender", | ||
"description": "A test TLS SMTP sender", | ||
"config_type": "smtp_account", | ||
"is_enabled": true, | ||
"smtp_account": { | ||
"host": "test-host.com", | ||
"port": 123, | ||
"method": "start_tls", | ||
"from_address": "[email protected]" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
cypress/fixtures/plugins/notifications-dashboards/test_webhook_channel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"config": { | ||
"name": "Test webhook channel", | ||
"description": "A test webhook channel", | ||
"config_type": "webhook", | ||
"is_enabled": true, | ||
"webhook": { | ||
"url": "https://custom-webhook-test-url.com:8888/test-path?params1=value1¶ms2=value2¶ms3=value3¶ms4=value4¶ms5=values5¶ms6=values6¶ms7=values7" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,21 @@ import { | |
NOTIFICATIONS_PLUGIN_NAME, | ||
} from '../../../utils/constants'; | ||
|
||
import testSslSmtpSender from '../../../fixtures/plugins/notifications-dashboards/test_ssl_smtp_sender.json'; | ||
import testTlsSmtpSender from '../../../fixtures/plugins/notifications-dashboards/test_tls_smtp_sender.json'; | ||
import testSesSender from '../../../fixtures/plugins/notifications-dashboards/test_ses_sender.json'; | ||
import testEmailRecipientGroup from '../../../fixtures/plugins/notifications-dashboards/test_email_recipient_group.json'; | ||
|
||
describe('Test create email senders', () => { | ||
before(() => { | ||
// Delete all Notification configs | ||
cy.deleteAllNotificationConfigs(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit(`${BASE_PATH}/app/${NOTIFICATIONS_PLUGIN_NAME}#email-senders`); | ||
cy.wait(NOTIFICATIONS_DELAY * 3); | ||
cy.reload(true); | ||
cy.wait(NOTIFICATIONS_DELAY * 5); | ||
}); | ||
|
||
it('creates ssl sender', () => { | ||
|
@@ -62,7 +73,7 @@ describe('Test create email senders', () => { | |
|
||
cy.get('.euiButton__text').contains('Create').click({ force: true }); | ||
cy.contains('successfully created.').should('exist'); | ||
cy.contains('test-ssl-sender').should('exist'); | ||
cy.contains('test-tls-sender').should('exist'); | ||
}); | ||
|
||
it('creates SES sender', () => { | ||
|
@@ -89,16 +100,26 @@ describe('Test create email senders', () => { | |
}); | ||
|
||
describe('Test edit senders', () => { | ||
before(() => { | ||
// Delete all Notification configs | ||
cy.deleteAllNotificationConfigs(); | ||
|
||
cy.createNotificationConfig(testSslSmtpSender); | ||
cy.createNotificationConfig(testTlsSmtpSender); | ||
cy.createNotificationConfig(testSesSender); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit(`${BASE_PATH}/app/${NOTIFICATIONS_PLUGIN_NAME}#email-senders`); | ||
cy.wait(NOTIFICATIONS_DELAY * 3); | ||
cy.reload(true); | ||
cy.wait(NOTIFICATIONS_DELAY * 5); | ||
}); | ||
|
||
it('edits sender email address', () => { | ||
cy.get('.euiCheckbox__input[aria-label="Select this row"]').eq(0).click(); // ssl sender | ||
cy.get('[data-test-subj="senders-table-edit-button"]').click(); | ||
cy.get('[data-test-subj="create-sender-form-email-input"]').type( | ||
'{selectall}{backspace}edited.test@email.com' | ||
'{selectall}{backspace}editedtest@email.com' | ||
); | ||
cy.wait(NOTIFICATIONS_DELAY); | ||
|
||
|
@@ -120,14 +141,26 @@ describe('Test edit senders', () => { | |
}); | ||
|
||
describe('Test delete senders', () => { | ||
before(() => { | ||
// Delete all Notification configs | ||
cy.deleteAllNotificationConfigs(); | ||
|
||
cy.createNotificationConfig(testSslSmtpSender); | ||
cy.createNotificationConfig(testTlsSmtpSender); | ||
cy.createNotificationConfig(testSesSender); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit(`${BASE_PATH}/app/${NOTIFICATIONS_PLUGIN_NAME}#email-senders`); | ||
cy.wait(NOTIFICATIONS_DELAY * 3); | ||
cy.reload(true); | ||
cy.wait(NOTIFICATIONS_DELAY * 5); | ||
}); | ||
|
||
it('deletes smtp senders', () => { | ||
cy.get('.euiCheckbox__input[aria-label="Select this row"]').eq(0).click(); // ssl sender | ||
cy.get('[data-test-subj="senders-table-delete-button"]').click(); | ||
cy.get('[data-test-subj="senders-table-delete-button"]').click({ | ||
force: true, | ||
}); | ||
cy.get('input[placeholder="delete"]').type('delete'); | ||
cy.wait(NOTIFICATIONS_DELAY); | ||
cy.get('[data-test-subj="delete-sender-modal-delete-button"]').click(); | ||
|
@@ -136,7 +169,10 @@ describe('Test delete senders', () => { | |
|
||
it('deletes ses senders', () => { | ||
cy.get('.euiCheckbox__input[aria-label="Select this row"]').last().click(); // ses sender | ||
cy.get('[data-test-subj="ses-senders-table-delete-button"]').click(); | ||
cy.wait(NOTIFICATIONS_DELAY); | ||
cy.get('[data-test-subj="ses-senders-table-delete-button"]').click({ | ||
force: true, | ||
}); | ||
cy.get('input[placeholder="delete"]').type('delete'); | ||
cy.wait(NOTIFICATIONS_DELAY); | ||
cy.get('[data-test-subj="delete-sender-modal-delete-button"]').click(); | ||
|
@@ -148,10 +184,16 @@ describe('Test delete senders', () => { | |
|
||
describe('Test create, edit and delete recipient group', () => { | ||
beforeEach(() => { | ||
// Delete all Notification configs | ||
cy.deleteAllNotificationConfigs(); | ||
|
||
cy.createNotificationConfig(testEmailRecipientGroup); | ||
|
||
cy.visit( | ||
`${BASE_PATH}/app/${NOTIFICATIONS_PLUGIN_NAME}#email-recipient-groups` | ||
); | ||
cy.wait(NOTIFICATIONS_DELAY * 3); | ||
cy.reload(true); | ||
cy.wait(NOTIFICATIONS_DELAY * 5); | ||
}); | ||
|
||
it('creates recipient group', () => { | ||
|
@@ -210,13 +252,18 @@ describe('Test create, edit and delete recipient group', () => { | |
}); | ||
|
||
it('opens email addresses popup', () => { | ||
cy.get('.euiLink').contains('1 more').click({ force: true }); | ||
cy.get('.euiTableCellContent--overflowingContent .euiLink') | ||
.contains('1 more') | ||
.click({ force: true }); | ||
cy.contains('[email protected]').should('exist'); | ||
}); | ||
|
||
it('deletes recipient groups', () => { | ||
cy.get('[data-test-subj="checkboxSelectAll"]').last().click(); | ||
cy.get('[data-test-subj="recipient-groups-table-delete-button"]').click(); | ||
cy.get('[data-test-subj="checkboxSelectAll"]').click({ force: true }); | ||
cy.wait(NOTIFICATIONS_DELAY); | ||
cy.get('[data-test-subj="recipient-groups-table-delete-button"]').click({ | ||
force: true, | ||
}); | ||
cy.get('input[placeholder="delete"]').type('delete'); | ||
cy.wait(NOTIFICATIONS_DELAY); | ||
cy.get( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.