From 0d1733622089e03851f371cb99c10006cae91553 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Tue, 2 Mar 2021 16:43:33 +0100 Subject: [PATCH 1/2] added salix.module to production dump (starred) --- db/export-data.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/db/export-data.sh b/db/export-data.sh index 5980b5c29..698a2f1da 100755 --- a/db/export-data.sh +++ b/db/export-data.sh @@ -32,6 +32,7 @@ TABLES=( salix ACL fieldAcl + module ) dump_tables ${TABLES[@]} -- 2.40.1 From 1e6292ed13e6d193b3ce72cd1c428db3e1661712 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Tue, 2 Mar 2021 16:43:45 +0100 Subject: [PATCH 2/2] e2e path for travel.create --- e2e/helpers/selectors.js | 9 +++ e2e/paths/10-travel/01_create.spec.js | 76 +++++++++++++++++++ ...mograph.spec.js => 05_thermograph.spec.js} | 0 3 files changed, 85 insertions(+) create mode 100644 e2e/paths/10-travel/01_create.spec.js rename e2e/paths/10-travel/{01_thermograph.spec.js => 05_thermograph.spec.js} (100%) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 4e512ee56..931d72654 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -855,6 +855,14 @@ export default { anySearchResult: 'vn-travel-index vn-tbody > a', firstSearchResult: 'vn-travel-index vn-tbody > a:nth-child(1)', firstTravelAddEntryButton: 'vn-travel-index a:nth-child(1) vn-icon[icon="icon-ticket"]', + newTravelButton: 'vn-travel-index button vn-icon[icon="add"]', + reference: 'vn-travel-create vn-textfield[ng-model="$ctrl.travel.ref"]', + agency: 'vn-travel-create vn-autocomplete[ng-model="$ctrl.travel.agencyModeFk"]', + shipDate: 'vn-travel-create vn-date-picker[ng-model="$ctrl.travel.shipped"]', + landingDate: 'vn-travel-create vn-date-picker[ng-model="$ctrl.travel.landed"]', + warehouseOut: 'vn-travel-create vn-autocomplete[ng-model="$ctrl.travel.warehouseOutFk"]', + warehouseIn: 'vn-travel-create vn-autocomplete[ng-model="$ctrl.travel.warehouseInFk"]', + save: 'vn-travel-create vn-submit > button' }, travelExtraCommunity: { anySearchResult: 'vn-travel-extra-community > vn-data-viewer div > vn-tbody > vn-tr', @@ -865,6 +873,7 @@ export default { travelBasicData: { reference: 'vn-travel-basic-data vn-textfield[ng-model="$ctrl.travel.ref"]', agency: 'vn-travel-basic-data vn-autocomplete[ng-model="$ctrl.travel.agencyModeFk"]', + shippedDate: 'vn-travel-basic-data vn-date-picker[ng-model="$ctrl.travel.shipped"]', deliveryDate: 'vn-travel-basic-data vn-date-picker[ng-model="$ctrl.travel.landed"]', outputWarehouse: 'vn-travel-basic-data vn-autocomplete[ng-model="$ctrl.travel.warehouseOutFk"]', inputWarehouse: 'vn-travel-basic-data vn-autocomplete[ng-model="$ctrl.travel.warehouseInFk"]', diff --git a/e2e/paths/10-travel/01_create.spec.js b/e2e/paths/10-travel/01_create.spec.js new file mode 100644 index 000000000..65540d433 --- /dev/null +++ b/e2e/paths/10-travel/01_create.spec.js @@ -0,0 +1,76 @@ +import selectors from '../../helpers/selectors.js'; +import getBrowser from '../../helpers/puppeteer'; + +describe('Travel create path', () => { + let browser; + let page; + const date = new Date(); + const day = 15; + date.setDate(day); + + beforeAll(async() => { + browser = await getBrowser(); + page = browser.page; + await page.loginAndModule('buyer', 'travel'); + }); + + afterAll(async() => { + await browser.close(); + }); + + it('should open the create travel form by clicking on the "new" button', async() => { + await page.waitToClick(selectors.travelIndex.newTravelButton); + await page.waitForState('travel.create'); + }); + + it('should fill the reference, agency and ship date then save the form', async() => { + await page.write(selectors.travelIndex.reference, 'Testing reference'); + await page.autocompleteSearch(selectors.travelIndex.agency, 'inhouse pickup'); + await page.pickDate(selectors.travelIndex.shipDate, date); + await page.waitToClick(selectors.travelIndex.save); + + const message = await page.waitForSnackbar(); + + expect(message.text).toContain('Data saved!'); + }); + + it('should check the user was redirected to the travel basic data upon creation', async() => { + await page.waitForState('travel.card.basicData'); + }); + + it('should check the travel was created with the correct reference', async() => { + const reference = await page.waitToGetProperty(selectors.travelBasicData.reference, 'value'); + + expect(reference).toContain('Testing reference'); + }); + + it('should check the travel was created with the correct agency', async() => { + const agency = await page.waitToGetProperty(selectors.travelBasicData.agency, 'value'); + + expect(agency).toContain('inhouse pickup'); + }); + + it('should check the travel was created with the correct shiping date', async() => { + const shipDate = await page.waitToGetProperty(selectors.travelBasicData.shippedDate, 'value'); + + expect(shipDate).toContain(day); + }); + + it('should check the travel was created with the correct landing date', async() => { + const landingDate = await page.waitToGetProperty(selectors.travelBasicData.deliveryDate, 'value'); + + expect(landingDate).toContain(day); + }); + + it('should check the travel was created with the correct warehouseOut', async() => { + const warehouseOut = await page.waitToGetProperty(selectors.travelBasicData.outputWarehouse, 'value'); + + expect(warehouseOut).toContain('Warehouse One'); + }); + + it('should check the travel was created with the correct warehouseIn', async() => { + const warehouseIn = await page.waitToGetProperty(selectors.travelBasicData.inputWarehouse, 'value'); + + expect(warehouseIn).toContain('Warehouse Five'); + }); +}); diff --git a/e2e/paths/10-travel/01_thermograph.spec.js b/e2e/paths/10-travel/05_thermograph.spec.js similarity index 100% rename from e2e/paths/10-travel/01_thermograph.spec.js rename to e2e/paths/10-travel/05_thermograph.spec.js -- 2.40.1