salix/e2e/paths/05-ticket-module/15_create_ticket_from_clien...

40 lines
1.2 KiB
JavaScript

import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket create from client path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('Petter Parker');
});
afterAll(async() => {
await browser.close();
});
it('should click the create simple ticket on the descriptor menu', async() => {
await page.waitForContentLoaded();
await page.waitToClick(selectors.clientDescriptor.moreMenu);
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
let url = await page.expectURL('clientFk=102');
expect(url).toBe(true);
});
it('should check if the client details are the expected ones', async() => {
const client = await page
.waitToGetProperty(selectors.createTicketView.client, 'value');
const address = await page
.waitToGetProperty(selectors.createTicketView.address, 'value');
expect(client).toContain('Petter Parker');
expect(address).toContain('20 Ingram Street');
});
});