e2e toolkit

This commit is contained in:
Carlos Jimenez Ruiz 2020-06-30 11:15:20 +02:00
parent 789769ad7d
commit b451b400bf
4 changed files with 13 additions and 6 deletions

View File

@ -558,7 +558,7 @@ let actions = {
}, selector); }, selector);
}, },
closePopup: async function(selector) { closePopup: async function() {
await Promise.all([ await Promise.all([
this.keyboard.press('Escape'), this.keyboard.press('Escape'),
this.waitFor('.vn-popup', {hidden: true}), this.waitFor('.vn-popup', {hidden: true}),

View File

@ -448,17 +448,18 @@ export default {
saleButton: 'vn-left-menu a[ui-sref="ticket.card.sale"]', saleButton: 'vn-left-menu a[ui-sref="ticket.card.sale"]',
saleLine: 'vn-table div > vn-tbody > vn-tr', saleLine: 'vn-table div > vn-tbody > vn-tr',
saleDescriptorPopover: '.vn-popover.shown vn-item-descriptor', saleDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
saleDescriptorPopoverSummaryButton: '.vn-popover.shown vn-item-descriptor a[ui-sref="item.card.summary({id: $ctrl.item.id})"]', saleDescriptorPopoverSummaryButton: '.vn-popover.shown vn-item-descriptor a[ui-sref="item.card.summary({id: $ctrl.descriptor.id})"]',
descriptorItemDiaryButton: '.vn-popover vn-item-descriptor vn-quick-link[icon="icon-transaction"] > a', descriptorItemDiaryButton: '.vn-popover vn-item-descriptor vn-quick-link[icon="icon-transaction"] > a',
newItemFromCatalogButton: 'vn-ticket-sale vn-float-button[icon="add"]', newItemFromCatalogButton: 'vn-ticket-sale vn-float-button[icon="add"]',
newItemButton: 'vn-ticket-sale vn-card vn-icon-button[icon="add_circle"]', newItemButton: 'vn-ticket-sale vn-card vn-icon-button[icon="add_circle"]',
moreMenu: 'vn-ticket-sale vn-tool-bar > vn-button-menu[vn-id="more-button"] > div > button', moreMenu: 'vn-ticket-sale vn-button[label="More"]',
moreMenuCreateClaim: '.vn-drop-down.shown li[name="Add claim"]', moreMenuCreateClaim: '.vn-drop-down.shown li[name="Add claim"]',
moreMenuReserve: '.vn-drop-down.shown li[name="Mark as reserved"]', moreMenuReserve: '.vn-drop-down.shown li[name="Mark as reserved"]',
moreMenuUnmarkReseved: '.vn-drop-down.shown li[name="Unmark as reserved"]', moreMenuUnmarkReseved: '.vn-drop-down.shown li[name="Unmark as reserved"]',
moreMenuUpdateDiscount: '.vn-drop-down.shown li[name="Update discount"]', moreMenuUpdateDiscount: '.vn-drop-down.shown li[name="Update discount"]',
transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text', transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text',
transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable', transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable',
firstSaleId: 'vn-ticket-sale vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > span',
firstSaleClaimIcon: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) vn-icon[icon="icon-claims"]', firstSaleClaimIcon: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) vn-icon[icon="icon-claims"]',
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
firstSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(1)', firstSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(1)',
@ -468,9 +469,9 @@ export default {
firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td-editable:nth-child(5)', firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td-editable:nth-child(5)',
firstSaleIdAutocomplete: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete', firstSaleIdAutocomplete: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete',
firstSalePrice: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(7) > span', firstSalePrice: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(7) > span',
firstSalePriceInput: '.vn-popover.shown [ng-model="$ctrl.editedPrice"]', firstSalePriceInput: '.vn-popover.shown input[ng-model="$ctrl.field"]',
firstSaleDiscount: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(8) > span', firstSaleDiscount: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(8) > span',
firstSaleDiscountInput: '.vn-popover.shown [ng-model="$ctrl.newDiscount"]', firstSaleDiscountInput: '.vn-popover.shown [ng-model="$ctrl.field"]',
firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(9)', firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(9)',
firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)', firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)',
firstSaleColour: 'vn-ticket-sale vn-tr:nth-child(1) vn-fetched-tags section', firstSaleColour: 'vn-ticket-sale vn-tr:nth-child(1) vn-fetched-tags section',

View File

@ -58,7 +58,7 @@ describe('Ticket Summary path', () => {
expect(result).toContain('000002'); expect(result).toContain('000002');
}); });
it(`should click on the first sale ID making the item descriptor visible`, async() => { it(`should click on the first sale ID to make the item descriptor visible`, async() => {
await page.waitToClick(selectors.ticketSummary.firstSaleItemId); await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
await page.waitImgLoad(selectors.ticketSummary.firstSaleDescriptorImage); await page.waitImgLoad(selectors.ticketSummary.firstSaleDescriptorImage);
const visible = await page.isVisible(selectors.ticketSummary.itemDescriptorPopover); const visible = await page.isVisible(selectors.ticketSummary.itemDescriptorPopover);

View File

@ -421,28 +421,34 @@
<vn-menu vn-id="moreOptions"> <vn-menu vn-id="moreOptions">
<vn-item translate <vn-item translate
name="sms"
ng-click="$ctrl.showSMSDialog()"> ng-click="$ctrl.showSMSDialog()">
Send shortage SMS Send shortage SMS
</vn-item> </vn-item>
<vn-item translate <vn-item translate
name="calculatePrice"
ng-click="$ctrl.calculateSalePrice()" ng-click="$ctrl.calculateSalePrice()"
ng-if="$ctrl.isEditable && $ctrl.hasOneSaleSelected()"> ng-if="$ctrl.isEditable && $ctrl.hasOneSaleSelected()">
Recalculate price Recalculate price
</vn-item> </vn-item>
<vn-item translate <vn-item translate
name="discount"
ng-click="$ctrl.showEditDiscountDialog($event)"> ng-click="$ctrl.showEditDiscountDialog($event)">
Update discount Update discount
</vn-item> </vn-item>
<vn-item translate <vn-item translate
name="claim"
ng-click="$ctrl.createClaim()"> ng-click="$ctrl.createClaim()">
Add claim Add claim
</vn-item> </vn-item>
<vn-item translate <vn-item translate
name="reserved"
ng-click="$ctrl.markAsReserved()" ng-click="$ctrl.markAsReserved()"
ng-if="$ctrl.isEditable"> ng-if="$ctrl.isEditable">
Mark as reserved Mark as reserved
</vn-item> </vn-item>
<vn-item translate <vn-item translate
name="unreserved"
ng-click="$ctrl.unmarkAsReserved()" ng-click="$ctrl.unmarkAsReserved()"
ng-if="$ctrl.isEditable && $ctrl.hasReserves()"> ng-if="$ctrl.isEditable && $ctrl.hasReserves()">
Unmark as reserved Unmark as reserved