* refactor: 💡 use hds app header and app side nav * style: 💄 fix dark-mode colors for side nav and app header * style: 💄 cleanup * style: 💄 simplify selector * refactor: 💡 move util (param finder) to core addon * refactor: 💡 move scope picker to core addon * refactor: 💡 use hds header and app side nav in ui/desktop * refactor: 💡 clean up ui/desktop files * refactor: 💡 remove uneeded header components * refactor: 💡 remove uneeded global layout * Add missing copyright headers * style: 💄 adjust foreground and background colors to fix contras * style: 💄 remove uneeded stylelint disables * style: 💄 fix dark mode styling in desktop ui * refactor: 💡 readd user-select style * test: 💍 fix tests + e2e tests for admin and desktop UIs * refactor: 💡 clean up uneeded main elements and fix color link * Add missing copyright headers * fix: 🐛 e2e test selectors for ui/desktop * style: 💄 revert link color change * refactor: 💡 remove hds override * fix: 🐛 scope dropdown for desktop * fix: 🐛 max-height to desktop scope dropdown * Add missing copyright headers * chore: 🤖 update lockfile due to webpack update
54 lines
1.7 KiB
JavaScript
54 lines
1.7 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2021, 2026
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { expect } from '@playwright/test';
|
|
import { nanoid } from 'nanoid';
|
|
|
|
import { BaseResourcePage } from './base-resource.js';
|
|
|
|
export class GroupsPage extends BaseResourcePage {
|
|
/**
|
|
* Creates a new group. Assumes you have selected the desired scope.
|
|
* @returns Name of the group
|
|
*/
|
|
async createGroup() {
|
|
const groupName = 'Group ' + nanoid();
|
|
await this.page
|
|
.getByRole('navigation', { name: 'Primary' })
|
|
.getByRole('link', { name: 'Groups' })
|
|
.click();
|
|
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
|
await this.page.getByLabel('Name').fill(groupName);
|
|
await this.page.getByRole('button', { name: 'Save', exact: true }).click();
|
|
await this.dismissSuccessAlert();
|
|
await expect(
|
|
this.page
|
|
.getByRole('navigation', { name: 'breadcrumbs' })
|
|
.getByText(groupName),
|
|
).toBeVisible();
|
|
|
|
return groupName;
|
|
}
|
|
|
|
/**
|
|
* Adds a user to the group. Assumes you have selected the desired group.
|
|
* @param {string} userName Name of the user that will be added to the group
|
|
*/
|
|
async addMemberToGroup(userName) {
|
|
await this.page.getByRole('link', { name: 'Members', exact: true }).click();
|
|
await this.page
|
|
.getByRole('link', { name: 'Add Members', exact: true })
|
|
.click();
|
|
await this.page.getByRole('checkbox', { name: userName }).click();
|
|
await this.page
|
|
.getByRole('button', { name: 'Add Members', exact: true })
|
|
.click();
|
|
await this.dismissSuccessAlert();
|
|
await expect(
|
|
this.page.getByRole('table').getByText(userName),
|
|
).toBeVisible();
|
|
}
|
|
}
|