( page: Page, organization?: string, )
| 341 | * random name. |
| 342 | */ |
| 343 | export const createGroup = async ( |
| 344 | page: Page, |
| 345 | organization?: string, |
| 346 | ): Promise<string> => { |
| 347 | const prefix = organization |
| 348 | ? `/organizations/${organization}` |
| 349 | : "/deployment"; |
| 350 | await page.goto(`${prefix}/groups/create`, { |
| 351 | waitUntil: "domcontentloaded", |
| 352 | }); |
| 353 | await expectUrl(page).toHavePathName(`${prefix}/groups/create`); |
| 354 | |
| 355 | const name = randomName(); |
| 356 | await page.getByLabel("Name", { exact: true }).fill(name); |
| 357 | await page.getByRole("button", { name: /save/i }).click(); |
| 358 | await expectUrl(page).toHavePathName(`${prefix}/groups/${name}`); |
| 359 | return name; |
| 360 | }; |
| 361 | |
| 362 | /** |
| 363 | * sshIntoWorkspace spawns a Coder SSH process and a client connected to it. |
no test coverage detected