test: introuce test fix, select role by exact name
This commit is contained in:
@@ -31,7 +31,7 @@ export class AdminRolesPage extends AuthenticatedPage {
|
|||||||
await this.roleDrawerLink.click();
|
await this.roleDrawerLink.click();
|
||||||
await this.isMounted();
|
await this.isMounted();
|
||||||
await this.rolesLoader.waitFor({
|
await this.rolesLoader.waitFor({
|
||||||
state: 'detached'
|
state: 'detached',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,9 +43,7 @@ export class AdminRolesPage extends AuthenticatedPage {
|
|||||||
state: 'detached',
|
state: 'detached',
|
||||||
});
|
});
|
||||||
return this.roleRow.filter({
|
return this.roleRow.filter({
|
||||||
has: this.page.getByTestId('role-name').filter({
|
has: this.page.getByTestId('role-name').getByText(name, { exact: true }),
|
||||||
hasText: name,
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -197,7 +197,7 @@ test.describe('Role management page', () => {
|
|||||||
await adminCreateUserPage.passwordInput.fill('sample');
|
await adminCreateUserPage.passwordInput.fill('sample');
|
||||||
await adminCreateUserPage.roleInput.click();
|
await adminCreateUserPage.roleInput.click();
|
||||||
await adminCreateUserPage.page
|
await adminCreateUserPage.page
|
||||||
.getByRole('option', { name: 'Delete Role' })
|
.getByRole('option', { name: 'Delete Role', exact: true })
|
||||||
.click();
|
.click();
|
||||||
await adminCreateUserPage.createButton.click();
|
await adminCreateUserPage.createButton.click();
|
||||||
await adminUsersPage.snackbar.waitFor({
|
await adminUsersPage.snackbar.waitFor({
|
||||||
|
Reference in New Issue
Block a user