From c6203a0654a0c229062f3538b75e872d3f73c895 Mon Sep 17 00:00:00 2001 From: Bernat Date: Thu, 11 Apr 2019 12:25:01 +0200 Subject: [PATCH] fix test ticketservice, update selectors and acl --- db/changes/10002-lent/00-ACL.sql | 1 + e2e/helpers/selectors.js | 2 +- .../05-ticket-module/13_create_ticket_services.spec.js | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 db/changes/10002-lent/00-ACL.sql diff --git a/db/changes/10002-lent/00-ACL.sql b/db/changes/10002-lent/00-ACL.sql new file mode 100644 index 000000000..6ca46845d --- /dev/null +++ b/db/changes/10002-lent/00-ACL.sql @@ -0,0 +1 @@ +INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('160', 'TicketServiceType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index c7663af4d..a8c3d44dc 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -455,7 +455,7 @@ export default { }, ticketService: { addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon', - firstDescriptionInput: 'vn-ticket-service vn-autocomplete[label="Documentos"]', + firstDescriptionAutocomplete: 'vn-ticket-service vn-autocomplete[field="service.description"]', firstQuantityInput: 'vn-ticket-service vn-input-number[label="Quantity"] input', firstPriceInput: 'vn-ticket-service vn-input-number[label="Price"] input', firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]', diff --git a/e2e/paths/05-ticket-module/13_create_ticket_services.spec.js b/e2e/paths/05-ticket-module/13_create_ticket_services.spec.js index 0b1c08463..5a35ba337 100644 --- a/e2e/paths/05-ticket-module/13_create_ticket_services.spec.js +++ b/e2e/paths/05-ticket-module/13_create_ticket_services.spec.js @@ -13,8 +13,7 @@ describe('Ticket services path', () => { it('should edit the first service', async() => { const result = await nightmare - .clearInput(selectors.ticketService.firstDescriptionInput) - .write(selectors.ticketService.firstDescriptionInput, 'my service') + .autocompleteSearch(selectors.ticketService.firstDescriptionAutocomplete, 'Documentos') .clearInput(selectors.ticketService.firstQuantityInput) .write(selectors.ticketService.firstQuantityInput, 99) .clearInput(selectors.ticketService.firstPriceInput) @@ -29,9 +28,9 @@ describe('Ticket services path', () => { it('should confirm the service description was edited correctly', async() => { const result = await nightmare .reloadSection('ticket.card.service') - .waitToGetProperty(selectors.ticketService.firstDescriptionInput, 'value'); + .waitToGetProperty(`${selectors.ticketService.firstDescriptionAutocomplete} input`, 'value'); - expect(result).toEqual('my service'); + expect(result).toEqual('Documentos'); }); it('should confirm the service quantity was edited correctly', async() => {