#772 Ticket expeditions ha dejado de funcionar e2e

This commit is contained in:
Carlos Jimenez 2018-10-29 09:21:33 +01:00
parent 53fe9b6103
commit 545c6ef307
1 changed files with 21 additions and 30 deletions

View File

@ -10,56 +10,47 @@ describe('Ticket', () => {
.waitForLogin('production');
});
it('should access to the tickets index by clicking the tickets button', (done) => {
return nightmare
it('should access to the tickets index by clicking the tickets button', async () => {
const url = await nightmare
.click(selectors.moduleAccessView.ticketsSectionButton)
.wait(selectors.ticketsIndex.searchResult)
.parsedUrl()
.then((url) => {
.parsedUrl();
expect(url.hash).toEqual('#!/ticket/index');
done();
}).catch(done.fail);
});
it('should search for the ticket with id 1', (done) => {
return nightmare
it('should search for the ticket with id 1', async () => {
const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:1')
.click(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult)
.then((result) => {
.countElement(selectors.ticketsIndex.searchResult);
expect(result).toEqual(1);
done();
}).catch(done.fail);
});
it(`should click on the search result to access to the ticket expeditions`, (done) => {
return nightmare
it(`should click on the search result to access to the ticket expeditions`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, '1')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketExpedition.expeditionButton)
.waitForURL('expedition')
.url()
.then((url) => {
.url();
expect(url).toContain('expedition');
done();
}).catch(done.fail);
});
it(`should delete a former expedition and confirm the remaining expedition is the expected one`, (done) => {
return nightmare
it(`should delete a former expedition and confirm the remaining expedition are the expected one`, async () => {
const result = await 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');
done();
}).catch(done.fail);
.wait(selectors.ticketExpedition.expeditionRow)
.countElement(selectors.ticketExpedition.expeditionRow);
expect(result).toEqual(3);
});
});
});