e2e paths refactor plus some more tests for Greuge path
This commit is contained in:
parent
245025453a
commit
329b025c74
|
@ -13,7 +13,7 @@ export default function createNightmare(width = 1280, height = 720) {
|
|||
fail(message);
|
||||
}
|
||||
if (type === 'log') {
|
||||
console.log(message);
|
||||
// console.log(message);
|
||||
}
|
||||
});
|
||||
return nightmare;
|
||||
|
|
|
@ -78,6 +78,9 @@ export default {
|
|||
IBANInput: `${components.vnTextfield}[name="iban"]`,
|
||||
dueDayInput: `${components.vnTextfield}[name="dueDay"]`,
|
||||
cancelNotificationButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-billing-data > vn-dialog > div > form > div.button-bar > tpl-buttons > button:nth-child(1)',
|
||||
receivedCoreVNHCheckbox: `${components.vnCheck}[label='Received core VNH'] > label > input`,
|
||||
receivedCoreVNLCheckbox: `${components.vnCheck}[label='Received core VNL'] > label > input`,
|
||||
receivedB2BVNLCheckbox: `${components.vnCheck}[label='Received B2B VNL'] > label > input`,
|
||||
saveButton: `${components.vnSubmit}`
|
||||
},
|
||||
addresses: {
|
||||
|
@ -125,7 +128,7 @@ export default {
|
|||
greuge: {
|
||||
greugeButton: `${components.vnMenuItem}[ui-sref="clientCard.greuge.list"]`,
|
||||
addGreugeFloatButton: `${components.vnFloatButton}`,
|
||||
// creditInput: `${components.vnTextfield}[name="credit"]`,
|
||||
amountInput: `${components.vnTextfield}[name="Amount"]`,
|
||||
saveButton: `${components.vnSubmit}`
|
||||
// firstGreugeText: ''
|
||||
}
|
||||
|
|
|
@ -427,7 +427,7 @@ describe('Edit fiscalData path', () => {
|
|||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should check the invoice by address checkbox', done => {
|
||||
it('should uncheck the invoice by address checkbox', done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.fiscalData.invoiceByAddressCheckboxInput)
|
||||
.waitToClick(selectors.fiscalData.saveButton)
|
||||
|
@ -440,7 +440,7 @@ describe('Edit fiscalData path', () => {
|
|||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should confirm invoice by address checkbox is checked', done => {
|
||||
it('should confirm invoice by address checkbox is unchecked', done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.waitToClick(selectors.basicData.basicDataButton)
|
||||
|
@ -451,7 +451,7 @@ describe('Edit fiscalData path', () => {
|
|||
return document.querySelector(selector).checked;
|
||||
}, selectors.fiscalData.invoiceByAddressCheckboxInput)
|
||||
.then(value => {
|
||||
expect(value).toBeTruthy();
|
||||
expect(value).toBeFalsy();
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
|
@ -470,7 +470,7 @@ describe('Edit fiscalData path', () => {
|
|||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should confirm Verified data checkbox is checked', done => {
|
||||
it('should confirm Verified data checkbox is unchecked', done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.waitToClick(selectors.basicData.basicDataButton)
|
||||
|
@ -481,7 +481,7 @@ describe('Edit fiscalData path', () => {
|
|||
return document.querySelector(selector).checked;
|
||||
}, selectors.fiscalData.verifiedDataCheckboxInput)
|
||||
.then(value => {
|
||||
expect(value).toBeTruthy();
|
||||
expect(value).toBeFalsy();
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
|
|
|
@ -160,35 +160,123 @@ describe('Edit pay method path', () => {
|
|||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
// BUG IBAN validation seems to break down whenever the due day is edited plus due day shouldnt accep values above 31.
|
||||
|
||||
// it(`should edit the due day`, done => {
|
||||
// nightmare
|
||||
// .clearInput(selectors.payMethod.dueDayInput)
|
||||
// .type(selectors.payMethod.dueDayInput, '25')
|
||||
// .waitToClick(selectors.payMethod.saveButton)
|
||||
// .waitToClick(selectors.payMethod.cancelNotificationButton)
|
||||
// .wait(selectors.globalItems.snackbarIsActive)
|
||||
// .getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
// .then(result => {
|
||||
// expect(result).toEqual('Data saved!');
|
||||
// done();
|
||||
// })
|
||||
// .catch(catchErrors(done));
|
||||
// });
|
||||
|
||||
// it('should confirm the due day have been edited', done => {
|
||||
// nightmare
|
||||
// .waitForSnackbarReset()
|
||||
// .waitToClick(selectors.basicData.basicDataButton)
|
||||
// .wait(selectors.basicData.nameInput)
|
||||
// .waitToClick(selectors.payMethod.payMethodButton)
|
||||
// .wait(selectors.payMethod.dueDayInput)
|
||||
// .getInputValue(selectors.payMethod.dueDayInput)
|
||||
// .then(result => {
|
||||
// expect(result).toEqual('25');
|
||||
// done();
|
||||
// })
|
||||
// .catch(catchErrors(done));
|
||||
// });
|
||||
it(`should edit the due day`, done => {
|
||||
nightmare
|
||||
.clearInput(selectors.payMethod.dueDayInput)
|
||||
.type(selectors.payMethod.dueDayInput, '60')
|
||||
.waitToClick(selectors.payMethod.saveButton)
|
||||
.waitToClick(selectors.payMethod.cancelNotificationButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Data saved!');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should confirm the due day have been edited', done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.waitToClick(selectors.basicData.basicDataButton)
|
||||
.wait(selectors.basicData.nameInput)
|
||||
.waitToClick(selectors.payMethod.payMethodButton)
|
||||
.wait(selectors.payMethod.dueDayInput)
|
||||
.getInputValue(selectors.payMethod.dueDayInput)
|
||||
.then(result => {
|
||||
expect(result).toEqual('60');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should uncheck the Received core VNH checkbox', done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.payMethod.receivedCoreVNHCheckbox)
|
||||
.waitToClick(selectors.payMethod.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Data saved!');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should confirm Received core VNH checkbox is unchecked', done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.waitToClick(selectors.basicData.basicDataButton)
|
||||
.wait(selectors.basicData.nameInput)
|
||||
.waitToClick(selectors.payMethod.payMethodButton)
|
||||
.wait(selectors.payMethod.receivedCoreVNHCheckbox)
|
||||
.evaluate(selector => {
|
||||
return document.querySelector(selector).checked;
|
||||
}, selectors.payMethod.receivedCoreVNHCheckbox)
|
||||
.then(value => {
|
||||
expect(value).toBeFalsy();
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should uncheck the Received core VNL checkbox', done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.payMethod.receivedCoreVNLCheckbox)
|
||||
.waitToClick(selectors.payMethod.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Data saved!');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should confirm Received core VNL checkbox is unchecked', done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.waitToClick(selectors.basicData.basicDataButton)
|
||||
.wait(selectors.basicData.nameInput)
|
||||
.waitToClick(selectors.payMethod.payMethodButton)
|
||||
.wait(selectors.payMethod.receivedCoreVNLCheckbox)
|
||||
.evaluate(selector => {
|
||||
return document.querySelector(selector).checked;
|
||||
}, selectors.payMethod.receivedCoreVNLCheckbox)
|
||||
.then(value => {
|
||||
expect(value).toBeFalsy();
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should uncheck the Received B2B VNL checkbox', done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.payMethod.receivedB2BVNLCheckbox)
|
||||
.waitToClick(selectors.payMethod.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toEqual('Data saved!');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
it('should confirm Received B2B VNL checkbox is unchecked', done => {
|
||||
nightmare
|
||||
.waitForSnackbarReset()
|
||||
.waitToClick(selectors.basicData.basicDataButton)
|
||||
.wait(selectors.basicData.nameInput)
|
||||
.waitToClick(selectors.payMethod.payMethodButton)
|
||||
.wait(selectors.payMethod.receivedB2BVNLCheckbox)
|
||||
.evaluate(selector => {
|
||||
return document.querySelector(selector).checked;
|
||||
}, selectors.payMethod.receivedB2BVNLCheckbox)
|
||||
.then(value => {
|
||||
expect(value).toBeFalsy();
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ const moduleAccessViewHashURL = '#!/';
|
|||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
describe('Add greuge path', () => {
|
||||
fdescribe('Add greuge path', () => {
|
||||
describe('warm up', () => {
|
||||
it('should warm up login and fixtures', done => {
|
||||
nightmare
|
||||
|
@ -87,11 +87,8 @@ describe('Add greuge path', () => {
|
|||
it(`should click on the add greuge button`, done => {
|
||||
nightmare
|
||||
.waitToClick(selectors.greuge.addGreugeFloatButton)
|
||||
.wait(500)
|
||||
.waitForURL('greuge/create')
|
||||
.wait(500)
|
||||
.url()
|
||||
.wait(500)
|
||||
.then(url => {
|
||||
expect(url).toContain('greuge/create');
|
||||
done();
|
||||
|
@ -99,18 +96,18 @@ describe('Add greuge path', () => {
|
|||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
// it(`should add a new greuge`, done => {
|
||||
// nightmare
|
||||
// .type(selectors.credit.creditInput, 999)
|
||||
// .click(selectors.credit.saveButton)
|
||||
// .wait(selectors.globalItems.snackbarIsActive)
|
||||
// .getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
// .then(result => {
|
||||
// expect(result).toEqual('Data saved!');
|
||||
// done();
|
||||
// })
|
||||
// .catch(catchErrors(done));
|
||||
// });
|
||||
it(`should add a new greuge`, done => {
|
||||
nightmare
|
||||
.type(selectors.greuge.amountInput, 999)
|
||||
.click(selectors.credit.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
.getInnerText(selectors.globalItems.snackbarIsActive)
|
||||
.then(result => {
|
||||
expect(result).toContain('Error');
|
||||
done();
|
||||
})
|
||||
.catch(catchErrors(done));
|
||||
});
|
||||
|
||||
// it('should confirm the credit was updated', done => {
|
||||
// nightmare
|
||||
|
|
Loading…
Reference in New Issue