web access e2e path adapted to lastest modificications

This commit is contained in:
Carlos Jimenez Ruiz 2021-07-21 10:07:12 +02:00
parent 0676eb5f30
commit 25411c90e3
2 changed files with 25 additions and 7 deletions

View File

@ -258,7 +258,9 @@ export default {
}, },
clientLog: { clientLog: {
lastModificationPreviousValue: 'vn-client-log vn-table vn-td.before', 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: { clientBalance: {

View File

@ -16,8 +16,15 @@ describe('Client Edit web access path', () => {
await browser.close(); 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.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.clearInput(selectors.clientWebAccess.userName);
await page.write(selectors.clientWebAccess.userName, 'Hulk'); await page.write(selectors.clientWebAccess.userName, 'Hulk');
await page.waitToClick(selectors.clientWebAccess.saveButton); await page.waitToClick(selectors.clientWebAccess.saveButton);
@ -26,9 +33,8 @@ describe('Client Edit web access path', () => {
expect(message.text).toContain('Data saved!'); expect(message.text).toContain('Data saved!');
}); });
it('should confirm web access is now unchecked', async() => { it('should reload the section and confirm web access is now unchecked', async() => {
await page.accessToSection('client.card.basicData'); await page.reloadSection('client.card.webAccess');
await page.accessToSection('client.card.webAccess');
const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox); const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox);
expect(result).toBe('unchecked'); expect(result).toBe('unchecked');
@ -44,13 +50,23 @@ describe('Client Edit web access path', () => {
await page.accessToSection('client.card.log'); 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 let lastModificationPreviousValue = await page
.waitToGetProperty(selectors.clientLog.lastModificationPreviousValue, 'innerText'); .waitToGetProperty(selectors.clientLog.lastModificationPreviousValue, 'innerText');
let lastModificationCurrentValue = await page let lastModificationCurrentValue = await page
.waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText'); .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'); 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');
});
}); });