Skip to content

Commit 3c765e0

Browse files
committed
Adding method for template creation process
1 parent b67a9c4 commit 3c765e0

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

_playwright-tests/UI/Templates.spec.ts

+23-8
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,30 @@ import { navigateToTemplates } from './helpers/navHelpers';
44
import { closePopupsIfExist } from './helpers/helpers';
55

66
describe('Templates', () => {
7-
test('Navigate to templates, make sure the Add content template button can be clicked', async ({
8-
page,
9-
}) => {
7+
test('Navigate to templates and add a basic template', async ({ page }) => {
108
await navigateToTemplates(page);
119
await closePopupsIfExist(page);
12-
13-
const AddButton = page.locator('[data-ouia-component-id="create_content_template"]');
14-
15-
// Wait for the Add button to become enabled (up to 10 seconds)
16-
await AddButton.first().isEnabled({ timeout: 10000 });
10+
await page.getByRole('button', { name: 'Add content template' }).click();
11+
const architectureFilterButton = page.getByRole('button', { name: 'Select architecture' });
12+
await architectureFilterButton.click()
13+
await page.getByRole('option', { name: 'x86_64' }).click();
14+
const versionFilterButton = page.getByRole('button', { name: 'Select version' });
15+
await versionFilterButton.click();
16+
await page.getByRole('menuitem', { name: 'el8' }).locator('label').click();
17+
await page.getByRole('button', { name: 'Next' }).click();
18+
// select Red hat repos Checkbox optional
19+
await page.getByRole('button', { name: 'Next' }).click();
20+
// select checkbox for cutom repo optional
21+
page.getByRole('button', { name: 'Next' }).click();
22+
await page.getByRole('radio', { name: 'use-latest-snapshot' }).fill('True');
23+
page.getByRole('button', { name: 'Next' }).click();
24+
const nameInput = page.getByPlaceholder('Enter name');
25+
const descriptionInput = page.getByPlaceholder('Enter Description'); //optional
26+
await nameInput.fill('demo_template');
27+
await descriptionInput.fill('test'); // optional
28+
page.getByRole('button', { name: 'Next' }).click();
29+
// teamplate with system
30+
page.getByRole('button').locator('pf-v5-c-menu-toggle__button');
31+
page.getByRole('button', { name: 'Create template only' }).click();
1732
});
1833
});

0 commit comments

Comments
 (0)