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

39 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-01-16 14:02:50 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2019-01-16 14:02:50 +00:00
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');
});
2019-01-16 14:02:50 +00:00
afterAll(async() => {
await browser.close();
2019-01-16 14:02:50 +00:00
});
it('should click the create simple ticket on the descriptor menu', async() => {
await page.waitToClick(selectors.clientDescriptor.moreMenu);
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
2020-02-04 15:21:10 +00:00
let url = await page.expectURL('clientFk=102');
2019-01-16 14:02:50 +00:00
2020-02-04 15:21:10 +00:00
expect(url).toBe(true);
2019-01-16 14:02:50 +00:00
});
it('should check if the client details are the expected ones', async() => {
const client = await page
2020-02-03 14:55:11 +00:00
.waitToGetProperty(selectors.createTicketView.client, 'value');
2019-01-16 14:02:50 +00:00
const address = await page
2020-02-03 14:55:11 +00:00
.waitToGetProperty(selectors.createTicketView.address, 'value');
2019-01-16 14:02:50 +00:00
expect(client).toContain('Petter Parker');
expect(address).toContain('20 Ingram Street');
});
});