2024-08-06 13:15:00 -04:00
|
|
|
/**
|
2026-01-28 17:09:06 -08:00
|
|
|
* Copyright IBM Corp. 2021, 2026
|
2024-08-06 13:15:00 -04:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
*/
|
|
|
|
|
|
2024-08-19 16:00:16 -04:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
|
import { nanoid } from 'nanoid';
|
2024-08-06 13:15:00 -04:00
|
|
|
|
2024-11-12 11:21:37 -05:00
|
|
|
import { BaseResourcePage } from './base-resource.js';
|
2024-08-06 13:15:00 -04:00
|
|
|
|
2024-08-19 16:00:16 -04:00
|
|
|
export class ProjectsPage extends BaseResourcePage {
|
2024-08-06 13:15:00 -04:00
|
|
|
/**
|
|
|
|
|
* Creates a new project. Assumes you have selected the desired org.
|
|
|
|
|
* @returns Name of the project
|
|
|
|
|
*/
|
|
|
|
|
async createProject() {
|
|
|
|
|
const projectName = 'Project ' + nanoid();
|
|
|
|
|
await this.page
|
2026-02-25 13:55:36 -08:00
|
|
|
.getByRole('navigation', { name: 'Primary' })
|
2024-08-06 13:15:00 -04:00
|
|
|
.getByRole('link', { name: 'Projects' })
|
|
|
|
|
.click();
|
|
|
|
|
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
|
|
|
|
await this.page.getByLabel('Name').fill(projectName);
|
|
|
|
|
await this.page.getByLabel('Description').fill('This is an automated test');
|
2025-12-23 12:32:16 -05:00
|
|
|
await this.page.getByRole('button', { name: 'Save', exact: true }).click();
|
2024-08-06 13:15:00 -04:00
|
|
|
await this.dismissSuccessAlert();
|
|
|
|
|
await expect(
|
|
|
|
|
this.page
|
|
|
|
|
.getByRole('navigation', { name: 'breadcrumbs' })
|
|
|
|
|
.getByText(projectName),
|
|
|
|
|
).toBeVisible();
|
|
|
|
|
|
|
|
|
|
return projectName;
|
|
|
|
|
}
|
|
|
|
|
}
|