MCPcopy Index your code
hub / github.com/coder/coder / addUserToOrganization

Function addUserToOrganization

site/e2e/helpers.ts:1378–1399  ·  view source on GitHub ↗
(
	page: Page,
	organization: string,
	user: string,
	roles: string[] = [],
)

Source from the content-addressed store, hash-verified

1376 * @param user user email or username
1377 */
1378export async function addUserToOrganization(
1379 page: Page,
1380 organization: string,
1381 user: string,
1382 roles: string[] = [],
1383): Promise<void> {
1384 await page.goto(`/organizations/${organization}`, {
1385 waitUntil: "domcontentloaded",
1386 });
1387
1388 await page.getByPlaceholder("User email or username").fill(user);
1389 await page.getByRole("option", { name: user }).click();
1390 await page.getByRole("button", { name: "Add user" }).click();
1391 const addedRow = page.locator("tr", { hasText: user });
1392 await expect(addedRow).toBeVisible();
1393
1394 await addedRow.getByLabel("Edit user roles").click();
1395 for (const role of roles) {
1396 await page.getByText(role).click();
1397 }
1398 await page.mouse.click(10, 10); // close the popover by clicking outside of it
1399}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected