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

38 lines
1.1 KiB
JavaScript

import getBrowser from '../../helpers/puppeteer';
const $ = {
form: 'vn-ticket-create-card',
moreMenu: 'vn-client-descriptor vn-icon-button[icon=more_vert]',
simpleTicketButton: '.vn-menu [name="simpleTicket"]'
};
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 create simple ticket and check if the client details are the expected ones', async() => {
await page.waitToClick($.moreMenu);
await page.waitToClick($.simpleTicketButton);
await page.waitForState('ticket.create');
const values = {
client: 'Petter Parker',
address: 'Petter Parker'
};
const formValues = await page.fetchForm($.form, Object.keys(values));
expect(formValues).toEqual(values);
});
});