36 lines
1.2 KiB
JavaScript
36 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.waitToClick(selectors.clientDescriptor.moreMenu);
|
|
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
|
|
await page.waitForState('ticket.create');
|
|
});
|
|
|
|
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');
|
|
});
|
|
});
|