salix/e2e/paths/02-client-module/17_dms.spec.js

34 lines
1.2 KiB
JavaScript

import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('Client DMS', () => {
const nightmare = createNightmare();
describe('as salesPerson', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesPerson', 'client')
.accessToSearchResult('Tony Stark')
.accessToSection('client.card.dms.index');
});
it('should delete de first file', async() => {
let result = await nightmare
.waitToClick(selectors.dms.deleteFileButton)
.waitToClick(selectors.dms.acceptDeleteButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it(`should click on the first document line worker name making the descriptor visible`, async() => {
const visible = await nightmare
.waitToClick(selectors.dms.firstDocWorker)
.waitForClassPresent(selectors.dms.firstDocWorkerDescriptor, 'shown')
.isVisible(selectors.dms.firstDocWorkerDescriptor);
expect(visible).toBeTruthy();
});
});
});