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
This commit is contained in:
OlegIvaniv 2022-12-01 10:01:03 +01:00 committed by GitHub
parent 741c7da8b1
commit 830bda5f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: () => {