Merge pull request 'e2e fix ticket sale' (#455) from e2e-fix into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #455
Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
Carlos Jimenez Ruiz 2020-11-13 19:59:54 +00:00
commit 90d6018d34
2 changed files with 18 additions and 3 deletions

View File

@ -496,7 +496,8 @@ export default {
moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input', moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input',
moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]', moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]',
moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]', moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]',
stateMenuButton: 'vn-ticket-sale vn-tool-bar > vn-button-menu[label="State"]' stateMenuButton: 'vn-ticket-sale vn-tool-bar > vn-button-menu[label="State"]',
moreMenuState: 'body > div > div > div.content > div.filter.ng-scope > vn-textfield'
}, },
ticketTracking: { ticketTracking: {
createStateButton: 'vn-float-button' createStateButton: 'vn-float-button'

View File

@ -35,9 +35,23 @@ describe('Ticket Edit sale path', () => {
}); });
it(`should set the ticket as libre`, async() => { it(`should set the ticket as libre`, async() => {
const searchValue = 'libre';
await page.waitToClick(selectors.ticketSales.stateMenuButton); await page.waitToClick(selectors.ticketSales.stateMenuButton);
await page.write('body > div > div > div.content > div.filter.ng-scope > vn-textfield', 'libre'); await page.write(selectors.ticketSales.moreMenuState, searchValue);
await page.waitFor(500); try {
await page.waitForFunction(searchValue => {
const element = document.querySelector('li.active');
if (element)
return element.innerText.toLowerCase().includes(searchValue.toLowerCase());
}, {}, searchValue);
} catch (error) {
const builtSelector = await page.selectorFormater(selectors.ticketSales.moreMenuState);
const inputValue = await page.evaluate(() => {
return document.querySelector('.vn-drop-down.shown vn-textfield input').value;
});
throw new Error(`${builtSelector} value is ${inputValue}! ${error}`);
}
await page.waitForState('ticket.card.sale');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();