e2e path for activate/deactivate user on account/descriptor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2022-05-17 15:38:24 +02:00
parent ed4718922e
commit 4647d6e54e
3 changed files with 33 additions and 19 deletions

View File

@ -55,6 +55,7 @@ export default {
setPassword: '.vn-menu [name="setPassword"]', setPassword: '.vn-menu [name="setPassword"]',
activateAccount: '.vn-menu [name="enableAccount"]', activateAccount: '.vn-menu [name="enableAccount"]',
activateUser: '.vn-menu [name="activateUser"]', activateUser: '.vn-menu [name="activateUser"]',
deactivateUser: '.vn-menu [name="deactivateUser"]',
newPassword: 'vn-textfield[ng-model="$ctrl.newPassword"]', newPassword: 'vn-textfield[ng-model="$ctrl.newPassword"]',
repeatPassword: 'vn-textfield[ng-model="$ctrl.repeatPassword"]', repeatPassword: 'vn-textfield[ng-model="$ctrl.repeatPassword"]',
newRole: 'vn-autocomplete[ng-model="$ctrl.newRole"]', newRole: 'vn-autocomplete[ng-model="$ctrl.newRole"]',

View File

@ -36,8 +36,7 @@ describe('Account create and basic data path', () => {
await page.waitForState('account.card.basicData'); await page.waitForState('account.card.basicData');
}); });
it('should reload the section and check the name is as expected', async() => { it('should check the name is as expected', async() => {
await page.reloadSection('account.card.basicData');
const result = await page.waitToGetProperty(selectors.accountBasicData.name, 'value'); const result = await page.waitToGetProperty(selectors.accountBasicData.name, 'value');
expect(result).toEqual('Remy'); expect(result).toEqual('Remy');
@ -103,25 +102,39 @@ describe('Account create and basic data path', () => {
}); });
}); });
// creating the account without the active property set to true seems to be creating an active user anyways describe('deactivate user', () => {
// describe('activate user', () => { it(`should check the inactive user icon isn't present in the descriptor just yet`, async() => {
// it(`should check the inactive user icon is present in the descriptor`, async() => { await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 0);
// await page.waitForSelector(selectors.accountDescriptor.activeUserIcon, {visible: true}); });
// });
// it('should activate the user using the descriptor menu', async() => { it('should deactivate the user using the descriptor menu', async() => {
// await page.waitToClick(selectors.accountDescriptor.menuButton); await page.waitToClick(selectors.accountDescriptor.menuButton);
// await page.waitToClick(selectors.accountDescriptor.activateUser); await page.waitToClick(selectors.accountDescriptor.deactivateUser);
// await page.waitToClick(selectors.accountDescriptor.acceptButton); await page.waitToClick(selectors.accountDescriptor.acceptButton);
// const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
// expect(message.text).toContain('user enabled?'); expect(message.text).toContain('User deactivated!');
// }); });
// it('should check the inactive user icon is not present anymore', async() => { it('should check the inactive user icon is now present', async() => {
// await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 0); await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 1);
// }); });
// }); });
describe('activate user', () => {
it('should activate the user using the descriptor menu', async() => {
await page.waitToClick(selectors.accountDescriptor.menuButton);
await page.waitToClick(selectors.accountDescriptor.activateUser);
await page.waitToClick(selectors.accountDescriptor.acceptButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('User activated!');
});
it('should check the inactive user icon is not present anymore', async() => {
await page.waitForNumberOfElements(selectors.accountDescriptor.activeUserIcon, 0);
});
});
describe('mail forwarding', () => { describe('mail forwarding', () => {
it('should activate the mail forwarding and set the recipent email', async() => { it('should activate the mail forwarding and set the recipent email', async() => {

View File

@ -56,7 +56,7 @@ describe('Account Alias create and basic data path', () => {
expect(result).toContain('psykers'); expect(result).toContain('psykers');
}); });
it('should search for the IT alias group then access to the users section then check the role listed is the expected one', async() => { it('should search IT alias then access the user section to check the role listed is the expected one', async() => {
await page.accessToSearchResult('IT'); await page.accessToSearchResult('IT');
await page.accessToSection('account.alias.card.users'); await page.accessToSection('account.alias.card.users');
const rolesCount = await page.countElement(selectors.accountAliasUsers.anyResult); const rolesCount = await page.countElement(selectors.accountAliasUsers.anyResult);