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

37 lines
1.2 KiB
JavaScript
Raw Permalink 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);
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-11-10 11:06:21 +00:00
expect(message.text).toContain('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();
});
});
});