e2e path files preparation for ITEMs module plus the refactor required
This commit is contained in:
parent
580efa1b84
commit
5d894f868c
|
@ -121,8 +121,15 @@ Nightmare.action('waitForNumberOfElements', function(selector, count, done) {
|
||||||
});
|
});
|
||||||
|
|
||||||
Nightmare.action('waitForTextInElement', function(selector, name, done) {
|
Nightmare.action('waitForTextInElement', function(selector, name, done) {
|
||||||
this.wait((resultSelector, expectedName) => {
|
this.wait((resultSelector, expectedText) => {
|
||||||
return document.querySelector(resultSelector).innerText.toLowerCase().includes(expectedName.toLowerCase());
|
return document.querySelector(resultSelector).innerText.toLowerCase().includes(expectedText.toLowerCase());
|
||||||
|
}, selector, name)
|
||||||
|
.then(done);
|
||||||
|
});
|
||||||
|
|
||||||
|
Nightmare.action('waitForTextInInput', function(selector, name, done) {
|
||||||
|
this.wait((resultSelector, expectedText) => {
|
||||||
|
return document.querySelector(resultSelector).value.toLowerCase().includes(expectedText.toLowerCase());
|
||||||
}, selector, name)
|
}, selector, name)
|
||||||
.then(done);
|
.then(done);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,8 @@ export default {
|
||||||
clientsButton: `${components.vnMainMenu} > div > ul > li:nth-child(1)`
|
clientsButton: `${components.vnMainMenu} > div > ul > li:nth-child(1)`
|
||||||
},
|
},
|
||||||
moduleAccessView: {
|
moduleAccessView: {
|
||||||
clientsSectionButton: `${components.vnModuleContainer}[ui-sref="clients"]`
|
clientsSectionButton: `${components.vnModuleContainer}[ui-sref="clients"]`,
|
||||||
|
itemsSectionButton: `${components.vnModuleContainer}[ui-sref="item.index"]`
|
||||||
},
|
},
|
||||||
clientsIndex: {
|
clientsIndex: {
|
||||||
searchClientInput: `${components.vnTextfield}`,
|
searchClientInput: `${components.vnTextfield}`,
|
||||||
|
@ -34,7 +35,7 @@ export default {
|
||||||
salesBruceBannerOption: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
|
salesBruceBannerOption: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
|
||||||
createButton: `${components.vnSubmit}`
|
createButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
basicData: {
|
clientBasicData: {
|
||||||
basicDataButton: `${components.vnMenuItem}[ui-sref="clientCard.basicData"]`,
|
basicDataButton: `${components.vnMenuItem}[ui-sref="clientCard.basicData"]`,
|
||||||
nameInput: `${components.vnTextfield}[name="name"]`,
|
nameInput: `${components.vnTextfield}[name="name"]`,
|
||||||
contactInput: `${components.vnTextfield}[name="contact"]`,
|
contactInput: `${components.vnTextfield}[name="contact"]`,
|
||||||
|
@ -48,7 +49,7 @@ export default {
|
||||||
channelMetropolisOption: `${components.vnAutocomplete}[field="$ctrl.client.contactChannelFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`,
|
channelMetropolisOption: `${components.vnAutocomplete}[field="$ctrl.client.contactChannelFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`,
|
||||||
saveButton: `${components.vnSubmit}`
|
saveButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
fiscalData: {
|
clientFiscalData: {
|
||||||
fiscalDataButton: `${components.vnMenuItem}[ui-sref="clientCard.fiscalData"]`,
|
fiscalDataButton: `${components.vnMenuItem}[ui-sref="clientCard.fiscalData"]`,
|
||||||
socialNameInput: `${components.vnTextfield}[name="socialName"]`,
|
socialNameInput: `${components.vnTextfield}[name="socialName"]`,
|
||||||
fiscalIdInput: `${components.vnTextfield}[name="fi"]`,
|
fiscalIdInput: `${components.vnTextfield}[name="fi"]`,
|
||||||
|
@ -69,7 +70,7 @@ export default {
|
||||||
viesCheckboxInput: `${components.vnCheck}[label='Vies'] > label > input`,
|
viesCheckboxInput: `${components.vnCheck}[label='Vies'] > label > input`,
|
||||||
saveButton: `${components.vnSubmit}`
|
saveButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
payMethod: {
|
clientPayMethod: {
|
||||||
payMethodButton: `${components.vnMenuItem}[ui-sref="clientCard.billingData"]`,
|
payMethodButton: `${components.vnMenuItem}[ui-sref="clientCard.billingData"]`,
|
||||||
payMethodInput: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > ${components.vnTextfield}`,
|
payMethodInput: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > ${components.vnTextfield}`,
|
||||||
payMethodIBANOption: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(5)`,
|
payMethodIBANOption: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(5)`,
|
||||||
|
@ -82,7 +83,7 @@ export default {
|
||||||
receivedB2BVNLCheckbox: `${components.vnCheck}[label='Received B2B VNL'] > label > input`,
|
receivedB2BVNLCheckbox: `${components.vnCheck}[label='Received B2B VNL'] > label > input`,
|
||||||
saveButton: `${components.vnSubmit}`
|
saveButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
addresses: {
|
clientAddresses: {
|
||||||
addressesButton: `${components.vnMenuItem}[ui-sref="clientCard.addresses.list"]`,
|
addressesButton: `${components.vnMenuItem}[ui-sref="clientCard.addresses.list"]`,
|
||||||
createAddress: `${components.vnFloatButton}`,
|
createAddress: `${components.vnFloatButton}`,
|
||||||
defaultCheckboxInput: `${components.vnCheck}[label='Default'] > label > input`,
|
defaultCheckboxInput: `${components.vnCheck}[label='Default'] > label > input`,
|
||||||
|
@ -104,27 +105,27 @@ export default {
|
||||||
equalizationTaxCheckboxLabel: `${components.vnCheck}[label='Is equalizated'] > label > input`,
|
equalizationTaxCheckboxLabel: `${components.vnCheck}[label='Is equalizated'] > label > input`,
|
||||||
saveButton: `${components.vnSubmit}`
|
saveButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
webAccess: {
|
clientWebAccess: {
|
||||||
webAccessButton: `${components.vnMenuItem}[ui-sref="clientCard.webAccess"]`,
|
webAccessButton: `${components.vnMenuItem}[ui-sref="clientCard.webAccess"]`,
|
||||||
enableWebAccessCheckbox: `${components.vnCheck}[label='Enable web access'] > label > input`,
|
enableWebAccessCheckbox: `${components.vnCheck}[label='Enable web access'] > label > input`,
|
||||||
userNameInput: `${components.vnTextfield}[name="name"]`,
|
userNameInput: `${components.vnTextfield}[name="name"]`,
|
||||||
saveButton: `${components.vnSubmit}`
|
saveButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
notes: {
|
clientNotes: {
|
||||||
notesButton: `${components.vnMenuItem}[ui-sref="clientCard.notes.list"]`,
|
notesButton: `${components.vnMenuItem}[ui-sref="clientCard.notes.list"]`,
|
||||||
addNoteFloatButton: `${components.vnFloatButton}`,
|
addNoteFloatButton: `${components.vnFloatButton}`,
|
||||||
noteInput: `${components.vnTextarea}[label="Note"]`,
|
noteInput: `${components.vnTextarea}[label="Note"]`,
|
||||||
saveButton: `${components.vnSubmit}`,
|
saveButton: `${components.vnSubmit}`,
|
||||||
firstNoteText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-notes > vn-card > div > vn-vertical > vn-one:nth-child(2) > vn-horizontal.ng-binding'
|
firstNoteText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-notes > vn-card > div > vn-vertical > vn-one:nth-child(2) > vn-horizontal.ng-binding'
|
||||||
},
|
},
|
||||||
credit: {
|
clientCredit: {
|
||||||
creditButton: `${components.vnMenuItem}[ui-sref="clientCard.credit.list"]`,
|
creditButton: `${components.vnMenuItem}[ui-sref="clientCard.credit.list"]`,
|
||||||
addCreditFloatButton: `${components.vnFloatButton}`,
|
addCreditFloatButton: `${components.vnFloatButton}`,
|
||||||
creditInput: `${components.vnTextfield}[name="credit"]`,
|
creditInput: `${components.vnTextfield}[name="credit"]`,
|
||||||
saveButton: `${components.vnSubmit}`,
|
saveButton: `${components.vnSubmit}`,
|
||||||
firstCreditText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-credit-list > vn-card > div > vn-vertical > vn-one > vn-horizontal:nth-child(1) > vn-one'
|
firstCreditText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-credit-list > vn-card > div > vn-vertical > vn-one > vn-horizontal:nth-child(1) > vn-one'
|
||||||
},
|
},
|
||||||
greuge: {
|
clientGreuge: {
|
||||||
greugeButton: `${components.vnMenuItem}[ui-sref="clientCard.greuge.list"]`,
|
greugeButton: `${components.vnMenuItem}[ui-sref="clientCard.greuge.list"]`,
|
||||||
addGreugeFloatButton: `${components.vnFloatButton}`,
|
addGreugeFloatButton: `${components.vnFloatButton}`,
|
||||||
amountInput: `${components.vnTextfield}[name="amount"]`,
|
amountInput: `${components.vnTextfield}[name="amount"]`,
|
||||||
|
@ -134,8 +135,11 @@ export default {
|
||||||
saveButton: `${components.vnSubmit}`,
|
saveButton: `${components.vnSubmit}`,
|
||||||
firstGreugeText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-greuge-list > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
firstGreugeText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > ui-view > vn-client-greuge-list > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
||||||
},
|
},
|
||||||
mandate: {
|
clientMandate: {
|
||||||
mandateButton: `${components.vnMenuItem}[ui-sref="clientCard.mandate"]`,
|
mandateButton: `${components.vnMenuItem}[ui-sref="clientCard.mandate"]`,
|
||||||
firstMandateText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-mandate > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
firstMandateText: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-mandate > vn-card > div > vn-vertical > vn-one > vn-horizontal'
|
||||||
|
},
|
||||||
|
itemsIndex: {
|
||||||
|
createItemButton: `${components.vnFloatButton}`
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -72,10 +72,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should edit the name', done => {
|
it('should edit the name', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.clearInput(selectors.basicData.nameInput)
|
.clearInput(selectors.clientBasicData.nameInput)
|
||||||
.type(selectors.basicData.nameInput, 'Ororo Munroe')
|
.type(selectors.clientBasicData.nameInput, 'Ororo Munroe')
|
||||||
.click(selectors.basicData.saveButton)
|
.click(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -88,11 +88,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the name have been edited', done => {
|
it('should confirm the name have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.getInputValue(selectors.basicData.nameInput)
|
.getInputValue(selectors.clientBasicData.nameInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Ororo Munroe');
|
expect(result).toEqual('Ororo Munroe');
|
||||||
done();
|
done();
|
||||||
|
@ -102,10 +102,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should edit the contact name', done => {
|
it('should edit the contact name', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.basicData.contactInput)
|
.wait(selectors.clientBasicData.contactInput)
|
||||||
.clearInput(selectors.basicData.contactInput)
|
.clearInput(selectors.clientBasicData.contactInput)
|
||||||
.type(selectors.basicData.contactInput, 'Black Panther')
|
.type(selectors.clientBasicData.contactInput, 'Black Panther')
|
||||||
.click(selectors.basicData.saveButton)
|
.click(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -118,11 +118,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the contact name have been edited', done => {
|
it('should confirm the contact name have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.contactInput)
|
.wait(selectors.clientBasicData.contactInput)
|
||||||
.getInputValue(selectors.basicData.contactInput)
|
.getInputValue(selectors.clientBasicData.contactInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Black Panther');
|
expect(result).toEqual('Black Panther');
|
||||||
done();
|
done();
|
||||||
|
@ -132,10 +132,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should add the landline phone number', done => {
|
it('should add the landline phone number', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.basicData.phoneInput)
|
.wait(selectors.clientBasicData.phoneInput)
|
||||||
.clearInput(selectors.basicData.phoneInput)
|
.clearInput(selectors.clientBasicData.phoneInput)
|
||||||
.type(selectors.basicData.phoneInput, '123456789')
|
.type(selectors.clientBasicData.phoneInput, '123456789')
|
||||||
.click(selectors.basicData.saveButton)
|
.click(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -148,11 +148,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the landline phone number have been added', done => {
|
it('should confirm the landline phone number have been added', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.phoneInput)
|
.wait(selectors.clientBasicData.phoneInput)
|
||||||
.getInputValue(selectors.basicData.phoneInput)
|
.getInputValue(selectors.clientBasicData.phoneInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('123456789');
|
expect(result).toEqual('123456789');
|
||||||
done();
|
done();
|
||||||
|
@ -162,10 +162,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should add the mobile phone number', done => {
|
it('should add the mobile phone number', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.basicData.mobileInput)
|
.wait(selectors.clientBasicData.mobileInput)
|
||||||
.clearInput(selectors.basicData.mobileInput)
|
.clearInput(selectors.clientBasicData.mobileInput)
|
||||||
.type(selectors.basicData.mobileInput, '987654321')
|
.type(selectors.clientBasicData.mobileInput, '987654321')
|
||||||
.click(selectors.basicData.saveButton)
|
.click(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -178,11 +178,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the mobile phone number have been added', done => {
|
it('should confirm the mobile phone number have been added', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.mobileInput)
|
.wait(selectors.clientBasicData.mobileInput)
|
||||||
.getInputValue(selectors.basicData.mobileInput)
|
.getInputValue(selectors.clientBasicData.mobileInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('987654321');
|
expect(result).toEqual('987654321');
|
||||||
done();
|
done();
|
||||||
|
@ -192,10 +192,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should edit the email', done => {
|
it('should edit the email', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.basicData.emailInput)
|
.wait(selectors.clientBasicData.emailInput)
|
||||||
.clearInput(selectors.basicData.emailInput)
|
.clearInput(selectors.clientBasicData.emailInput)
|
||||||
.type(selectors.basicData.emailInput, 'Storm@verdnatura.es')
|
.type(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es')
|
||||||
.click(selectors.basicData.saveButton)
|
.click(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -208,11 +208,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the email have been edited', done => {
|
it('should confirm the email have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.emailInput)
|
.wait(selectors.clientBasicData.emailInput)
|
||||||
.getInputValue(selectors.basicData.emailInput)
|
.getInputValue(selectors.clientBasicData.emailInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Storm@verdnatura.es');
|
expect(result).toEqual('Storm@verdnatura.es');
|
||||||
done();
|
done();
|
||||||
|
@ -222,10 +222,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should select the sales person', done => {
|
it('should select the sales person', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.basicData.salesPersonInput)
|
.waitToClick(selectors.clientBasicData.salesPersonInput)
|
||||||
.waitToClick(selectors.basicData.salesBruceBannerOption)
|
.waitToClick(selectors.clientBasicData.salesBruceBannerOption)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.waitToClick(selectors.basicData.saveButton)
|
.waitToClick(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -238,11 +238,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the sales person have been selected', done => {
|
it('should confirm the sales person have been selected', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.getInputValue(selectors.basicData.salesPersonInput)
|
.getInputValue(selectors.clientBasicData.salesPersonInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Bruce Banner');
|
expect(result).toEqual('Bruce Banner');
|
||||||
done();
|
done();
|
||||||
|
@ -252,10 +252,10 @@ describe('Edit basicData path', () => {
|
||||||
|
|
||||||
it('should select the channel', done => {
|
it('should select the channel', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.basicData.channelInput)
|
.waitToClick(selectors.clientBasicData.channelInput)
|
||||||
.waitToClick(selectors.basicData.channelMetropolisOption)
|
.waitToClick(selectors.clientBasicData.channelMetropolisOption)
|
||||||
.wait(400)
|
.wait(400)
|
||||||
.waitToClick(selectors.basicData.saveButton)
|
.waitToClick(selectors.clientBasicData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -268,11 +268,11 @@ describe('Edit basicData path', () => {
|
||||||
it('should confirm the channel have been selected', done => {
|
it('should confirm the channel have been selected', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(400)
|
.wait(400)
|
||||||
.getInputValue(selectors.basicData.channelInput)
|
.getInputValue(selectors.clientBasicData.channelInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Metropolis newspaper');
|
expect(result).toEqual('Metropolis newspaper');
|
||||||
done();
|
done();
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ describe('Edit fiscalData path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitForURL('/addresses/list')
|
.waitForURL('/addresses/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -74,12 +74,12 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should click on the 1st edit icon to check EQtax is checked`, done => {
|
it(`should click on the 1st edit icon to check EQtax is checked`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.firstEditButton)
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
||||||
.wait(selectors.addresses.equalizationTaxCheckboxLabel)
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.addresses.equalizationTaxCheckboxLabel)
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -89,13 +89,13 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, done => {
|
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitToClick(selectors.addresses.secondEditButton)
|
.waitToClick(selectors.clientAddresses.secondEditButton)
|
||||||
.wait(selectors.addresses.equalizationTaxCheckboxLabel)
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.addresses.equalizationTaxCheckboxLabel)
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -106,7 +106,7 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should click on the fiscal data button to start editing`, done => {
|
it(`should click on the fiscal data button to start editing`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.waitForURL('fiscal-data')
|
.waitForURL('fiscal-data')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -118,10 +118,10 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should edit the social name', done => {
|
it('should edit the social name', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.fiscalData.socialNameInput)
|
.wait(selectors.clientFiscalData.socialNameInput)
|
||||||
.clearInput(selectors.fiscalData.socialNameInput)
|
.clearInput(selectors.clientFiscalData.socialNameInput)
|
||||||
.type(selectors.fiscalData.socialNameInput, 'Hulk edited')
|
.type(selectors.clientFiscalData.socialNameInput, 'Hulk edited')
|
||||||
.click(selectors.fiscalData.saveButton)
|
.click(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -134,11 +134,11 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm the social name have been edited', done => {
|
it('should confirm the social name have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.socialNameInput)
|
.wait(selectors.clientFiscalData.socialNameInput)
|
||||||
.getInputValue(selectors.fiscalData.socialNameInput)
|
.getInputValue(selectors.clientFiscalData.socialNameInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Hulk edited');
|
expect(result).toEqual('Hulk edited');
|
||||||
done();
|
done();
|
||||||
|
@ -148,10 +148,10 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should edit the fiscal id', done => {
|
it('should edit the fiscal id', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.fiscalData.fiscalIdInput)
|
.wait(selectors.clientFiscalData.fiscalIdInput)
|
||||||
.clearInput(selectors.fiscalData.fiscalIdInput)
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
||||||
.type(selectors.fiscalData.fiscalIdInput, '94980061C')
|
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
||||||
.click(selectors.fiscalData.saveButton)
|
.click(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -164,11 +164,11 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm the fiscal id have been edited', done => {
|
it('should confirm the fiscal id have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.fiscalIdInput)
|
.wait(selectors.clientFiscalData.fiscalIdInput)
|
||||||
.getInputValue(selectors.fiscalData.fiscalIdInput)
|
.getInputValue(selectors.clientFiscalData.fiscalIdInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('94980061C');
|
expect(result).toEqual('94980061C');
|
||||||
done();
|
done();
|
||||||
|
@ -178,8 +178,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should check the Equalization tax checkbox', done => {
|
it('should check the Equalization tax checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.equalizationTaxCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -191,7 +191,7 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should propagate the Equalization tax', done => {
|
it('should propagate the Equalization tax', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.acceptPropagationButton)
|
.waitToClick(selectors.clientFiscalData.acceptPropagationButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -204,13 +204,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm Equalization tax checkbox is checked', done => {
|
it('should confirm Equalization tax checkbox is checked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.equalizationTaxCheckboxLabel)
|
.wait(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.equalizationTaxCheckboxLabel)
|
}, selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeTruthy();
|
expect(value).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
|
@ -221,7 +221,7 @@ describe('Edit fiscalData path', () => {
|
||||||
describe('Confirm all addresses have now EQtax checked', () => {
|
describe('Confirm all addresses have now EQtax checked', () => {
|
||||||
it(`should click on the addresses button to access to the client's addresses`, done => {
|
it(`should click on the addresses button to access to the client's addresses`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitForURL('/addresses/list')
|
.waitForURL('/addresses/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -233,12 +233,12 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should click on the 1st edit icon to confirm EQtax is checked`, done => {
|
it(`should click on the 1st edit icon to confirm EQtax is checked`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.firstEditButton)
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
||||||
.wait(selectors.addresses.equalizationTaxCheckboxLabel)
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.addresses.equalizationTaxCheckboxLabel)
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeTruthy();
|
expect(value).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
|
@ -248,13 +248,13 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, done => {
|
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitToClick(selectors.addresses.secondEditButton)
|
.waitToClick(selectors.clientAddresses.secondEditButton)
|
||||||
.wait(selectors.addresses.equalizationTaxCheckboxLabel)
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.addresses.equalizationTaxCheckboxLabel)
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeTruthy();
|
expect(value).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
|
@ -265,11 +265,11 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should go to fiscal data then edit the address', done => {
|
it('should go to fiscal data then edit the address', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.clearInput(selectors.fiscalData.addressInput)
|
.clearInput(selectors.clientFiscalData.addressInput)
|
||||||
.type(selectors.fiscalData.addressInput, 'Somewhere edited')
|
.type(selectors.clientFiscalData.addressInput, 'Somewhere edited')
|
||||||
.click(selectors.fiscalData.saveButton)
|
.click(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -282,11 +282,11 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm the address have been edited', done => {
|
it('should confirm the address have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.addressInput)
|
.wait(selectors.clientFiscalData.addressInput)
|
||||||
.getInputValue(selectors.fiscalData.addressInput)
|
.getInputValue(selectors.clientFiscalData.addressInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Somewhere edited');
|
expect(result).toEqual('Somewhere edited');
|
||||||
done();
|
done();
|
||||||
|
@ -296,10 +296,10 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should edit the city', done => {
|
it('should edit the city', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.fiscalData.cityInput)
|
.wait(selectors.clientFiscalData.cityInput)
|
||||||
.clearInput(selectors.fiscalData.cityInput)
|
.clearInput(selectors.clientFiscalData.cityInput)
|
||||||
.type(selectors.fiscalData.cityInput, 'N/A')
|
.type(selectors.clientFiscalData.cityInput, 'N/A')
|
||||||
.click(selectors.fiscalData.saveButton)
|
.click(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -312,11 +312,11 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm the city have been edited', done => {
|
it('should confirm the city have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.cityInput)
|
.wait(selectors.clientFiscalData.cityInput)
|
||||||
.getInputValue(selectors.fiscalData.cityInput)
|
.getInputValue(selectors.clientFiscalData.cityInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('N/A');
|
expect(result).toEqual('N/A');
|
||||||
done();
|
done();
|
||||||
|
@ -326,10 +326,10 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should edit the postcode', done => {
|
it('should edit the postcode', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.fiscalData.postcodeInput)
|
.wait(selectors.clientFiscalData.postcodeInput)
|
||||||
.clearInput(selectors.fiscalData.postcodeInput)
|
.clearInput(selectors.clientFiscalData.postcodeInput)
|
||||||
.type(selectors.fiscalData.postcodeInput, '12345')
|
.type(selectors.clientFiscalData.postcodeInput, '12345')
|
||||||
.click(selectors.fiscalData.saveButton)
|
.click(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -342,11 +342,11 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm the postcode have been edited', done => {
|
it('should confirm the postcode have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.postcodeInput)
|
.wait(selectors.clientFiscalData.postcodeInput)
|
||||||
.getInputValue(selectors.fiscalData.postcodeInput)
|
.getInputValue(selectors.clientFiscalData.postcodeInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('12345');
|
expect(result).toEqual('12345');
|
||||||
done();
|
done();
|
||||||
|
@ -356,10 +356,10 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should edit the province`, done => {
|
it(`should edit the province`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.provinceInput)
|
.waitToClick(selectors.clientFiscalData.provinceInput)
|
||||||
.waitToClick(selectors.fiscalData.provinceFifthOption)
|
.waitToClick(selectors.clientFiscalData.provinceFifthOption)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -372,11 +372,11 @@ describe('Edit fiscalData path', () => {
|
||||||
it(`should confirm the province have been selected`, done => {
|
it(`should confirm the province have been selected`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.fiscalData.fiscalDataButton)
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.getInputValue(selectors.fiscalData.provinceInput)
|
.getInputValue(selectors.clientFiscalData.provinceInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Province two');
|
expect(result).toEqual('Province two');
|
||||||
done();
|
done();
|
||||||
|
@ -386,8 +386,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should uncheck the active checkbox', done => {
|
it('should uncheck the active checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.activeCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -400,13 +400,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm active checkbox is unchecked', done => {
|
it('should confirm active checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.activeCheckboxLabel)
|
.wait(selectors.clientFiscalData.activeCheckboxLabel)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.activeCheckboxLabel)
|
}, selectors.clientFiscalData.activeCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -416,8 +416,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should uncheck the invoice by address checkbox', done => {
|
it('should uncheck the invoice by address checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.invoiceByAddressCheckboxInput)
|
.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -430,13 +430,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm invoice by address checkbox is unchecked', done => {
|
it('should confirm invoice by address checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.invoiceByAddressCheckboxInput)
|
.wait(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.invoiceByAddressCheckboxInput)
|
}, selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -446,8 +446,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should check the Verified data checkbox', done => {
|
it('should check the Verified data checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.verifiedDataCheckboxInput)
|
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -460,13 +460,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm Verified data checkbox is unchecked', done => {
|
it('should confirm Verified data checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.verifiedDataCheckboxInput)
|
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.verifiedDataCheckboxInput)
|
}, selectors.clientFiscalData.verifiedDataCheckboxInput)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -476,8 +476,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should uncheck the Has to invoice checkbox', done => {
|
it('should uncheck the Has to invoice checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.hasToInvoiceCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -490,13 +490,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm Has to invoice checkbox is unchecked', done => {
|
it('should confirm Has to invoice checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.hasToInvoiceCheckboxLabel)
|
.wait(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.hasToInvoiceCheckboxLabel)
|
}, selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -506,8 +506,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should uncheck the Invoice by mail checkbox', done => {
|
it('should uncheck the Invoice by mail checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.invoiceByMailCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -520,13 +520,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm Invoice by mail checkbox is unchecked', done => {
|
it('should confirm Invoice by mail checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.invoiceByMailCheckboxLabel)
|
.wait(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.invoiceByMailCheckboxLabel)
|
}, selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -536,8 +536,8 @@ describe('Edit fiscalData path', () => {
|
||||||
|
|
||||||
it('should check the Vies checkbox', done => {
|
it('should check the Vies checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.fiscalData.viesCheckboxInput)
|
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -550,13 +550,13 @@ describe('Edit fiscalData path', () => {
|
||||||
it('should confirm Vies checkbox is checked', done => {
|
it('should confirm Vies checkbox is checked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.fiscalData.viesCheckboxInput)
|
.wait(selectors.clientFiscalData.viesCheckboxInput)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.fiscalData.viesCheckboxInput)
|
}, selectors.clientFiscalData.viesCheckboxInput)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeTruthy();
|
expect(value).toBeTruthy();
|
||||||
done();
|
done();
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Edit pay method path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.payMethod.payMethodButton)
|
.waitToClick(selectors.clientPayMethod.payMethodButton)
|
||||||
.waitForURL('billing-data')
|
.waitForURL('billing-data')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,11 +73,11 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it(`should edit the Pay method to any without IBAN`, done => {
|
it(`should edit the Pay method to any without IBAN`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.payMethod.payMethodInput)
|
.waitToClick(selectors.clientPayMethod.payMethodInput)
|
||||||
.waitToClick(selectors.payMethod.payMethodOptionOne)
|
.waitToClick(selectors.clientPayMethod.payMethodOptionOne)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.waitToClick(selectors.payMethod.cancelNotificationButton)
|
.waitToClick(selectors.clientPayMethod.cancelNotificationButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -90,11 +90,11 @@ describe('Edit pay method path', () => {
|
||||||
it(`should confirm the Pay method have been selected`, done => {
|
it(`should confirm the Pay method have been selected`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.payMethod.payMethodButton)
|
.click(selectors.clientPayMethod.payMethodButton)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.getInputValue(selectors.payMethod.payMethodInput)
|
.getInputValue(selectors.clientPayMethod.payMethodInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('PayMethod one');
|
expect(result).toEqual('PayMethod one');
|
||||||
done();
|
done();
|
||||||
|
@ -104,11 +104,11 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it(`should receive an error when changing payMethod to IBAN without an IBAN entered`, done => {
|
it(`should receive an error when changing payMethod to IBAN without an IBAN entered`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.payMethod.payMethodInput)
|
.waitToClick(selectors.clientPayMethod.payMethodInput)
|
||||||
.waitToClick(selectors.payMethod.payMethodIBANOption)
|
.waitToClick(selectors.clientPayMethod.payMethodIBANOption)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.waitToClick(selectors.payMethod.cancelNotificationButton)
|
.waitToClick(selectors.clientPayMethod.cancelNotificationButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -120,10 +120,10 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it(`should add the IBAN`, done => {
|
it(`should add the IBAN`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.clearInput(selectors.payMethod.IBANInput)
|
.clearInput(selectors.clientPayMethod.IBANInput)
|
||||||
.type(selectors.payMethod.IBANInput, 'ES91 2100 0418 4502 0005 1332')
|
.type(selectors.clientPayMethod.IBANInput, 'ES91 2100 0418 4502 0005 1332')
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.waitToClick(selectors.payMethod.cancelNotificationButton)
|
.waitToClick(selectors.clientPayMethod.cancelNotificationButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -136,11 +136,11 @@ describe('Edit pay method path', () => {
|
||||||
it(`should confirm the IBAN pay method is sucessfully saved`, done => {
|
it(`should confirm the IBAN pay method is sucessfully saved`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.payMethod.payMethodButton)
|
.click(selectors.clientPayMethod.payMethodButton)
|
||||||
.wait(200)
|
.wait(200)
|
||||||
.getInputValue(selectors.payMethod.payMethodInput)
|
.getInputValue(selectors.clientPayMethod.payMethodInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('PayMethod with IBAN');
|
expect(result).toEqual('PayMethod with IBAN');
|
||||||
done();
|
done();
|
||||||
|
@ -150,10 +150,10 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it(`should edit the due day`, done => {
|
it(`should edit the due day`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.clearInput(selectors.payMethod.dueDayInput)
|
.clearInput(selectors.clientPayMethod.dueDayInput)
|
||||||
.type(selectors.payMethod.dueDayInput, '60')
|
.type(selectors.clientPayMethod.dueDayInput, '60')
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.waitToClick(selectors.payMethod.cancelNotificationButton)
|
.waitToClick(selectors.clientPayMethod.cancelNotificationButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -166,11 +166,11 @@ describe('Edit pay method path', () => {
|
||||||
it('should confirm the due day have been edited', done => {
|
it('should confirm the due day have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.payMethod.payMethodButton)
|
.waitToClick(selectors.clientPayMethod.payMethodButton)
|
||||||
.wait(selectors.payMethod.dueDayInput)
|
.wait(selectors.clientPayMethod.dueDayInput)
|
||||||
.getInputValue(selectors.payMethod.dueDayInput)
|
.getInputValue(selectors.clientPayMethod.dueDayInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('60');
|
expect(result).toEqual('60');
|
||||||
done();
|
done();
|
||||||
|
@ -180,8 +180,8 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it('should uncheck the Received core VNH checkbox', done => {
|
it('should uncheck the Received core VNH checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.payMethod.receivedCoreVNHCheckbox)
|
.waitToClick(selectors.clientPayMethod.receivedCoreVNHCheckbox)
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -194,13 +194,13 @@ describe('Edit pay method path', () => {
|
||||||
it('should confirm Received core VNH checkbox is unchecked', done => {
|
it('should confirm Received core VNH checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.payMethod.payMethodButton)
|
.waitToClick(selectors.clientPayMethod.payMethodButton)
|
||||||
.wait(selectors.payMethod.receivedCoreVNHCheckbox)
|
.wait(selectors.clientPayMethod.receivedCoreVNHCheckbox)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.payMethod.receivedCoreVNHCheckbox)
|
}, selectors.clientPayMethod.receivedCoreVNHCheckbox)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -210,8 +210,8 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it('should uncheck the Received core VNL checkbox', done => {
|
it('should uncheck the Received core VNL checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.payMethod.receivedCoreVNLCheckbox)
|
.waitToClick(selectors.clientPayMethod.receivedCoreVNLCheckbox)
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -224,13 +224,13 @@ describe('Edit pay method path', () => {
|
||||||
it('should confirm Received core VNL checkbox is unchecked', done => {
|
it('should confirm Received core VNL checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.payMethod.payMethodButton)
|
.waitToClick(selectors.clientPayMethod.payMethodButton)
|
||||||
.wait(selectors.payMethod.receivedCoreVNLCheckbox)
|
.wait(selectors.clientPayMethod.receivedCoreVNLCheckbox)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.payMethod.receivedCoreVNLCheckbox)
|
}, selectors.clientPayMethod.receivedCoreVNLCheckbox)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -240,8 +240,8 @@ describe('Edit pay method path', () => {
|
||||||
|
|
||||||
it('should uncheck the Received B2B VNL checkbox', done => {
|
it('should uncheck the Received B2B VNL checkbox', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.payMethod.receivedB2BVNLCheckbox)
|
.waitToClick(selectors.clientPayMethod.receivedB2BVNLCheckbox)
|
||||||
.waitToClick(selectors.payMethod.saveButton)
|
.waitToClick(selectors.clientPayMethod.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -254,13 +254,13 @@ describe('Edit pay method path', () => {
|
||||||
it('should confirm Received B2B VNL checkbox is unchecked', done => {
|
it('should confirm Received B2B VNL checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.payMethod.payMethodButton)
|
.waitToClick(selectors.clientPayMethod.payMethodButton)
|
||||||
.wait(selectors.payMethod.receivedB2BVNLCheckbox)
|
.wait(selectors.clientPayMethod.receivedB2BVNLCheckbox)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.payMethod.receivedB2BVNLCheckbox)
|
}, selectors.clientPayMethod.receivedB2BVNLCheckbox)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Add address path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitForURL('addresses/list')
|
.waitForURL('addresses/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,7 +73,7 @@ describe('Add address path', () => {
|
||||||
|
|
||||||
it(`should click on the add new address button to access to the new address form`, done => {
|
it(`should click on the add new address button to access to the new address form`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.createAddress)
|
.waitToClick(selectors.clientAddresses.createAddress)
|
||||||
.waitForURL('addresses/create')
|
.waitForURL('addresses/create')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -85,8 +85,8 @@ describe('Add address path', () => {
|
||||||
|
|
||||||
it('should check the default checkbox then receive an error after clicking save button as the form is empty', done => {
|
it('should check the default checkbox then receive an error after clicking save button as the form is empty', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.addresses.defaultCheckboxInput)
|
.waitToClick(selectors.clientAddresses.defaultCheckboxInput)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -99,7 +99,7 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but consignee', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but consignee', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.type(selectors.addresses.consigneeInput, 'Bruce Bunner')
|
.type(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -113,8 +113,8 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but Street', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but Street', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.clearInput(selectors.addresses.consigneeInput)
|
.clearInput(selectors.clientAddresses.consigneeInput)
|
||||||
.type(selectors.addresses.streetAddressInput, '320 Park Avenue New York')
|
.type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -128,8 +128,8 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but postcode', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but postcode', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.clearInput(selectors.addresses.streetAddressInput)
|
.clearInput(selectors.clientAddresses.streetAddressInput)
|
||||||
.type(selectors.addresses.postcodeInput, '10022')
|
.type(selectors.clientAddresses.postcodeInput, '10022')
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -143,8 +143,8 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but city', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but city', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.clearInput(selectors.addresses.postcodeInput)
|
.clearInput(selectors.clientAddresses.postcodeInput)
|
||||||
.type(selectors.addresses.cityInput, 'New York')
|
.type(selectors.clientAddresses.cityInput, 'New York')
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -158,9 +158,9 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but province', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but province', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.clearInput(selectors.addresses.cityInput)
|
.clearInput(selectors.clientAddresses.cityInput)
|
||||||
.waitToClick(selectors.addresses.provinceInput)
|
.waitToClick(selectors.clientAddresses.provinceInput)
|
||||||
.waitToClick(selectors.addresses.provinceSecondOption)
|
.waitToClick(selectors.clientAddresses.provinceSecondOption)
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -174,8 +174,8 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but province and agency', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but province and agency', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.addresses.agencyInput)
|
.waitToClick(selectors.clientAddresses.agencyInput)
|
||||||
.waitToClick(selectors.addresses.agenctySecondOption)
|
.waitToClick(selectors.clientAddresses.agenctySecondOption)
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -189,7 +189,7 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but province, agency and phone', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but province, agency and phone', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.type(selectors.addresses.phoneInput, '999887744')
|
.type(selectors.clientAddresses.phoneInput, '999887744')
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -203,8 +203,8 @@ describe('Add address path', () => {
|
||||||
it('should receive an error when clicking the save button having all the form fields empty but province, agency and mobile', done => {
|
it('should receive an error when clicking the save button having all the form fields empty but province, agency and mobile', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.clearInput(selectors.addresses.phoneInput)
|
.clearInput(selectors.clientAddresses.phoneInput)
|
||||||
.type(selectors.addresses.mobileInput, '999887744')
|
.type(selectors.clientAddresses.mobileInput, '999887744')
|
||||||
.click(selectors.createClientView.createButton)
|
.click(selectors.createClientView.createButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
|
@ -218,12 +218,12 @@ describe('Add address path', () => {
|
||||||
it(`should create a new address with all it's data`, done => {
|
it(`should create a new address with all it's data`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.type(selectors.addresses.consigneeInput, 'Bruce Bunner')
|
.type(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
|
||||||
.type(selectors.addresses.streetAddressInput, '320 Park Avenue New York')
|
.type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
|
||||||
.type(selectors.addresses.postcodeInput, '10022')
|
.type(selectors.clientAddresses.postcodeInput, '10022')
|
||||||
.type(selectors.addresses.cityInput, 'New York')
|
.type(selectors.clientAddresses.cityInput, 'New York')
|
||||||
.type(selectors.addresses.phoneInput, '999887744')
|
.type(selectors.clientAddresses.phoneInput, '999887744')
|
||||||
.click(selectors.addresses.saveButton)
|
.click(selectors.clientAddresses.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -236,9 +236,9 @@ describe('Add address path', () => {
|
||||||
it(`should click on the addresses button confirm the new address exists and it's the default one`, done => {
|
it(`should click on the addresses button confirm the new address exists and it's the default one`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.wait(selectors.addresses.defaultAddress)
|
.wait(selectors.clientAddresses.defaultAddress)
|
||||||
.getInnerText(selectors.addresses.defaultAddress)
|
.getInnerText(selectors.clientAddresses.defaultAddress)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toContain('320 Park Avenue New York');
|
expect(result).toContain('320 Park Avenue New York');
|
||||||
done();
|
done();
|
||||||
|
@ -249,9 +249,9 @@ describe('Add address path', () => {
|
||||||
it(`should click on the make default icon of the second address then confirm it is the default one now`, done => {
|
it(`should click on the make default icon of the second address then confirm it is the default one now`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.addresses.secondMakeDefaultStar)
|
.waitToClick(selectors.clientAddresses.secondMakeDefaultStar)
|
||||||
.waitForTextInElement(selectors.addresses.defaultAddress, 'Somewhere in Thailand')
|
.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand')
|
||||||
.getInnerText(selectors.addresses.defaultAddress)
|
.getInnerText(selectors.clientAddresses.defaultAddress)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toContain('Somewhere in Thailand');
|
expect(result).toContain('Somewhere in Thailand');
|
||||||
done();
|
done();
|
||||||
|
@ -261,8 +261,8 @@ describe('Add address path', () => {
|
||||||
|
|
||||||
it(`should click on the edit icon of the default address`, done => {
|
it(`should click on the edit icon of the default address`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.addresses.defaultAddress, 'Somewhere in Thailand')
|
.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand')
|
||||||
.waitToClick(selectors.addresses.firstEditButton)
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
||||||
.waitForURL('/edit')
|
.waitForURL('/edit')
|
||||||
.url()
|
.url()
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -275,8 +275,8 @@ describe('Add address path', () => {
|
||||||
it(`should click on the active checkbox and receive an error to save it becouse it is the default address`, done => {
|
it(`should click on the active checkbox and receive an error to save it becouse it is the default address`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.addresses.activeCheckbox)
|
.waitToClick(selectors.clientAddresses.activeCheckbox)
|
||||||
.waitToClick(selectors.addresses.saveButton)
|
.waitToClick(selectors.clientAddresses.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Add address notes path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.addresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitForURL('addresses/list')
|
.waitForURL('addresses/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,8 +73,8 @@ describe('Add address notes path', () => {
|
||||||
|
|
||||||
it(`should click on the edit icon of the default address`, done => {
|
it(`should click on the edit icon of the default address`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.addresses.defaultAddress, 'Somewhere in Thailand')
|
.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand')
|
||||||
.waitToClick(selectors.addresses.firstEditButton)
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
||||||
.waitForURL('/edit')
|
.waitForURL('/edit')
|
||||||
.url()
|
.url()
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -86,8 +86,8 @@ describe('Add address notes path', () => {
|
||||||
|
|
||||||
// it('should add as many notes as observation types', done => {
|
// it('should add as many notes as observation types', done => {
|
||||||
// nightmare
|
// nightmare
|
||||||
// .waitToClick(selectors.addresses.defaultCheckboxInput)
|
// .waitToClick(selectors.clientAddresses.defaultCheckboxInput)
|
||||||
// .waitToClick(selectors.fiscalData.saveButton)
|
// .waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
// .wait(selectors.globalItems.snackbarIsActive)
|
// .wait(selectors.globalItems.snackbarIsActive)
|
||||||
// .getInnerText(selectors.globalItems.snackbarIsActive)
|
// .getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
// .then(result => {
|
// .then(result => {
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Edit web access path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.webAccess.webAccessButton)
|
.waitToClick(selectors.clientWebAccess.webAccessButton)
|
||||||
.waitForURL('web-access')
|
.waitForURL('web-access')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,8 +73,8 @@ describe('Edit web access path', () => {
|
||||||
|
|
||||||
it(`should click on the Enable web access checkbox to uncheck it`, done => {
|
it(`should click on the Enable web access checkbox to uncheck it`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.webAccess.enableWebAccessCheckbox)
|
.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox)
|
||||||
.waitToClick(selectors.fiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -87,13 +87,13 @@ describe('Edit web access path', () => {
|
||||||
it('should confirm Enable web access checkbox is unchecked', done => {
|
it('should confirm Enable web access checkbox is unchecked', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.waitToClick(selectors.basicData.basicDataButton)
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.waitToClick(selectors.webAccess.webAccessButton)
|
.waitToClick(selectors.clientWebAccess.webAccessButton)
|
||||||
.wait(selectors.webAccess.enableWebAccessCheckbox)
|
.wait(selectors.clientWebAccess.enableWebAccessCheckbox)
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.webAccess.enableWebAccessCheckbox)
|
}, selectors.clientWebAccess.enableWebAccessCheckbox)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toBeFalsy();
|
expect(value).toBeFalsy();
|
||||||
done();
|
done();
|
||||||
|
@ -103,10 +103,10 @@ describe('Edit web access path', () => {
|
||||||
|
|
||||||
it('should edit the User name', done => {
|
it('should edit the User name', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.webAccess.userNameInput)
|
.wait(selectors.clientWebAccess.userNameInput)
|
||||||
.clearInput(selectors.webAccess.userNameInput)
|
.clearInput(selectors.clientWebAccess.userNameInput)
|
||||||
.type(selectors.webAccess.userNameInput, 'Hulk')
|
.type(selectors.clientWebAccess.userNameInput, 'Hulk')
|
||||||
.click(selectors.webAccess.saveButton)
|
.click(selectors.clientWebAccess.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -119,11 +119,12 @@ describe('Edit web access path', () => {
|
||||||
it('should confirm the User name have been edited', done => {
|
it('should confirm the User name have been edited', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.click(selectors.basicData.basicDataButton)
|
.click(selectors.clientBasicData.basicDataButton)
|
||||||
.wait(selectors.basicData.nameInput)
|
.wait(selectors.clientBasicData.nameInput)
|
||||||
.click(selectors.webAccess.webAccessButton)
|
.click(selectors.clientWebAccess.webAccessButton)
|
||||||
.wait(selectors.webAccess.userNameInput)
|
.wait(selectors.clientWebAccess.userNameInput)
|
||||||
.getInputValue(selectors.webAccess.userNameInput)
|
.waitForTextInInput(selectors.clientWebAccess.userNameInput, 'Hulk')
|
||||||
|
.getInputValue(selectors.clientWebAccess.userNameInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('Hulk');
|
expect(result).toEqual('Hulk');
|
||||||
done();
|
done();
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Add notes path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.notes.notesButton)
|
.waitToClick(selectors.clientNotes.notesButton)
|
||||||
.waitForURL('notes/list')
|
.waitForURL('notes/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,7 +73,7 @@ describe('Add notes path', () => {
|
||||||
|
|
||||||
it(`should click on the add note button`, done => {
|
it(`should click on the add note button`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.notes.addNoteFloatButton)
|
.waitToClick(selectors.clientNotes.addNoteFloatButton)
|
||||||
.waitForURL('/notes/create')
|
.waitForURL('/notes/create')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -85,8 +85,8 @@ describe('Add notes path', () => {
|
||||||
|
|
||||||
it(`should create a note`, done => {
|
it(`should create a note`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.type(selectors.notes.noteInput, 'Meeting with Black Widow 21st 9am')
|
.type(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am')
|
||||||
.click(selectors.notes.saveButton)
|
.click(selectors.clientNotes.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -99,8 +99,8 @@ describe('Add notes path', () => {
|
||||||
it('should confirm the note was created', done => {
|
it('should confirm the note was created', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.wait(selectors.notes.firstNoteText)
|
.wait(selectors.clientNotes.firstNoteText)
|
||||||
.getInnerText(selectors.notes.firstNoteText)
|
.getInnerText(selectors.clientNotes.firstNoteText)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toEqual('Meeting with Black Widow 21st 9am');
|
expect(value).toEqual('Meeting with Black Widow 21st 9am');
|
||||||
done();
|
done();
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Add credit path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.credit.creditButton)
|
.waitToClick(selectors.clientCredit.creditButton)
|
||||||
.waitForURL('credit/list')
|
.waitForURL('credit/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,7 +73,7 @@ describe('Add credit path', () => {
|
||||||
|
|
||||||
it(`should click on the add credit button`, done => {
|
it(`should click on the add credit button`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.credit.addCreditFloatButton)
|
.waitToClick(selectors.clientCredit.addCreditFloatButton)
|
||||||
.waitForURL('/credit/create')
|
.waitForURL('/credit/create')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -85,9 +85,9 @@ describe('Add credit path', () => {
|
||||||
|
|
||||||
it(`should edit the credit`, done => {
|
it(`should edit the credit`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.clearInput(selectors.credit.creditInput)
|
.clearInput(selectors.clientCredit.creditInput)
|
||||||
.type(selectors.credit.creditInput, 999)
|
.type(selectors.clientCredit.creditInput, 999)
|
||||||
.click(selectors.credit.saveButton)
|
.click(selectors.clientCredit.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -100,8 +100,8 @@ describe('Add credit path', () => {
|
||||||
it('should confirm the credit was updated', done => {
|
it('should confirm the credit was updated', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.wait(selectors.credit.firstCreditText)
|
.wait(selectors.clientCredit.firstCreditText)
|
||||||
.getInnerText(selectors.credit.firstCreditText)
|
.getInnerText(selectors.clientCredit.firstCreditText)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toContain(999);
|
expect(value).toContain(999);
|
||||||
done();
|
done();
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('Add greuge path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.greuge.greugeButton)
|
.waitToClick(selectors.clientGreuge.greugeButton)
|
||||||
.waitForURL('greuge/list')
|
.waitForURL('greuge/list')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,7 +73,7 @@ describe('Add greuge path', () => {
|
||||||
|
|
||||||
it(`should click on the add greuge button`, done => {
|
it(`should click on the add greuge button`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitToClick(selectors.greuge.addGreugeFloatButton)
|
.waitToClick(selectors.clientGreuge.addGreugeFloatButton)
|
||||||
.waitForURL('greuge/create')
|
.waitForURL('greuge/create')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -85,7 +85,7 @@ describe('Add greuge path', () => {
|
||||||
|
|
||||||
it(`should receive an error if all fields are empty but date on submit`, done => {
|
it(`should receive an error if all fields are empty but date on submit`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.click(selectors.credit.saveButton)
|
.click(selectors.clientCredit.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -97,8 +97,8 @@ describe('Add greuge path', () => {
|
||||||
|
|
||||||
it(`should receive an error if all fields are empty but date and amount on submit`, done => {
|
it(`should receive an error if all fields are empty but date and amount on submit`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.type(selectors.greuge.amountInput, 999)
|
.type(selectors.clientGreuge.amountInput, 999)
|
||||||
.click(selectors.greuge.saveButton)
|
.click(selectors.clientGreuge.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -110,9 +110,9 @@ describe('Add greuge path', () => {
|
||||||
|
|
||||||
it(`should receive an error if all fields are empty but date and description on submit`, done => {
|
it(`should receive an error if all fields are empty but date and description on submit`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.clearInput(selectors.greuge.amountInput)
|
.clearInput(selectors.clientGreuge.amountInput)
|
||||||
.type(selectors.greuge.descriptionInput, 'new armor for Batman!')
|
.type(selectors.clientGreuge.descriptionInput, 'new armor for Batman!')
|
||||||
.click(selectors.greuge.saveButton)
|
.click(selectors.clientGreuge.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -124,10 +124,10 @@ describe('Add greuge path', () => {
|
||||||
|
|
||||||
it(`should receive an error if all fields are empty but date and type on submit`, done => {
|
it(`should receive an error if all fields are empty but date and type on submit`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.clearInput(selectors.greuge.descriptionInput)
|
.clearInput(selectors.clientGreuge.descriptionInput)
|
||||||
.waitToClick(selectors.greuge.typeInput)
|
.waitToClick(selectors.clientGreuge.typeInput)
|
||||||
.waitToClick(selectors.greuge.typeSecondOption)
|
.waitToClick(selectors.clientGreuge.typeSecondOption)
|
||||||
.click(selectors.greuge.saveButton)
|
.click(selectors.clientGreuge.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -139,10 +139,10 @@ describe('Add greuge path', () => {
|
||||||
|
|
||||||
it(`should create a new greuge with all its data`, done => {
|
it(`should create a new greuge with all its data`, done => {
|
||||||
nightmare
|
nightmare
|
||||||
.clearInput(selectors.greuge.amountInput)
|
.clearInput(selectors.clientGreuge.amountInput)
|
||||||
.type(selectors.greuge.amountInput, 999)
|
.type(selectors.clientGreuge.amountInput, 999)
|
||||||
.type(selectors.greuge.descriptionInput, 'new armor for Batman!')
|
.type(selectors.clientGreuge.descriptionInput, 'new armor for Batman!')
|
||||||
.click(selectors.greuge.saveButton)
|
.click(selectors.clientGreuge.saveButton)
|
||||||
.wait(selectors.globalItems.snackbarIsActive)
|
.wait(selectors.globalItems.snackbarIsActive)
|
||||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
@ -155,8 +155,8 @@ describe('Add greuge path', () => {
|
||||||
it('should confirm the greuge was added to the list', done => {
|
it('should confirm the greuge was added to the list', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForSnackbarReset()
|
.waitForSnackbarReset()
|
||||||
.wait(selectors.greuge.firstGreugeText)
|
.wait(selectors.clientGreuge.firstGreugeText)
|
||||||
.getInnerText(selectors.greuge.firstGreugeText)
|
.getInnerText(selectors.clientGreuge.firstGreugeText)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toContain(999);
|
expect(value).toContain(999);
|
||||||
expect(value).toContain('new armor for Batman!');
|
expect(value).toContain('new armor for Batman!');
|
|
@ -1,7 +1,7 @@
|
||||||
import config from '../helpers/config.js';
|
import config from '../../helpers/config.js';
|
||||||
import createNightmare from '../helpers/nightmare';
|
import createNightmare from '../../helpers/nightmare';
|
||||||
import selectors from '../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
const moduleAccessViewHashURL = '#!/';
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe('mandate path', () => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter')
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter')
|
||||||
.waitToClick(selectors.clientsIndex.searchResult)
|
.waitToClick(selectors.clientsIndex.searchResult)
|
||||||
.waitToClick(selectors.mandate.mandateButton)
|
.waitToClick(selectors.clientMandate.mandateButton)
|
||||||
.waitForURL('mandate')
|
.waitForURL('mandate')
|
||||||
.url()
|
.url()
|
||||||
.then(url => {
|
.then(url => {
|
||||||
|
@ -73,8 +73,8 @@ describe('mandate path', () => {
|
||||||
|
|
||||||
it('should confirm the client has a mandate of the CORE type', done => {
|
it('should confirm the client has a mandate of the CORE type', done => {
|
||||||
nightmare
|
nightmare
|
||||||
.wait(selectors.mandate.firstMandateText)
|
.wait(selectors.clientMandate.firstMandateText)
|
||||||
.getInnerText(selectors.mandate.firstMandateText)
|
.getInnerText(selectors.clientMandate.firstMandateText)
|
||||||
.then(value => {
|
.then(value => {
|
||||||
expect(value).toContain('1');
|
expect(value).toContain('1');
|
||||||
expect(value).toContain('WAY');
|
expect(value).toContain('WAY');
|
|
@ -0,0 +1,43 @@
|
||||||
|
import config from '../../helpers/config.js';
|
||||||
|
import createNightmare from '../../helpers/nightmare';
|
||||||
|
import selectors from '../../helpers/selectors.js';
|
||||||
|
import {catchErrors} from '../../../services/utils/jasmineHelpers';
|
||||||
|
const nightmare = createNightmare();
|
||||||
|
const moduleAccessViewHashURL = '#!/';
|
||||||
|
|
||||||
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||||
|
|
||||||
|
fdescribe('create item barcodes path', () => {
|
||||||
|
it('should log in', done => {
|
||||||
|
nightmare
|
||||||
|
.login()
|
||||||
|
.waitForURL(moduleAccessViewHashURL)
|
||||||
|
.url()
|
||||||
|
.then(url => {
|
||||||
|
expect(url).toEqual(config.url + moduleAccessViewHashURL);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should make sure the language is English', done => {
|
||||||
|
nightmare
|
||||||
|
.changeLanguageToEnglish()
|
||||||
|
.then(() => {
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should access to the items index by clicking the items button', done => {
|
||||||
|
nightmare
|
||||||
|
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||||
|
.wait(selectors.itemsIndex.createItemButton)
|
||||||
|
.url()
|
||||||
|
.then(url => {
|
||||||
|
expect(url).toEqual(config.url + '#!/item/list');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(catchErrors(done));
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue