#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 22 additions and 18 deletions
Showing only changes of commit 070def57bb - Show all commits

View File

@ -32,12 +32,14 @@ describe('Vehicle DMS', () => {
};
const updateData = {
Reference: { val: 'Vehicle:5678-DEF' },
Reference: { val: 'Vehicle:4598-FGH' },
Company: { val: 'CCs', type: 'select' },
Warehouse: { val: 'Warehouse Two', type: 'select' },
Type: { val: 'Facturas Recibidas', type: 'select' },
};
const workerSummaryUrlRegex = /worker\/\d+\/summary/;
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@ -51,16 +53,22 @@ describe('Vehicle DMS', () => {
.should('have.length.greaterThan', 0);
});
it('Should download DMS', () => {
cy.get(selectors.lastRowDownloadBtn).click();
cy.wait(2000);
const downloadsFolder = Cypress.config('downloadsFolder');
const fileName = '11.jpg';
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
});
it('Should create new DMS', () => {
const uploadFolder = Cypress.config('tmpUploadFolder');
cy.dataCy(selectors.addBtn).click();
cy.dataCy(selectors.referenceInput).type(`{selectall}${data.Reference.val}`);
cy.dataCy(selectors.fileInput).selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.dataCy(selectors.saveFormBtn).click();
const fileName = 'image.jpg';
cy.readFile(`${uploadFolder}/${fileName}`).should('exist');
cy.checkNotification('Data saved');
});
@ -87,22 +95,18 @@ describe('Vehicle DMS', () => {
cy.get(selectors.lastRowDeleteBtn).click();
cy.clickConfirm();
cy.checkNotification('Data deleted');
cy.validateContent(selectors.lastRowReference, 'Vehicle:3333-BAT');
});
it('Should download DMS', () => {
const downloadsFolder = Cypress.config('downloadsFolder');
cy.get(selectors.lastRowDownloadBtn).click();
cy.wait(3000);
const fileName = '1.txt';
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
cy.containContent(selectors.lastRowReference, 'Vehicle:3333-BAT');
});
it('Should redirect to worker summary from worker descriptor pop-up', () => {
jtubau marked this conversation as resolved Outdated

Lo mismo que los popup del otro archivo de tests

Lo mismo que los popup del otro archivo de tests
cy.get(selectors.lastRowWorkerLink).click();
cy.get(selectors.descriptorTitle).should('contain', 'administrative');
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.containContent(selectors.summaryTitle, 'administrative');
cy.get(selectors.lastRowWorkerLink)
.click()
.invoke('text')
.then((workerName) => {
workerName = workerName.trim();
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.url().should('match', workerSummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, workerName);
});
});
});