From 04917f980facfdab194187db601f4b20f22de168 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 2 Mar 2020 09:30:54 +0100 Subject: [PATCH] Updated E2E --- db/dump/fixtures.sql | 6 +- e2e/helpers/selectors.js | 12 ++-- e2e/paths/02-client/01_create_client.spec.js | 2 +- .../02-client/03_edit_fiscal_data.spec.js | 3 +- e2e/paths/02-client/05_add_address.spec.js | 14 +++- .../client/front/address/create/index.html | 48 ++++++------- modules/client/front/address/edit/index.html | 47 ++++++------ modules/client/front/create/index.html | 69 +++++++++--------- modules/client/front/fiscal-data/index.html | 71 +++++++++---------- 9 files changed, 136 insertions(+), 136 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 2f3a9378d..a62edad46 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -197,14 +197,16 @@ INSERT INTO `vn`.`town`(`id`, `name`, `provinceFk`) (1, 'Valencia', 1), (2, 'Silla', 1), (3, 'Algemesi', 1), - (4, 'Alzira', 1); + (4, 'Alzira', 1), + (5, 'Quito', 5); INSERT INTO `vn`.`postCode`(`code`, `townFk`, `geoFk`) VALUES ('46000', 1, 6), ('46460', 2, 6), ('46680', 3, 6), - ('46600', 4, 7); + ('46600', 4, 7), + ('EC170150', 5, 8); INSERT INTO `vn`.`clientType`(`id`, `code`, `type`) VALUES diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 7e3e726e4..0f31b2e0c 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -43,8 +43,8 @@ export default { taxNumber: 'vn-client-create vn-textfield[ng-model="$ctrl.client.fi"]', socialName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.socialName"]', street: 'vn-client-create vn-textfield[ng-model="$ctrl.client.street"]', - postcode: 'vn-client-create vn-textfield[ng-model="$ctrl.client.postcode"]', - city: 'vn-client-create vn-textfield[ng-model="$ctrl.client.city"]', + postcode: 'vn-client-create vn-datalist[ng-model="$ctrl.client.postcode"]', + city: 'vn-client-create vn-datalist[ng-model="$ctrl.client.city"]', province: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.provinceFk"]', country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]', userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]', @@ -75,8 +75,8 @@ export default { equalizationTaxCheckbox: 'vn-client-fiscal-data vn-check[ng-model="$ctrl.client.isEqualizated"]', acceptPropagationButton: '.vn-confirm.shown button[response=accept]', address: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.street"]', - postcode: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.postcode"]', - city: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.city"]', + postcode: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.postcode"]', + city: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.city"]', province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]', country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]', activeCheckbox: 'vn-client-fiscal-data vn-check[label="Active"]', @@ -113,8 +113,8 @@ export default { defaultCheckbox: 'vn-check[label="Default"]', consignee: 'vn-textfield[ng-model="$ctrl.address.nickname"]', streetAddress: 'vn-textfield[ng-model="$ctrl.address.street"]', - postcode: 'vn-textfield[ng-model="$ctrl.address.postalCode"]', - city: 'vn-textfield[ng-model="$ctrl.address.city"]', + postcode: 'vn-datalist[ng-model="$ctrl.address.postalCode"]', + city: 'vn-datalist[ng-model="$ctrl.address.city"]', province: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]', agency: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]', phone: 'vn-textfield[ng-model="$ctrl.address.phone"]', diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js index 27ed5049a..65db9e7c6 100644 --- a/e2e/paths/02-client/01_create_client.spec.js +++ b/e2e/paths/02-client/01_create_client.spec.js @@ -87,7 +87,7 @@ describe('Client create path', async() => { .waitToGetProperty(selectors.createClientView.country, 'value'); expect(clientCity).toEqual('Valencia'); - expect(clientProvince).toEqual('Province one'); + expect(clientProvince).toContain('Province one'); expect(clientCountry).toEqual('EspaƱa'); }); diff --git a/e2e/paths/02-client/03_edit_fiscal_data.spec.js b/e2e/paths/02-client/03_edit_fiscal_data.spec.js index f7d6cbe92..4cd54b87d 100644 --- a/e2e/paths/02-client/03_edit_fiscal_data.spec.js +++ b/e2e/paths/02-client/03_edit_fiscal_data.spec.js @@ -198,11 +198,10 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('Valencia'); }); - it(`should confirm the province have been autocompleted`, async() => { const result = await page.waitToGetProperty(selectors.clientFiscalData.province, 'value'); - expect(result).toEqual('Province one'); + expect(result).toContain('Province one'); }); it('should confirm the country have been autocompleted', async() => { diff --git a/e2e/paths/02-client/05_add_address.spec.js b/e2e/paths/02-client/05_add_address.spec.js index 737d6b05b..c9228e1cf 100644 --- a/e2e/paths/02-client/05_add_address.spec.js +++ b/e2e/paths/02-client/05_add_address.spec.js @@ -25,9 +25,7 @@ describe('Client Add address path', () => { it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => { await page.waitToClick(selectors.clientAddresses.defaultCheckbox); - await page.autocompleteSearch(selectors.clientAddresses.province, 'Province five'); - await page.write(selectors.clientAddresses.city, 'Valencia'); - await page.write(selectors.clientAddresses.postcode, '46000'); + await page.write(selectors.clientAddresses.postcode, 'EC170150'); await page.autocompleteSearch(selectors.clientAddresses.agency, 'Entanglement'); await page.write(selectors.clientAddresses.phone, '999887744'); await page.write(selectors.clientAddresses.mobileInput, '999887744'); @@ -37,6 +35,16 @@ describe('Client Add address path', () => { expect(result).toEqual('Some fields are invalid'); }); + it('should confirm that the city and province are propertly filled', async() => { + const city = await page + .waitToGetProperty(selectors.clientAddresses.city, 'value'); + + const province = await page + .waitToGetProperty(selectors.clientAddresses.province, 'value'); + + expect(city).toEqual('Quito'); + expect(province).toContain('Province five'); + }); it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => { await page.write(selectors.clientAddresses.consignee, 'Bruce Bunner'); diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html index 383f37d0a..ef4c869f1 100644 --- a/modules/client/front/address/create/index.html +++ b/modules/client/front/address/create/index.html @@ -39,37 +39,12 @@ - - {{name}} ({{country.country}}) - - - - {{name}}, {{province.name}} - ({{province.country.country}}) - - + + + {{name}}, {{province.name}} + ({{province.country.country}}) + + + + {{name}} ({{country.country}}) + - - - - - {{name}}, {{province.name}} - ({{province.country.country}}) - - + + + {{name}}, {{province.name}} + ({{province.country.country}}) + + + + {{name}} ({{country.country}}) + - - - - {{name}} ({{country.country}}) - - - - - - {{name}}, {{province.name}} - ({{province.country.country}}) - - + + + {{name}}, {{province.name}} + ({{province.country.country}}) + + + + + + {{name}} ({{country.country}}) + + + - - - - {{name}} ({{country.country}}) - - - - - - {{name}}, {{province.name}} - ({{province.country.country}}) - - + + + {{name}}, {{province.name}} + ({{province.country.country}}) + + + + + + {{name}} ({{country.country}}) + + +