diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index bf2323b24..a561a08cf 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -258,7 +258,9 @@ export default { }, clientLog: { lastModificationPreviousValue: 'vn-client-log vn-table vn-td.before', - lastModificationCurrentValue: 'vn-client-log vn-table vn-td.after' + lastModificationCurrentValue: 'vn-client-log vn-table vn-td.after', + penultimateModificationPreviousValue: 'vn-client-log vn-table vn-tr:nth-child(2) vn-td.before', + penultimateModificationCurrentValue: 'vn-client-log vn-table vn-tr:nth-child(2) vn-td.after' }, clientBalance: { diff --git a/e2e/paths/02-client/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js index b1af95638..bcd476f6b 100644 --- a/e2e/paths/02-client/07_edit_web_access.spec.js +++ b/e2e/paths/02-client/07_edit_web_access.spec.js @@ -16,8 +16,15 @@ describe('Client Edit web access path', () => { await browser.close(); }); - it(`should uncheck the Enable web access checkbox and update the name`, async() => { + it('should uncheck the Enable web access checkbox', async() => { await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox); + await page.waitToClick(selectors.clientWebAccess.saveButton); + const message = await page.waitForSnackbar(); + + expect(message.text).toContain('Data saved!'); + }); + + it(`should update the name`, async() => { await page.clearInput(selectors.clientWebAccess.userName); await page.write(selectors.clientWebAccess.userName, 'Hulk'); await page.waitToClick(selectors.clientWebAccess.saveButton); @@ -26,9 +33,8 @@ describe('Client Edit web access path', () => { expect(message.text).toContain('Data saved!'); }); - it('should confirm web access is now unchecked', async() => { - await page.accessToSection('client.card.basicData'); - await page.accessToSection('client.card.webAccess'); + it('should reload the section and confirm web access is now unchecked', async() => { + await page.reloadSection('client.card.webAccess'); const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox); expect(result).toBe('unchecked'); @@ -44,13 +50,23 @@ describe('Client Edit web access path', () => { await page.accessToSection('client.card.log'); }); - it(`should confirm the log is showing the updated data for the client`, async() => { + it(`should confirm the last log is showing the updated client name and no modifications on the active checkbox`, async() => { let lastModificationPreviousValue = await page .waitToGetProperty(selectors.clientLog.lastModificationPreviousValue, 'innerText'); let lastModificationCurrentValue = await page .waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText'); - expect(lastModificationPreviousValue).toEqual('name BruceBanner active true'); + expect(lastModificationPreviousValue).toEqual('name BruceBanner active false'); expect(lastModificationCurrentValue).toEqual('name Hulk active false'); }); + + it(`should confirm the penultimate log is showing the updated avtive field and no modifications on the client name`, async() => { + let penultimateModificationPreviousValue = await page + .waitToGetProperty(selectors.clientLog.penultimateModificationPreviousValue, 'innerText'); + let penultimateModificationCurrentValue = await page + .waitToGetProperty(selectors.clientLog.penultimateModificationCurrentValue, 'innerText'); + + expect(penultimateModificationPreviousValue).toEqual('name BruceBanner active true'); + expect(penultimateModificationCurrentValue).toEqual('name BruceBanner active false'); + }); }); diff --git a/modules/client/front/web-access/index.html b/modules/client/front/web-access/index.html index 07a2615dd..610497994 100644 --- a/modules/client/front/web-access/index.html +++ b/modules/client/front/web-access/index.html @@ -9,6 +9,8 @@