#781 Extensiones nightmare loginAndModule extenstion
This commit is contained in:
parent
44a2ee24bc
commit
2bcfb0532e
|
@ -1,5 +1,6 @@
|
|||
/* eslint no-invalid-this: "off" */
|
||||
|
||||
import selectors from './selectors.js';
|
||||
import config from './config.js';
|
||||
import Nightmare from 'nightmare';
|
||||
import {URL} from 'url';
|
||||
|
@ -63,6 +64,20 @@ let actions = {
|
|||
.catch(done);
|
||||
},
|
||||
|
||||
selectModule: function(moduleName, done) {
|
||||
this.waitToClick(`body > vn-app > vn-vertical > vn-vertical > vn-home > div > div > a[ui-sref="${moduleName}.index"]`)
|
||||
.waitForURL(moduleName)
|
||||
.then(done)
|
||||
.catch(done);
|
||||
},
|
||||
|
||||
loginAndModule: function(userName, moduleName, done) {
|
||||
this.waitForLogin(userName)
|
||||
.selectModule(moduleName)
|
||||
.then(done)
|
||||
.catch(done);
|
||||
},
|
||||
|
||||
parsedUrl: function(done) {
|
||||
this.url()
|
||||
.then(url => {
|
||||
|
@ -268,7 +283,17 @@ let actions = {
|
|||
.then(shapes => {
|
||||
done(null, shapes);
|
||||
}).catch(done);
|
||||
}
|
||||
},
|
||||
|
||||
// indexSearchToSection: function(searchValue, sectionName, done) {
|
||||
// this.wait(`vn-${sectionName}-index vn-searchbar input`)
|
||||
// .type(`vn-${sectionName}-index vn-searchbar input`, searchValue)
|
||||
// .click(`vn-${sectionName}-index vn-searchbar vn-icon[icon="search"]`)
|
||||
// .waitForNumberOfElements(`vn-${sectionName}-index > div > div > vn-card:nth-child(2) > div > vn-item-client > a`, 1)
|
||||
// .countElement(selectors.clientsIndex.searchResult);
|
||||
|
||||
// expect(resultCount).toEqual(1);
|
||||
// }
|
||||
};
|
||||
|
||||
Object.keys(actions).forEach(function(name) {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Claim edit basic data path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesAssistant');
|
||||
});
|
||||
|
||||
it('should click on the Claims button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.claimsButton)
|
||||
.wait(selectors.claimsIndex.searchClaimInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/claim/index');
|
||||
.loginAndModule('salesAssistant', 'claim');
|
||||
});
|
||||
|
||||
it('should search for the claim with id 1', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Client create path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should access to the clients index by clicking the clients button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.clientsSectionButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Edit basicData path', () => {
|
|||
describe('as employee', () => {
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Bruce Wayne', async () => {
|
||||
|
@ -122,18 +111,7 @@ describe('Client Edit basicData path', () => {
|
|||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitToClick(selectors.globalItems.logOutButton)
|
||||
.waitForLogin('salesAssistant');
|
||||
});
|
||||
|
||||
it('should now click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('salesASsistant', 'client');
|
||||
});
|
||||
|
||||
it('should now search for the user Ptonomy Wallace', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Edit fiscalData path', () => {
|
|||
describe('as employee', () => {
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Bruce Banner', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Edit pay method path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('administrative');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('administrative', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Bruce Banner', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Add address path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Bruce Banner', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client add address notes path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Petter Parker', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Edit web access path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Bruce Banner', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Add notes path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async ()=> {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Bruce Banner', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Add credit path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesAssistant');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('salesAssistant', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Hank Pym', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client Add greuge path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesAssistant');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('salesAssistant', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Petter Parker', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client mandate path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesPerson');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('salesPerson', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Petter Parker', async () => {
|
||||
|
|
|
@ -7,18 +7,7 @@ describe('Client lock verified data path', () => {
|
|||
describe('as salesPerson', () => {
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesPerson');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('salesPerson', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Petter Parker', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client log path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
let url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user David Charles Haller', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Client risk path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('administrative');
|
||||
});
|
||||
|
||||
it('should click on the Clients button of the top bar menu', async () => {
|
||||
let url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
.loginAndModule('administrative', 'client');
|
||||
});
|
||||
|
||||
it('should search for the user Petter Parker', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item summary path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('employee', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Gem of Time', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item Edit basic data path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Gem of Mind', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item edit tax path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Gem of Time', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item create tags path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Gem of Time', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item create niche path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Gem of Time', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item Create botanical path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Mjolnir', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item Create barcodes path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Gem of Time', async () => {
|
||||
|
|
|
@ -6,16 +6,7 @@ describe('Item Create/Clone path', () => {
|
|||
describe('create', () => {
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('buyer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('buyer', 'item');
|
||||
});
|
||||
|
||||
it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async () => {
|
||||
|
|
|
@ -5,16 +5,7 @@ describe('Item regularize path', () => {
|
|||
const nightmare = createNightmare();
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('developer');
|
||||
});
|
||||
|
||||
it('should access to the items index by clicking the items button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||
.wait(selectors.itemsIndex.createItemButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
.loginAndModule('employee', 'item');
|
||||
});
|
||||
|
||||
it('should search for the item Mjolnir', async () => {
|
||||
|
|
|
@ -7,16 +7,7 @@ describe('Ticket', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should access to the tickets index by clicking the tickets button', async () => {
|
||||
let url = await nightmare
|
||||
.click(selectors.moduleAccessView.ticketsSectionButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket with id 1', async () => {
|
||||
|
|
|
@ -7,16 +7,7 @@ describe('Ticket', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('production');
|
||||
});
|
||||
|
||||
it('should access to the tickets index by clicking the tickets button', async () => {
|
||||
const url = await nightmare
|
||||
.click(selectors.moduleAccessView.ticketsSectionButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('production', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket with id 1', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket List sale path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket 8', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket Create packages path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket 1', async () => {
|
||||
|
|
|
@ -7,18 +7,7 @@ describe('Ticket', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('production');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
let url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('production', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket 1', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket Edit basic data path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
let url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket 11', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesPerson');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('salesPerson', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for a specific ticket', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket List components path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for the ticket 1', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should count the mount of tickets in the turns section', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket purchase request path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('salesPerson');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('salesPerson', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for a specific ticket', async () => {
|
||||
|
|
|
@ -7,18 +7,7 @@ describe('Ticket diary path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for a specific ticket', async () => {
|
||||
|
|
|
@ -6,18 +6,7 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.waitForLogin('employee');
|
||||
});
|
||||
|
||||
it('should click on the Tickets button of the top bar menu', async () => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
.loginAndModule('employee', 'ticket');
|
||||
});
|
||||
|
||||
it('should search for a specific ticket', async () => {
|
||||
|
|
|
@ -6,37 +6,25 @@ describe('create client path', () => {
|
|||
|
||||
beforeAll(() => {
|
||||
return nightmare
|
||||
.waitForLogin('employee');
|
||||
.loginAndModule('employee', 'client');
|
||||
});
|
||||
|
||||
it('should access to the clients index by clicking the clients button', () => {
|
||||
return nightmare
|
||||
.click(selectors.moduleAccessView.clientsSectionButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl()
|
||||
.then(url => {
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
});
|
||||
it('should access to the create client view by clicking the create-client floating button', async () => {
|
||||
let url = await nightmare
|
||||
.click(selectors.clientsIndex.createClientButton)
|
||||
.wait(selectors.createClientView.createButton)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/create');
|
||||
});
|
||||
|
||||
it('should access to the create client view by clicking the create-client floating button', () => {
|
||||
return nightmare
|
||||
.click(selectors.clientsIndex.createClientButton)
|
||||
.wait(selectors.createClientView.createButton)
|
||||
.parsedUrl()
|
||||
.then(url => {
|
||||
expect(url.hash).toEqual('#!/client/create');
|
||||
});
|
||||
});
|
||||
it('should cancel the client creation to go back to clients index', async () => {
|
||||
let url = await nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl();
|
||||
|
||||
it('should cancel the client creation to go back to clients index', () => {
|
||||
return nightmare
|
||||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.waitToClick(selectors.globalItems.clientsButton)
|
||||
.wait(selectors.clientsIndex.createClientButton)
|
||||
.parsedUrl()
|
||||
.then(url => {
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
});
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue