Merge pull request 'e2e fix ticket sale' (#455) from e2e-fix into dev
gitea/salix/pipeline/head This commit looks good
Details
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:
commit
90d6018d34
|
@ -496,7 +496,8 @@ export default {
|
|||
moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input',
|
||||
moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]',
|
||||
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: {
|
||||
createStateButton: 'vn-float-button'
|
||||
|
|
|
@ -35,9 +35,23 @@ describe('Ticket Edit sale path', () => {
|
|||
});
|
||||
|
||||
it(`should set the ticket as libre`, async() => {
|
||||
const searchValue = 'libre';
|
||||
await page.waitToClick(selectors.ticketSales.stateMenuButton);
|
||||
await page.write('body > div > div > div.content > div.filter.ng-scope > vn-textfield', 'libre');
|
||||
await page.waitFor(500);
|
||||
await page.write(selectors.ticketSales.moreMenuState, searchValue);
|
||||
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');
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
|
Loading…
Reference in New Issue