refactor: refs #8441 intercept api call instead .q-notification
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
ee150a6f26
commit
4b9e533ccd
|
@ -35,12 +35,16 @@ describe('Vehicle list', () => {
|
|||
});
|
||||
|
||||
it('Should add new vehicle', () => {
|
||||
cy.intercept('POST', '/api/Vehicles').as('postRequest');
|
||||
cy.addBtnClick();
|
||||
cy.fillInForm(data);
|
||||
cy.dataCy(selectors.saveFormBtn).click();
|
||||
cy.dataCy(selectors.saveFormBtn).should('be.visible').click();
|
||||
|
||||
cy.checkNotification('Data created');
|
||||
cy.url().should('match', summaryUrlRegex);
|
||||
cy.wait('@postRequest').then((interception) => {
|
||||
expect(interception.response.statusCode).to.eq(200);
|
||||
});
|
||||
|
||||
cy.location().should('match', summaryUrlRegex);
|
||||
cy.containContent(selectors.descriptorTitle, expected);
|
||||
});
|
||||
|
||||
|
@ -50,7 +54,7 @@ describe('Vehicle list', () => {
|
|||
.invoke('text')
|
||||
.then((numberPlate) => {
|
||||
numberPlate = numberPlate.trim();
|
||||
cy.url().should('match', summaryUrlRegex);
|
||||
cy.location().should('match', summaryUrlRegex);
|
||||
cy.containContent(selectors.descriptorTitle, numberPlate);
|
||||
});
|
||||
});
|
||||
|
@ -62,7 +66,7 @@ describe('Vehicle list', () => {
|
|||
numberPlate = numberPlate.trim();
|
||||
cy.get(selectors.summaryPopupBtn).click();
|
||||
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||
cy.url().should('match', summaryUrlRegex);
|
||||
cy.location().should('match', summaryUrlRegex);
|
||||
cy.containContent(selectors.descriptorTitle, numberPlate);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue