#172 e2e tracking state path
This commit is contained in:
parent
e6dd09cb6a
commit
16ba884d32
|
@ -306,6 +306,18 @@ export default {
|
|||
saleButton: `${components.vnMenuItem}[ui-sref="ticket.card.sale"]`,
|
||||
firstSaleText: `table > tbody > tr:nth-child(1)`,
|
||||
secondSaleText: `table > tbody > tr:nth-child(2)`
|
||||
},
|
||||
ticketTracking: {
|
||||
trackingButton: `${components.vnMenuItem}[ui-sref="ticket.card.tracking.index"]`,
|
||||
createStateButton: `${components.vnFloatButton}`,
|
||||
firstSaleText: `table > tbody > tr:nth-child(1)`,
|
||||
secondSaleText: `table > tbody > tr:nth-child(2)`
|
||||
},
|
||||
createStateView: {
|
||||
stateInput: `${components.vnAutocomplete}[field="$ctrl.ticket.stateFk"] > div > div > input`,
|
||||
stateInputOptionOne: `${components.vnAutocomplete}[field="$ctrl.ticket.stateFk"] vn-drop-down ul > li:nth-child(1)`,
|
||||
clearStateInputButton: `${components.vnAutocomplete}[field="$ctrl.ticket.stateFk"] > div > div > div > vn-icon > i`,
|
||||
saveStateButton: `${components.vnSubmit}`
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import createNightmare from '../../helpers/helpers';
|
||||
|
||||
describe('Ticket', () => {
|
||||
describe('Create new tracking state path', () => {
|
||||
const nightmare = createNightmare();
|
||||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('developer');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', () => {
|
||||
return nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.createTicketButton)
|
||||
.parsedUrl()
|
||||
.then(url => {
|
||||
expect(url.hash).toEqual('#!/ticket/list');
|
||||
});
|
||||
});
|
||||
|
||||
it('should search for the ticket 1', () => {
|
||||
return nightmare
|
||||
.wait(selectors.ticketsIndex.searchResult)
|
||||
.type(selectors.ticketsIndex.searchTicketInput, 1)
|
||||
.click(selectors.ticketsIndex.searchButton)
|
||||
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
||||
.countSearchResults(selectors.ticketsIndex.searchResult)
|
||||
.then(result => {
|
||||
expect(result).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
it(`should click on the search result to access to the ticket Tracking`, () => {
|
||||
return nightmare
|
||||
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Batman')
|
||||
.waitToClick(selectors.ticketsIndex.searchResult)
|
||||
.waitToClick(selectors.ticketTracking.trackingButton)
|
||||
.waitForURL('tracking/index')
|
||||
.url()
|
||||
.then(url => {
|
||||
expect(url).toContain('tracking/index');
|
||||
});
|
||||
});
|
||||
|
||||
it('should access to the create state view by clicking the create floating button', () => {
|
||||
return nightmare
|
||||
.click(selectors.ticketTracking.createStateButton)
|
||||
.wait(selectors.createStateView.stateInput)
|
||||
.parsedUrl()
|
||||
.then(url => {
|
||||
expect(url.hash).toContain('tracking/edit');
|
||||
});
|
||||
});
|
||||
|
||||
it(`should attempt create a new state but receive an error if state is empty`, () => {
|
||||
return nightmare
|
||||
.click(selectors.createStateView.saveStateButton)
|
||||
.waitForSnackbar()
|
||||
.then(result => {
|
||||
expect(result).toContain('No changes to save');
|
||||
});
|
||||
});
|
||||
|
||||
it(`should attempt create a new state but receive an error if state have been cleared`, () => {
|
||||
return nightmare
|
||||
.waitToClick(selectors.createStateView.stateInput)
|
||||
.waitToClick(selectors.createStateView.stateInputOptionOne)
|
||||
.waitToClick(selectors.createStateView.clearStateInputButton)
|
||||
.click(selectors.createStateView.saveStateButton)
|
||||
.waitForSnackbar()
|
||||
.then(result => {
|
||||
expect(result).toContain('El estado no puede estar en blanco'); // OLE!
|
||||
});
|
||||
});
|
||||
|
||||
it(`should create a new state`, () => {
|
||||
return nightmare
|
||||
.waitToClick(selectors.createStateView.stateInput)
|
||||
.waitToClick(selectors.createStateView.stateInputOptionOne)
|
||||
.click(selectors.createStateView.saveStateButton)
|
||||
.waitForSnackbar()
|
||||
.then(result => {
|
||||
expect(result).toContain('Data saved!');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue