#8442 - createVehicleDms #1614
|
@ -641,13 +641,19 @@ Cypress.Commands.add(
|
|||
|
||||
Cypress.Commands.add('testDmsAction', (action, selectors, data, message, content) => {
|
||||
cy.get(selectors.actionBtn).click();
|
||||
if (action !== 'delete') cy.fillInForm(data);
|
||||
if (action === 'create')
|
||||
|
||||
if (action === 'create') {
|
||||
cy.dataCy(selectors.fileInput).selectFile('test/cypress/fixtures/image.jpg', {
|
||||
force: true,
|
||||
});
|
||||
if (action === 'delete') cy.clickConfirm();
|
||||
if (action !== 'delete') cy.dataCy(selectors.saveFormBtn).click();
|
||||
}
|
||||
|
||||
if (action !== 'delete') {
|
||||
cy.fillInForm(data);
|
||||
cy.dataCy(selectors.saveFormBtn).click();
|
||||
} else cy.clickConfirm();
|
||||
|
||||
cy.checkNotification(message);
|
||||
|
||||
if (action !== 'create') cy.containContent(selectors.selectorContentToCheck, content);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue