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

37 lines
1.2 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
2019-08-12 14:58:39 +00:00
describe('Client DMS', () => {
let browser;
2019-12-31 11:00:16 +00:00
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
2019-12-31 11:00:16 +00:00
await page.loginAndModule('salesPerson', 'client');
await page.accessToSearchResult('Tony Stark');
await page.accessToSection('client.card.dms.index');
});
2019-08-12 14:58:39 +00:00
2019-12-31 11:00:16 +00:00
afterAll(async() => {
await browser.close();
2019-12-31 11:00:16 +00:00
});
2019-08-12 14:58:39 +00:00
2019-12-31 11:00:16 +00:00
describe('as salesPerson', () => {
2019-08-12 14:58:39 +00:00
it('should delete de first file', async() => {
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.dms.deleteFileButton);
await page.waitToClick(selectors.dms.acceptDeleteButton);
let result = await page.waitForLastSnackbar();
2019-08-12 14:58:39 +00:00
expect(result).toEqual('Data saved!');
});
it(`should click on the first document line worker name making the descriptor visible`, async() => {
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.dms.firstDocWorker);
await page.wait(selectors.dms.firstDocWorkerDescriptor);
const visible = await page.isVisible(selectors.dms.firstDocWorkerDescriptor);
2019-08-12 14:58:39 +00:00
expect(visible).toBeTruthy();
});
});
});