#8442 - createVehicleDms #1614

Merged
jtubau merged 47 commits from 8422-createVehicleDms into dev 2025-04-16 14:20:24 +00:00
1 changed files with 10 additions and 4 deletions
Showing only changes of commit b26be0bf6d - Show all commits

View File

@ -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);
});