diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 2e9bc37e8..7faf1f554 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -174,6 +174,12 @@ export default { confirmFirstPaymentButton: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon-button[icon="done_all"]', firstPaymentConfirmed: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon[icon="check"][aria-hidden="false"]' }, + dms: { + deleteFileButton: 'vn-client-dms-index vn-table vn-tr:nth-child(1) vn-icon-button[icon="delete"]', + firstDocWorker: 'vn-client-dms-index vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(8) > span', + firstDocWorkerDescriptor: 'vn-client-dms-index > vn-worker-descriptor-popover > vn-popover', + acceptDeleteButton: 'vn-client-dms-index > vn-confirm button[response="ACCEPT"]' + }, itemsIndex: { searchIcon: 'vn-item-index vn-searchbar vn-icon[icon="search"]', createItemButton: `${components.vnFloatButton}`, diff --git a/e2e/paths/02-client-module/17_dms.spec.js b/e2e/paths/02-client-module/17_dms.spec.js new file mode 100644 index 000000000..16a061f85 --- /dev/null +++ b/e2e/paths/02-client-module/17_dms.spec.js @@ -0,0 +1,33 @@ +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(); + }); + }); +});