Skip to content

Commit

Permalink
stabilize cypress test case (#89)
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am authored Jul 21, 2023
1 parent 2517231 commit 8bde066
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .cypress/integration/channels.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('Test create channels', () => {
cy.wait(delay);
cy.get(
'[data-test-subj="create-recipient-group-modal-create-button"]'
).click();
).click({ force: true });
cy.contains('successfully created.').should('exist');

cy.get('[data-test-subj="create-channel-create-button"]').click();
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('Test create channels', () => {
);
cy.get(
'[data-test-subj="create-ses-sender-modal-create-button"]'
).click();
).click({ force: true });
cy.contains('successfully created.').should('exist');

// custom data-test-subj does not work on combo box
Expand Down Expand Up @@ -182,7 +182,7 @@ describe('Test create channels', () => {
'arn:aws:iam::012345678901:role/NotificationsSNSRole'
);

cy.get('[data-test-subj="create-channel-create-button"]').click();
cy.get('[data-test-subj="create-channel-create-button"]').click({ force: true });
cy.contains('successfully created.').should('exist');
});
});
Expand Down
5 changes: 5 additions & 0 deletions .cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ Cypress.Commands.add('createTestEmailChannel', () => {
});

Cypress.Commands.add('deleteAllConfigs', () => {
cy.request({
method: 'POST',
url: `${Cypress.env('opensearch')}/_refresh`
});

cy.request({
method: 'GET',
url: `${Cypress.env('opensearch')}${API.CONFIGS_BASE}`,
Expand Down

0 comments on commit 8bde066

Please sign in to comment.