salix/e2e/paths/11-zone/02_descriptor.spec.js

43 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-05-20 14:34:53 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Zone descriptor path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('deliveryBoss', 'zone');
2020-08-14 13:35:50 +00:00
await page.accessToSearchResult('13');
2020-05-20 14:34:53 +00:00
});
afterAll(async() => {
await browser.close();
});
2020-08-14 13:35:50 +00:00
it('should eliminate the zone using the descriptor option', async() => {
await page.waitToClick(selectors.zoneDescriptor.menu);
await page.waitToClick(selectors.zoneDescriptor.deleteZone);
await page.respondToDialog('accept');
await page.waitForState('zone.index');
2020-05-20 14:34:53 +00:00
});
2020-08-14 13:35:50 +00:00
it('should search for the deleted zone to find no results', async() => {
await page.doSearch('13');
const count = await page.countElement(selectors.zoneIndex.searchResult);
2020-05-20 14:34:53 +00:00
2020-08-14 13:35:50 +00:00
expect(count).toEqual(0);
});
it('should check the ticket whom lost the zone and see evidence on the logs', async() => {
await page.waitToClick(selectors.globalItems.homeButton);
await page.selectModule('ticket');
await page.accessToSearchResult('20');
await page.accessToSection('ticket.card.log');
const lastChanges = await page.waitToGetProperty(selectors.ticketLog.changes, 'innerText');
expect(lastChanges).toContain('1');
2020-05-20 14:34:53 +00:00
});
});