#781 Extensiones nightmare for search and access sections

This commit is contained in:
Carlos Jimenez 2018-12-03 00:45:34 +01:00
parent f9a05238e6
commit 4d42e417c0
32 changed files with 130 additions and 768 deletions

View File

@ -10,7 +10,7 @@
<span translate>{{::item.description}}</span>
</a>
<ul ng-if="item.childs.length > 0 && item.active">
<ul ng-show="item.childs.length > 0 && item.active">
<li ng-repeat="child in ::item.childs">
<a ui-sref="{{::child.state}}" ng-class="{active: child.active}">
<vn-icon icon="{{::child.icon}}"></vn-icon>

View File

@ -1,6 +1,5 @@
/* eslint no-invalid-this: "off" */
import selectors from './selectors.js';
import config from './config.js';
import Nightmare from 'nightmare';
import {URL} from 'url';
@ -176,7 +175,6 @@ let actions = {
}, selector, count)
.then(done)
.catch(err => {
console.error(err.name, err.message);
done(new Error(`.waitForNumberOfElements() for ${selector}, count ${count} timed out`));
});
},
@ -285,15 +283,39 @@ let actions = {
}).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);
accessToSearchResult: function(searchValue, done) {
this.wait(`vn-searchbar input`)
.type(`vn-searchbar input`, searchValue)
.click(`vn-searchbar vn-icon[icon="search"]`)
.evaluate(() => {
return document.querySelector('ui-view vn-card vn-table') != null;
})
.then(result => {
if (result)
return this.waitToClick('ui-view vn-card vn-td');
// expect(resultCount).toEqual(1);
// }
return this.waitToClick('ui-view vn-card a');
})
.then(done)
.catch(done);
},
accessToSection: function(sectionRoute, done) {
this.wait(`vn-left-menu`)
.evaluate(sectionRoute => {
return document.querySelector(`vn-left-menu ul li ul li > a[ui-sref="${sectionRoute}"]`) != null;
}, sectionRoute)
.then(nested => {
if (!nested)
return this.waitToClick(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`);
return this.waitToClick('vn-left-menu .collapsed')
.wait('vn-left-menu .expanded')
.waitToClick(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`);
})
.then(done)
.catch(done);
}
};
Object.keys(actions).forEach(function(name) {

View File

@ -6,28 +6,9 @@ describe('Claim edit basic data path', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesAssistant', 'claim');
});
it('should search for the claim with id 1', async () => {
const resultCount = await nightmare
.wait(selectors.claimsIndex.searchClaimInput)
.type(selectors.claimsIndex.searchClaimInput, '1')
.click(selectors.claimsIndex.searchButton)
.waitForNumberOfElements(selectors.claimsIndex.searchResult, 1)
.countElement(selectors.claimsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the claim Basic Data`, async () => {
const url = await nightmare
.waitToClick(selectors.claimsIndex.searchResult)
.waitToClick(selectors.claimBasicData.basicDataButton)
.waitForURL('basic-data')
.parsedUrl();
expect(url.hash).toContain('basic-data');
.loginAndModule('salesAssistant', 'claim')
.accessToSearchResult('1')
.accessToSection('claim.card.basicData');
});
it(`should edit claim state, is paid with mana and observation fields`, async () => {

View File

@ -20,24 +20,6 @@ describe('Client create path', () => {
expect(result).toEqual(0);
});
it('should access to the create client view by clicking the create-client floating button', async () => {
const url = await nightmare
.click(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton)
.parsedUrl();
expect(url.hash).toEqual('#!/client/create');
});
it('should return to the client index by clicking the cancel button', async () => {
const url = await nightmare
.click(selectors.createClientView.cancelButton)
.wait(selectors.clientsIndex.createClientButton)
.parsedUrl();
expect(url.hash).toEqual('#!/client/index');
});
it('should now access to the create client view by clicking the create-client floating button', async () => {
const url = await nightmare
.click(selectors.clientsIndex.createClientButton)

View File

@ -6,33 +6,13 @@ describe('Client Edit basicData path', () => {
describe('as employee', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user Bruce Wayne', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Wayne')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it('should click on the search result to access to the client summary', async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Wayne')
.waitToClick(selectors.clientsIndex.searchResult)
.waitForURL('summary')
.parsedUrl();
expect(url.hash).toContain('summary');
.loginAndModule('employee', 'client')
.accessToSearchResult('Bruce Wayne')
.accessToSection('client.card.basicData');
});
it('should not be able to change the salesPerson', async () => {
const result = await nightmare
.click(selectors.clientBasicData.basicDataButton)
.wait(selectors.clientBasicData.nameInput)
.evaluate(selector => {
return document.querySelector(selector).disabled;
@ -111,33 +91,13 @@ describe('Client Edit basicData path', () => {
beforeAll(() => {
nightmare
.waitToClick(selectors.globalItems.logOutButton)
.loginAndModule('salesASsistant', 'client');
});
it('should now search for the user Ptonomy Wallace', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Ptonomy Wallace')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it('should now click on the search result to access to the client summary', async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Ptonomy Wallace')
.waitToClick(selectors.clientsIndex.searchResult)
.waitForURL('summary')
.parsedUrl();
expect(url.hash).toContain('summary');
.loginAndModule('salesASsistant', 'client')
.accessToSearchResult('Ptonomy Wallace')
.accessToSection('client.card.basicData');
});
it('should be able to change the salesPerson', async () => {
const result = await nightmare
.click(selectors.clientBasicData.basicDataButton)
.wait(selectors.clientBasicData.nameInput)
.evaluate(selector => {
return document.querySelector(selector).disabled;

View File

@ -6,33 +6,12 @@ describe('Client Edit fiscalData path', () => {
describe('as employee', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user Bruce Banner', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
.loginAndModule('employee', 'client')
.accessToSearchResult('Bruce Banner')
.accessToSection('client.card.address.index');
});
// Confirms all addresses have EQtax false for future propagation test step 1
it(`should click on the search result to access to the client's addresses`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientAddresses.addressesButton)
.waitForURL('/address/index')
.parsedUrl();
expect(url.hash).toContain('/address/index');
});
// Confirms all addresses have EQtax false for future propagation test step 2
it(`should click on the 1st edit icon to check EQtax isnt checked`, async () => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.firstEditButton)
@ -44,7 +23,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy();
});
// Confirms all addresses have EQtax false for future propagation test step 3
// Confirms all addresses have EQtax false for future propagation test step 2
it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, async () => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.addressesButton)
@ -79,40 +58,9 @@ describe('Client Edit fiscalData path', () => {
describe('as administrative', () => {
beforeAll(() => {
nightmare
.waitForLogin('administrative');
});
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');
});
it('should now search for the user Bruce Banner', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should access to the client fiscal data`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
.waitForURL('fiscal-data')
.parsedUrl();
expect(url.hash).toContain('fiscal-data');
.loginAndModule('administrative', 'client')
.accessToSearchResult('Bruce Banner')
.accessToSection('client.card.fiscalData');
});
it('should receive an error if VIES and EQtax are being ticked together', async () => {

View File

@ -6,29 +6,9 @@ describe('Client Edit pay method path', () => {
beforeAll(() => {
nightmare
.loginAndModule('administrative', 'client');
});
it('should search for the user Bruce Banner', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's pay method`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientPayMethod.payMethodButton)
.waitForURL('billing-data')
.parsedUrl();
expect(url.hash).toContain('billing-data');
.loginAndModule('administrative', 'client')
.accessToSearchResult('Bruce Banner')
.accessToSection('client.card.billingData');
});
it(`should attempt to edit the Pay method without an IBAN but fail`, async () => {

View File

@ -6,29 +6,9 @@ describe('Client Add address path', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user Bruce Banner', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client addresses`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientAddresses.addressesButton)
.waitForURL('address/index')
.parsedUrl();
expect(url.hash).toContain('address/index');
.loginAndModule('employee', 'client')
.accessToSearchResult('Bruce Banner')
.accessToSection('client.card.address.index');
});
it(`should click on the add new address button to access to the new address form`, async () => {

View File

@ -6,29 +6,9 @@ describe('Client add address notes path', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user Petter Parker', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client addresses`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientAddresses.addressesButton)
.waitForURL('address/index')
.parsedUrl();
expect(url.hash).toContain('address/index');
.loginAndModule('employee', 'client')
.accessToSearchResult('Petter Parker')
.accessToSection('client.card.address.index');
});
it(`should click on the edit icon of the default address`, async () => {

View File

@ -6,30 +6,9 @@ describe('Client Edit web access path', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user Bruce Banner', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's web access`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientsIndex.othersButton)
.waitToClick(selectors.clientWebAccess.webAccessButton)
.waitForURL('web-access')
.parsedUrl();
expect(url.hash).toContain('web-access');
.loginAndModule('employee', 'client')
.accessToSearchResult('Bruce Banner')
.accessToSection('client.card.webAccess');
});
it(`should uncheck the Enable web access checkbox and update the name`, async () => {

View File

@ -6,29 +6,9 @@ describe('Client Add notes path', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user Bruce Banner', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's notes`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientNotes.notesButton)
.waitForURL('note/index')
.parsedUrl();
expect(url.hash).toContain('note/index');
.loginAndModule('employee', 'client')
.accessToSearchResult('Bruce Banner')
.accessToSection('client.card.note.index');
});
it(`should click on the add note button`, async () => {

View File

@ -6,29 +6,9 @@ describe('Client Add credit path', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesAssistant', 'client');
});
it('should search for the user Hank Pym', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Hank Pym')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's credit`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Hank Pym')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientCredit.creditButton)
.waitForURL('credit/index')
.parsedUrl();
expect(url.hash).toContain('credit/index');
.loginAndModule('salesAssistant', 'client')
.accessToSearchResult('Hank Pym')
.accessToSection('client.card.credit.index');
});
it(`should click on the add credit button`, async () => {

View File

@ -6,29 +6,9 @@ describe('Client Add greuge path', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesAssistant', 'client');
});
it('should search for the user Petter Parker', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's greuge`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientGreuge.greugeButton)
.waitForURL('greuge/index')
.parsedUrl();
expect(url.hash).toContain('greuge/index');
.loginAndModule('salesAssistant', 'client')
.accessToSearchResult('Petter Parker')
.accessToSection('client.card.greuge.index');
});
it(`should click on the add greuge button`, async () => {

View File

@ -6,30 +6,9 @@ describe('Client mandate path', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesPerson', 'client');
});
it('should search for the user Petter Parker', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's mandate`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientsIndex.othersButton)
.waitToClick(selectors.clientMandate.mandateButton)
.waitForURL('mandate')
.parsedUrl();
expect(url.hash).toContain('mandate');
.loginAndModule('salesPerson', 'client')
.accessToSearchResult('Petter Parker')
.accessToSection('client.card.mandate');
});
it('should confirm the client has a mandate of the CORE type', async () => {

View File

@ -7,38 +7,9 @@ describe('Client lock verified data path', () => {
describe('as salesPerson', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesPerson', 'client');
});
it('should search for the user Petter Parker', async () => {
const resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's fiscal data`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
.waitForURL('fiscal-data')
.parsedUrl();
expect(url.hash).toContain('fiscal-data');
});
it(`should click on the fiscal data button to start editing`, async () => {
const url = await nightmare
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
.waitForURL('fiscal-data')
.parsedUrl();
expect(url.hash).toContain('fiscal-data');
.loginAndModule('salesPerson', 'client')
.accessToSearchResult('Petter Parker')
.accessToSection('client.card.fiscalData');
});
it('should confirm verified data button is disabled for salesPerson', async () => {

View File

@ -6,29 +6,9 @@ describe('Client log path', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client');
});
it('should search for the user David Charles Haller', async () => {
let resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'DavidCharlesHaller')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's fiscal data`, async () => {
let url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'DavidCharlesHaller')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientBasicData.basicDataButton)
.waitForURL('basic-data')
.parsedUrl();
expect(url.hash).toContain('basic-data');
.loginAndModule('employee', 'client')
.accessToSearchResult('DavidCharlesHaller')
.accessToSection('client.card.basicData');
});
it('should update the clients name', async () => {

View File

@ -6,29 +6,9 @@ describe('Client risk path', () => {
beforeAll(() => {
nightmare
.loginAndModule('administrative', 'client');
});
it('should search for the user Petter Parker', async () => {
let resultCount = await nightmare
.wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the client's risk`, async () => {
let url = await nightmare
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
.waitToClick(selectors.clientsIndex.searchResult)
.waitToClick(selectors.clientRisk.riskButton)
.waitForURL('/risk')
.parsedUrl();
expect(url.hash).toContain('/risk');
.loginAndModule('administrative', 'client')
.accessToSearchResult('Petter Parker')
.accessToSection('client.card.risk.index');
});
it('should click the new payment button', async () => {

View File

@ -6,29 +6,9 @@ describe('Item Edit basic data path', () => {
beforeAll(() => {
nightmare
.loginAndModule('buyer', 'item');
});
it('should search for the item Gem of Mind', async () => {
const resultCount = await nightmare
.wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Gem of Mind')
.click(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the item basic data`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Mind')
.waitToClick(selectors.itemsIndex.searchResult)
.waitToClick(selectors.itemBasicData.basicDataButton)
.waitForURL('data')
.parsedUrl();
expect(url.hash).toContain('data');
.loginAndModule('buyer', 'item')
.accessToSearchResult('Gem of Mind')
.accessToSection('item.card.data');
});
it(`should edit the item basic data`, async () => {

View File

@ -6,29 +6,9 @@ describe('Item edit tax path', () => {
beforeAll(() => {
nightmare
.loginAndModule('buyer', 'item');
});
it('should search for the item Gem of Time', async () => {
const resultCount = await nightmare
.wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
.click(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the item tax`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time')
.waitToClick(selectors.itemsIndex.searchResult)
.waitToClick(selectors.itemTax.taxButton)
.waitForURL('tax')
.parsedUrl();
expect(url.hash).toContain('tax');
.loginAndModule('buyer', 'item')
.accessToSearchResult('Gem of Time')
.accessToSection('item.card.tax');
});
it(`should add the item tax to all countries`, async () => {

View File

@ -6,29 +6,9 @@ describe('Item create tags path', () => {
beforeAll(() => {
nightmare
.loginAndModule('buyer', 'item');
});
it('should search for the item Gem of Time', async () => {
const resultCount = await nightmare
.wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
.click(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the item tags`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time')
.waitToClick(selectors.itemsIndex.searchResult)
.waitToClick(selectors.itemTags.tagsButton)
.waitForURL('tags')
.parsedUrl();
expect(url.hash).toContain('tags');
.loginAndModule('buyer', 'item')
.accessToSearchResult('Gem of Time')
.accessToSection('item.card.tags');
});
it(`should create a new tag and delete a former one`, async () => {

View File

@ -6,29 +6,9 @@ describe('Item create niche path', () => {
beforeAll(() => {
nightmare
.loginAndModule('buyer', 'item');
});
it('should search for the item Gem of Time', async () => {
const resultCount = await nightmare
.wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
.click(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
expect(resultCount).toEqual(1);
});
it(`should click on the search result to access to the item niches`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time')
.waitToClick(selectors.itemsIndex.searchResult)
.waitToClick(selectors.itemNiches.nicheButton)
.waitForURL('niche')
.parsedUrl();
expect(url.hash).toContain('niche');
.loginAndModule('buyer', 'item')
.accessToSearchResult('Gem of Time')
.accessToSection('item.card.niche');
});
it(`should click create a new niche and delete a former one`, async () => {

View File

@ -6,29 +6,9 @@ describe('Item Create botanical path', () => {
beforeAll(() => {
nightmare
.loginAndModule('buyer', 'item');
});
it('should search for the item Mjolnir', async () => {
const result = await nightmare
.wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Mjolnir')
.click(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the item botanical`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir')
.waitToClick(selectors.itemsIndex.searchResult)
.waitToClick(selectors.itemBotanical.botanicalButton)
.waitForURL('botanical')
.parsedUrl();
expect(url.hash).toContain('botanical');
.loginAndModule('buyer', 'item')
.accessToSearchResult('Mjolnir')
.accessToSection('item.card.botanical');
});
it(`should create a new botanical for the item with id Mjolnir`, async () => {

View File

@ -6,29 +6,9 @@ describe('Item Create barcodes path', () => {
beforeAll(() => {
nightmare
.loginAndModule('buyer', 'item');
});
it('should search for the item Gem of Time', async () => {
const result = await nightmare
.wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
.click(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the item barcodes`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time')
.waitToClick(selectors.itemsIndex.searchResult)
.waitToClick(selectors.itemBarcodes.barcodeButton)
.waitForURL('barcode')
.parsedUrl();
expect(url.hash).toContain('barcode');
.loginAndModule('buyer', 'item')
.accessToSearchResult('Gem of Time')
.accessToSection('item.card.itemBarcode');
});
it(`should click create a new code and delete a former one`, async () => {

View File

@ -7,29 +7,9 @@ describe('Ticket', () => {
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket');
});
it('should search for the ticket with id 1', async () => {
let 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);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket notes`, async () => {
let url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, '1')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketNotes.notesButton)
.waitForURL('observation')
.parsedUrl();
expect(url.hash).toContain('observation');
.loginAndModule('employee', 'ticket')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.observation');
});
it(`should click create a new note and delete a former one`, async () => {

View File

@ -7,29 +7,9 @@ describe('Ticket', () => {
beforeAll(() => {
return nightmare
.loginAndModule('production', 'ticket');
});
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);
expect(result).toEqual(1);
});
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')
.parsedUrl();
expect(url.hash).toContain('expedition');
.loginAndModule('production', 'ticket')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.expedition');
});
it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async () => {

View File

@ -6,29 +6,9 @@ describe('Ticket List sale path', () => {
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket');
});
it('should search for the ticket 8', async () => {
const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:8')
.click(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket's sale`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketSales.saleButton)
.waitForURL('/sale')
.parsedUrl();
expect(url.hash).toContain('/sale');
.loginAndModule('employee', 'ticket')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.sale');
});
it('should confirm the first ticket sale contains the colour', async () => {

View File

@ -6,29 +6,9 @@ describe('Ticket Create packages path', () => {
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket');
});
it('should search for the ticket 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);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket packages`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResultAddress, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketPackages.packagesButton)
.waitForURL('package/index')
.parsedUrl();
expect(url.hash).toContain('package/index');
.loginAndModule('employee', 'ticket')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.package.index');
});
it(`should delete the first package and receive and error to save a new one with blank quantity`, async () => {

View File

@ -7,29 +7,9 @@ describe('Ticket', () => {
beforeAll(() => {
return nightmare
.loginAndModule('production', 'ticket');
});
it('should search for the ticket 1', async () => {
let 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);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket Tracking`, async () => {
let url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketTracking.trackingButton)
.waitForURL('tracking/index')
.parsedUrl();
expect(url.hash).toContain('tracking/index');
.loginAndModule('production', 'ticket')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.tracking.index');
});
it('should access to the create state view by clicking the create floating button', async () => {

View File

@ -6,29 +6,9 @@ describe('Ticket Edit basic data path', () => {
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket');
});
it('should search for the ticket 11', async () => {
let result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:11')
.click(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket Basic Data`, async () => {
let url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') // should be Bruce Wayne
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketBasicData.basicDataButton)
.waitForURL('data/step-one')
.parsedUrl();
expect(url.hash).toContain('data/step-one');
.loginAndModule('employee', 'ticket')
.accessToSearchResult('id:11')
.accessToSection('ticket.card.data.stepOne');
});
it(`should edit the client and address of the ticket then click next`, async () => {

View File

@ -6,29 +6,9 @@ describe('Ticket Edit sale path', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesPerson', 'ticket');
});
it('should search for a specific ticket', async () => {
const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket Sale`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketSales.saleButton)
.waitForURL('/sale')
.parsedUrl();
expect(url.hash).toContain('/sale');
.loginAndModule('salesPerson', 'ticket')
.accessToSearchResult('id:16')
.accessToSection('ticket.card.sale');
});
it(`should click on the first claim id to navigate over there`, async () => {

View File

@ -6,29 +6,9 @@ describe('Ticket List components path', () => {
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket');
});
it('should search for the ticket 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);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket components`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketComponents.componentsButton)
.waitForURL('components')
.parsedUrl();
expect(url.hash).toContain('components');
.loginAndModule('employee', 'ticket')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.components');
});
it('should confirm the total base is correct', async () => {

View File

@ -6,29 +6,9 @@ describe('Ticket purchase request path', () => {
beforeAll(() => {
nightmare
.loginAndModule('salesPerson', 'ticket');
});
it('should search for a specific ticket', async () => {
const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
expect(result).toEqual(1);
});
it(`should click on the search result to access to the ticket Purchase request`, async () => {
const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketRequests.requestButton)
.waitForURL('/request')
.parsedUrl();
expect(url.hash).toContain('/request');
.loginAndModule('salesPerson', 'ticket')
.accessToSearchResult('id:16')
.accessToSection('ticket.card.request.index');
});
it(`should add a new request`, async () => {