2020-01-14 08:20:14 +00:00
|
|
|
import selectors from '../../helpers/selectors';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-08-12 14:58:39 +00:00
|
|
|
|
|
|
|
describe('Client DMS', () => {
|
2020-01-14 08:20:14 +00:00
|
|
|
let browser;
|
2019-12-31 11:00:16 +00:00
|
|
|
let page;
|
|
|
|
beforeAll(async() => {
|
2020-01-14 08:20:14 +00:00
|
|
|
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() => {
|
2020-01-14 08:40:50 +00:00
|
|
|
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);
|
2020-03-17 10:00:16 +00:00
|
|
|
await page.respondToDialog('accept');
|
2020-04-08 09:24:40 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2019-08-12 14:58:39 +00:00
|
|
|
|
2020-10-30 16:09:11 +00:00
|
|
|
expect(message.text).toBe('Data saved!');
|
2019-08-12 14:58:39 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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);
|
2020-02-12 13:36:05 +00:00
|
|
|
await page.waitForSelector(selectors.dms.firstDocWorkerDescriptor);
|
2019-12-31 11:00:16 +00:00
|
|
|
const visible = await page.isVisible(selectors.dms.firstDocWorkerDescriptor);
|
2019-08-12 14:58:39 +00:00
|
|
|
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|