Skip to content

Commit

Permalink
AB#30158 add fixes from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrk39 committed Sep 10, 2024
1 parent 225350e commit 5552c18
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
26 changes: 16 additions & 10 deletions e2e/portalicious/pages/ProjectTeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ class ProjectTeam extends BasePage {
super(page);
this.page = page;
this.tableRows = this.page.locator('table tbody tr');
this.usersDropdown = this.page.getByRole('option');
this.chooseUserDropdown = this.page.getByLabel('Choose user')
this.chooseRoleDropdown = this.page.getByLabel('Assign roles');
this.submitButton = this.page.getByRole('button', { name: 'Submit' });
this.addUserFormUsersDropdown = this.page.getByRole('option');
this.addUserFormChooseUserDropdown = this.page.locator(
`[formControlName="userValue"]`,
);
this.addUserFormChooseRoleDropdown = this.page.locator(
`[formControlName="rolesValue"]`,
);
this.addUserFormSubmitButton = this.page.getByRole('button', {
name: 'Submit',
});
this.removeUserButton = this.page.getByRole('button', {
name: 'Remove user',
});
Expand Down Expand Up @@ -54,17 +60,17 @@ class ProjectTeam extends BasePage {
userEmail: string;
role: string;
}) {
await this.chooseUserDropdown.click();
await this.chooseUserDropdown.fill(userSearchPhrase);
await this.addUserFormChooseUserDropdown.click();
await this.addUserFormChooseUserDropdown.fill(userSearchPhrase);
await this.page.getByText(userEmail).click();
await this.chooseRoleDropdown.click();
await this.addUserFormChooseRoleDropdown.click();
await this.page.getByText(role).click();
await this.submitButton.click();
await this.addUserFormSubmitButton.click();
}

async validateAvailableSystemUsers(expectedAssignedUsers: string[]) {
await this.chooseUserDropdown.click();
const actualAssignedUsers = await this.usersDropdown.evaluateAll(
await this.addUserFormChooseUserDropdown.click();
const actualAssignedUsers = await this.addUserFormUsersDropdown.evaluateAll(
(options) => options.map((option) => option.textContent.trim()),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test('[29758] All system-users are available to be added to a "project team"', a
});

await test.step('Validate available system users are visible', async () => {
await manageTeam.navigateToAddTeamMemebers();
await manageTeam.openAddUserForm();
await manageTeam.validateAvailableSystemUsers(expectedAvailablesystemUsers);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('[29759] Assign successfully roles to a user ', async ({ page }) => {
});

await test.step('Validate available system users are visible', async () => {
await manageTeam.navigateToAddTeamMemebers();
await manageTeam.openAddUserForm();
await manageTeam.addUserToTeam({
userSearchPhrase: userSearchPhrase,
userEmail: userFullEmail,
Expand Down

0 comments on commit 5552c18

Please sign in to comment.