2020-01-23 15:01:29 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-01-16 14:02:50 +00:00
|
|
|
|
2023-05-05 06:12:38 +00:00
|
|
|
const $ = {
|
|
|
|
form: 'vn-ticket-create-card',
|
|
|
|
moreMenu: 'vn-client-descriptor vn-icon-button[icon=more_vert]',
|
|
|
|
simpleTicketButton: '.vn-menu [name="simpleTicket"]'
|
|
|
|
};
|
|
|
|
|
2019-01-16 14:02:50 +00:00
|
|
|
describe('Ticket create from client path', () => {
|
2020-01-23 15:01:29 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('employee', 'client');
|
|
|
|
await page.accessToSearchResult('Petter Parker');
|
|
|
|
});
|
2019-01-16 14:02:50 +00:00
|
|
|
|
2020-01-23 15:01:29 +00:00
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
2019-01-16 14:02:50 +00:00
|
|
|
});
|
|
|
|
|
2023-05-05 06:12:38 +00:00
|
|
|
it('should create simple ticket and check if the client details are the expected ones', async() => {
|
|
|
|
await page.waitToClick($.moreMenu);
|
|
|
|
await page.waitToClick($.simpleTicketButton);
|
2020-03-24 15:49:36 +00:00
|
|
|
await page.waitForState('ticket.create');
|
2019-01-16 14:02:50 +00:00
|
|
|
|
2023-05-05 06:12:38 +00:00
|
|
|
const values = {
|
|
|
|
client: 'Petter Parker',
|
|
|
|
address: 'Petter Parker'
|
|
|
|
};
|
|
|
|
const formValues = await page.fetchForm($.form, Object.keys(values));
|
2019-01-16 14:02:50 +00:00
|
|
|
|
2023-05-05 06:12:38 +00:00
|
|
|
expect(formValues).toEqual(values);
|
2019-01-16 14:02:50 +00:00
|
|
|
});
|
|
|
|
});
|