From e85d6bec8cd6c8f379d235aa2f28be3d85a1fed2 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 10 Oct 2022 14:03:29 +0200 Subject: [PATCH] fix e2e --- e2e/helpers/selectors.js | 4 ++-- e2e/paths/10-travel/04_extra_community.spec.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index fedcaf5f9..cd6d39795 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -1022,8 +1022,8 @@ export default { }, travelExtraCommunity: { anySearchResult: 'vn-travel-extra-community > vn-card div > tbody > tr[ng-attr-id="{{::travel.id}}"]', - firstTravelReference: 'vn-travel-extra-community tbody:nth-child(2) vn-textfield[ng-model="travel.ref"]', - firstTravelLockedKg: 'vn-travel-extra-community tbody:nth-child(2) vn-input-number[ng-model="travel.kg"]', + firstTravelReference: 'vn-travel-extra-community tbody:nth-child(2) vn-td-editable[name="reference"]', + firstTravelLockedKg: 'vn-travel-extra-community tbody:nth-child(2) vn-td-editable[name="lockedKg"]', removeContinentFilter: 'vn-searchbar > form > vn-textfield > div.container > div.prepend > prepend > div > span:nth-child(3) > vn-icon > i' }, travelBasicData: { diff --git a/e2e/paths/10-travel/04_extra_community.spec.js b/e2e/paths/10-travel/04_extra_community.spec.js index a1cad6a7d..c5975c958 100644 --- a/e2e/paths/10-travel/04_extra_community.spec.js +++ b/e2e/paths/10-travel/04_extra_community.spec.js @@ -19,10 +19,10 @@ describe('Travel extra community path', () => { it('should edit the travel reference and the locked kilograms', async() => { await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter); await page.waitForSpinnerLoad(); - await page.clearInput(selectors.travelExtraCommunity.firstTravelReference); - await page.write(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); - await page.clearInput(selectors.travelExtraCommunity.firstTravelLockedKg); - await page.write(selectors.travelExtraCommunity.firstTravelLockedKg, '1500'); + await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); + await page.waitForSpinnerLoad(); + await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelLockedKg, '1500'); + const message = await page.waitForSnackbar(); expect(message.text).toContain('Data saved!'); @@ -32,9 +32,9 @@ describe('Travel extra community path', () => { await page.accessToSection('travel.index'); await page.accessToSection('travel.extraCommunity'); await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter); - - const reference = await page.waitToGetProperty(selectors.travelExtraCommunity.firstTravelReference, 'value'); - const lockedKg = await page.waitToGetProperty(selectors.travelExtraCommunity.firstTravelLockedKg, 'value'); + await page.waitForTextInElement(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); + const reference = await page.getProperty(selectors.travelExtraCommunity.firstTravelReference, 'innerText'); + const lockedKg = await page.getProperty(selectors.travelExtraCommunity.firstTravelLockedKg, 'innerText'); expect(reference).toContain('edited reference'); expect(lockedKg).toContain(1500);