2018-03-22 14:01:36 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import createNightmare from '../../helpers/helpers';
|
|
|
|
|
|
|
|
describe('delete ticket expeditions path', () => {
|
|
|
|
const nightmare = createNightmare();
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
|
|
|
.waitForLogin('developer');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should access to the tickets index by clicking the tickets button', () => {
|
|
|
|
return nightmare
|
|
|
|
.click(selectors.moduleAccessView.ticketsSectionButton)
|
|
|
|
.wait(selectors.ticketsIndex.createTicketButton)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/ticket/list');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should search for the ticket with id 1', () => {
|
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchTicketInput)
|
|
|
|
.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 expeditions`, () => {
|
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, '1')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketExpedition.expeditionButton)
|
2018-03-23 14:08:14 +00:00
|
|
|
.waitForURL('expedition')
|
2018-03-22 14:01:36 +00:00
|
|
|
.url()
|
|
|
|
.then(url => {
|
2018-03-23 14:08:14 +00:00
|
|
|
expect(url).toContain('expedition');
|
2018-03-22 14:01:36 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should delete a former expedition and confirm the remaining expedition is the expected one`, () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
|
|
|
|
.click(selectors.ticketPackages.packagesButton)
|
|
|
|
.wait(selectors.ticketPackages.firstPackageSelect)
|
|
|
|
.click(selectors.ticketExpedition.expeditionButton)
|
|
|
|
.wait(selectors.ticketExpedition.secondExpeditionText)
|
|
|
|
.getInnerText(selectors.ticketExpedition.secondExpeditionText)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toContain('Iron Patriot');
|
|
|
|
expect(value).toContain('root');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|