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

37 lines
1.2 KiB
JavaScript

import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
describe('Client DMS', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesPerson', 'client');
await page.accessToSearchResult('Tony Stark');
await page.accessToSection('client.card.dms.index');
});
afterAll(async() => {
await browser.close();
});
describe('as salesPerson', () => {
it('should delete de first file', async() => {
await page.waitToClick(selectors.dms.deleteFileButton);
await page.respondToDialog('accept');
let result = await page.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it(`should click on the first document line worker name making the descriptor visible`, async() => {
await page.waitToClick(selectors.dms.firstDocWorker);
await page.waitForSelector(selectors.dms.firstDocWorkerDescriptor);
const visible = await page.isVisible(selectors.dms.firstDocWorkerDescriptor);
expect(visible).toBeTruthy();
});
});
});