e2e for the supplier billing data path
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-12-16 16:37:53 +01:00
parent aae83336a3
commit 7afd738a90
2 changed files with 30 additions and 42 deletions

View File

@ -960,5 +960,11 @@ export default {
province: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.provinceFk"]', province: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.provinceFk"]',
country: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.countryFk"]', country: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.countryFk"]',
saveButton: 'vn-supplier-fiscal-data button[type="submit"]', saveButton: 'vn-supplier-fiscal-data button[type="submit"]',
},
supplierBillingData: {
payMethod: 'vn-supplier-billing-data vn-autocomplete[ng-model="$ctrl.supplier.payMethodFk"]',
payDem: 'vn-supplier-billing-data vn-autocomplete[ng-model="$ctrl.supplier.payDemFk"]',
payDay: 'vn-supplier-billing-data vn-input-number[ng-model="$ctrl.supplier.payDay"]',
saveButton: 'vn-supplier-billing-data button[type=submit]'
} }
}; };

View File

@ -8,7 +8,7 @@ describe('Supplier billing data path', () => {
beforeAll(async() => { beforeAll(async() => {
browser = await getBrowser(); browser = await getBrowser();
page = browser.page; page = browser.page;
await page.loginAndModule('administrative', 'supplier'); await page.loginAndModule('developer', 'supplier');
await page.accessToSearchResult('442'); await page.accessToSearchResult('442');
await page.accessToSection('supplier.card.billingData'); await page.accessToSection('supplier.card.billingData');
}); });
@ -17,54 +17,36 @@ describe('Supplier billing data path', () => {
await browser.close(); await browser.close();
}); });
it('should ', async() => { it('should edit the billing data', async() => {
// await page.clearInput(selectors.supplierBasicData.alias); await page.autocompleteSearch(selectors.supplierBillingData.payMethod, 'PayMethod with IBAN');
// await page.write(selectors.supplierBasicData.alias, 'Plants Nick SL'); await page.autocompleteSearch(selectors.supplierBillingData.payDem, '10');
// await page.waitToClick(selectors.supplierBasicData.isSerious); await page.clearInput(selectors.supplierBillingData.payDay);
// await page.waitToClick(selectors.supplierBasicData.isActive); await page.write(selectors.supplierBillingData.payDay, '19');
// await page.write(selectors.supplierBasicData.notes, 'Some notes'); await page.waitToClick(selectors.supplierBillingData.saveButton);
const message = await page.waitForSnackbar();
// await page.waitToClick(selectors.supplierBasicData.saveButton); expect(message.text).toContain('Data saved!');
// const message = await page.waitForSnackbar();
// expect(message.text).toContain('Data saved!');
}); });
// it('should reload the section', async() => { it('should reload the section', async() => {
// await page.reloadSection('supplier.card.basicData'); await page.reloadSection('supplier.card.billingData');
// }); });
// it('should check the alias was edited', async() => { it('should check the pay method was edited', async() => {
// const result = await page.waitToGetProperty(selectors.supplierBasicData.alias, 'value'); const result = await page.waitToGetProperty(selectors.supplierBillingData.payMethod, 'value');
// expect(result).toEqual('Plants Nick SL'); expect(result).toEqual('PayMethod with IBAN');
// }); });
// it('should check the isSerious checkbox is now unchecked', async() => { it('should check the payDem was edited', async() => {
// const result = await page.checkboxState(selectors.supplierBasicData.isSerious); const result = await page.waitToGetProperty(selectors.supplierBillingData.payDem, 'value');
// expect(result).toBe('unchecked'); expect(result).toEqual('10');
// }); });
// it('should check the isActive checkbox is now unchecked', async() => { it('should check the pay day was edited', async() => {
// const result = await page.checkboxState(selectors.supplierBasicData.isActive); const result = await page.waitToGetProperty(selectors.supplierBillingData.payDay, 'value');
// expect(result).toBe('unchecked'); expect(result).toEqual('19');
// }); });
// it('should check the notes were edited', async() => {
// const result = await page.waitToGetProperty(selectors.supplierBasicData.notes, 'value');
// expect(result).toEqual('Some notes');
// });
// it('should navigate to the log section', async() => {
// await page.accessToSection('supplier.card.log');
// });
// it('should check the changes have been recorded', async() => {
// const result = await page.waitToGetProperty('#newInstance:nth-child(3)', 'innerText');
// expect(result).toEqual('note: Some notes');
// });
}); });