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);
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|