From 830bda5f55a0016d9330499fc0bcc12c0a4db9c4 Mon Sep 17 00:00:00 2001 From: OlegIvaniv Date: Thu, 1 Dec 2022 10:01:03 +0100 Subject: [PATCH] test(editor): Intercept credentials save and test request and wait for them in e2e test (#4778) test(editor): Intercept credentials save and test request and wait for them to complete before doing assertions --- cypress/pages/modals/credentials-modal.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cypress/pages/modals/credentials-modal.ts b/cypress/pages/modals/credentials-modal.ts index 2d2bc1a5c1..39fd613065 100644 --- a/cypress/pages/modals/credentials-modal.ts +++ b/cypress/pages/modals/credentials-modal.ts @@ -22,7 +22,11 @@ export class CredentialsModal extends BasePage { this.getters.nameInput().clear().type(name); }, save: () => { + cy.intercept('POST', '/rest/credentials').as('saveCredential'); + cy.intercept('POST', '/rest/credentials/test').as('testCredential'); + this.getters.saveButton().click(); + cy.wait('@saveCredential').wait('@testCredential'); this.getters.saveButton().should('contain.text', 'Saved'); }, close: () => {