#833 e2e ticket.request
This commit is contained in:
parent
c0a3a66e6f
commit
a3be9a1b6d
|
@ -445,17 +445,19 @@ export default {
|
|||
total: 'vn-ticket-components tfoot > tr:nth-child(3) > td'
|
||||
},
|
||||
ticketRequests: {
|
||||
requestButton: `vn-left-menu a[ui-sref="ticket.card.request"]`,
|
||||
addRequestButton: `vn-ticket-request vn-icon[icon="add_circle"]`,
|
||||
request: 'vn-ticket-request > form > vn-card > div > vn-horizontal',
|
||||
fifthDescriptionInput: `vn-ticket-request > form > vn-card > div > vn-horizontal:nth-child(6) > vn-textfield:nth-child(1) > div > div > div.infix > input`,
|
||||
fifthQuantityInput: `vn-ticket-request > form > vn-card > div > vn-horizontal:nth-child(6) > vn-textfield:nth-child(2) > div > div > div.infix > input`,
|
||||
fifthAtenderSelect: `vn-ticket-request > form > vn-card > div > vn-horizontal:nth-child(6) > vn-autocomplete > div > div > input`,
|
||||
fifthAtenderSelectFirstOption: `vn-ticket-request > form > vn-card > div > vn-horizontal:nth-child(6) > vn-autocomplete vn-drop-down ul > li:nth-child(1)`,
|
||||
fifthAtenderSelectSecondOption: `vn-ticket-request > form > vn-card > div > vn-horizontal:nth-child(6) > vn-autocomplete vn-drop-down ul > li:nth-child(2)`,
|
||||
fifthPriceInput: `vn-ticket-request > form > vn-card > div > vn-horizontal:nth-child(6) > vn-textfield:nth-child(4) > div > div > div.infix > input`,
|
||||
fifthRemoveRequestButton: `vn-ticket-request vn-horizontal:nth-child(6) vn-icon[icon="remove_circle_outline"]`,
|
||||
saveButton: `${components.vnSubmit}`
|
||||
requestButton: `vn-left-menu a[ui-sref="ticket.card.request.index"]`,
|
||||
addRequestButton: `vn-ticket-request-index > a > vn-float-button > button`,
|
||||
request: 'vn-ticket-request-index > form > vn-card > div > vn-horizontal > vn-table > div > vn-tbody > vn-tr',
|
||||
descriptionInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-textfield > div > div > div.infix > input`,
|
||||
atenderSelect: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-autocomplete > div > div > input`,
|
||||
atenderSelectFirstOption: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(1)`,
|
||||
atenderSelectSecondOption: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(2)`,
|
||||
quantityInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(3) > vn-textfield:nth-child(1) > div > div > div.infix > input`,
|
||||
priceInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(3) > vn-textfield:nth-child(2) > div > div > div.infix > input`,
|
||||
firstRemoveRequestButton: `vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)`,
|
||||
saveButton: `vn-ticket-request-create > form > div > vn-button-bar > vn-submit[label="Create"] input`,
|
||||
firstDescription: 'vn-ticket-request-index > form > vn-card > div > vn-horizontal > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2)',
|
||||
|
||||
},
|
||||
createStateView: {
|
||||
stateInput: `vn-autocomplete[field="$ctrl.ticket.stateFk"] > div > div > input`,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import createNightmare from '../../helpers/nightmare';
|
||||
|
||||
describe('Item Create path', () => {
|
||||
describe('Item Create/Clone path', () => {
|
||||
const nightmare = createNightmare();
|
||||
describe('create', () => {
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
|
@ -94,9 +95,9 @@ describe('Item Create path', () => {
|
|||
|
||||
expect(result).toEqual('Spain');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Clone path', () => {
|
||||
describe('clone', () => {
|
||||
it('should return to the items index by clicking the return to items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.itemBasicData.goToItemIndexButton)
|
||||
|
@ -140,4 +141,5 @@ describe('Clone path', () => {
|
|||
|
||||
expect(result).toEqual(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import createNightmare from '../../helpers/nightmare';
|
||||
|
||||
xdescribe('Ticket purchase request path', () => {
|
||||
describe('Ticket purchase request path', () => {
|
||||
const nightmare = createNightmare();
|
||||
|
||||
beforeAll(() => {
|
||||
|
@ -45,74 +45,53 @@ xdescribe('Ticket purchase request path', () => {
|
|||
it(`should add a new request`, async () => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketRequests.addRequestButton)
|
||||
.wait(selectors.ticketRequests.fifthDescriptionInput)
|
||||
.type(selectors.ticketRequests.fifthDescriptionInput, 'New stuff')
|
||||
.type(selectors.ticketRequests.fifthQuantityInput, 99)
|
||||
.waitToClick(selectors.ticketRequests.fifthAtenderSelect)
|
||||
.waitToClick(selectors.ticketRequests.fifthAtenderSelectSecondOption)
|
||||
.type(selectors.ticketRequests.fifthPriceInput, 999)
|
||||
.wait(selectors.ticketRequests.descriptionInput)
|
||||
.type(selectors.ticketRequests.descriptionInput, 'New stuff')
|
||||
.type(selectors.ticketRequests.quantityInput, 99)
|
||||
.waitToClick(selectors.ticketRequests.atenderSelect)
|
||||
.waitToClick(selectors.ticketRequests.atenderSelectSecondOption)
|
||||
.type(selectors.ticketRequests.priceInput, 999)
|
||||
.waitToClick(selectors.ticketRequests.saveButton)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it(`should have been redirected to the request index`, async () => {
|
||||
const url = await nightmare
|
||||
.waitForURL('/request')
|
||||
.url();
|
||||
|
||||
expect(url).toContain('/request');
|
||||
});
|
||||
|
||||
it(`should confirm the new request was added`, async () => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
||||
.wait(selectors.ticketBasicData.clientSelect)
|
||||
.waitToClick(selectors.ticketRequests.requestButton)
|
||||
.waitForTextInInput(selectors.ticketRequests.fifthDescriptionInput, 'New Stuff')
|
||||
.getProperty(selectors.ticketRequests.fifthDescriptionInput, 'value');
|
||||
.waitProperty(selectors.ticketRequests.firstDescription, 'innerText')
|
||||
.getProperty(selectors.ticketRequests.firstDescription, 'innerText');
|
||||
|
||||
expect(result).toEqual('New stuff');
|
||||
});
|
||||
|
||||
it(`should edit the added request`, async () => {
|
||||
const result = await nightmare
|
||||
.clearInput(selectors.ticketRequests.fifthDescriptionInput)
|
||||
.type(selectors.ticketRequests.fifthDescriptionInput, 'Cool stuff')
|
||||
.clearInput(selectors.ticketRequests.fifthQuantityInput)
|
||||
.type(selectors.ticketRequests.fifthQuantityInput, 55)
|
||||
.waitToClick(selectors.ticketRequests.fifthAtenderSelect)
|
||||
.waitToClick(selectors.ticketRequests.fifthAtenderSelectFirstOption)
|
||||
.clearInput(selectors.ticketRequests.fifthPriceInput)
|
||||
.type(selectors.ticketRequests.fifthPriceInput, 55)
|
||||
.waitToClick(selectors.ticketRequests.saveButton)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it(`should confirm the new request was added`, async () => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
||||
.wait(selectors.ticketBasicData.clientSelect)
|
||||
.waitToClick(selectors.ticketRequests.requestButton)
|
||||
.waitForTextInInput(selectors.ticketRequests.fifthDescriptionInput, 'Cool Stuff')
|
||||
.getProperty(selectors.ticketRequests.fifthDescriptionInput, 'value');
|
||||
|
||||
expect(result).toEqual('Cool stuff');
|
||||
});
|
||||
|
||||
it(`should delete the added request`, async () => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketRequests.fifthRemoveRequestButton)
|
||||
.waitToClick(selectors.ticketRequests.saveButton)
|
||||
.waitToClick(selectors.ticketRequests.firstRemoveRequestButton)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
|
||||
it(`should confirm the new request was deleted`, async () => {
|
||||
it(`should confirm the request was deleted`, async () => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketBasicData.basicDataButton)
|
||||
.wait(selectors.ticketBasicData.clientSelect)
|
||||
.waitToClick(selectors.ticketRequests.requestButton)
|
||||
.wait(selectors.ticketRequests.request)
|
||||
.countElement(selectors.ticketRequests.request);
|
||||
.wait(selectors.ticketRequests.addRequestButton)
|
||||
.exists(selectors.ticketRequests.request);
|
||||
|
||||
expect(result).toEqual(4);
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue