Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI - Playwright POC - Templating #435

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mayurilahane
Copy link
Contributor

Summary

Testing steps

@mayurilahane mayurilahane force-pushed the mlahane/template_add_playwright branch 2 times, most recently from 3c765e0 to 58239b5 Compare February 13, 2025 20:45
Copy link

Comment on lines 12 to 13
const architectureFilterButton = page.getByRole('button', { name: 'Select architecture' });
await architectureFilterButton.click()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use architectureFilterButton more than once? If not, maybe no need to actually save it in variable.

Comment on lines 15 to 16
const versionFilterButton = page.getByRole('button', { name: 'Select version' });
await versionFilterButton.click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

await page.getByRole('option', { name: 'x86_64' }).click();
const versionFilterButton = page.getByRole('button', { name: 'Select version' });
await versionFilterButton.click();
await page.getByRole('menuitem', { name: 'el8' }).locator('label').click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that you actually need to click on the label, but if it is required, fair enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this did the work
await page.getByRole('option', { name: 'el8' }).click();

await versionFilterButton.click();
await page.getByRole('menuitem', { name: 'el8' }).locator('label').click();
await page.getByRole('button', { name: 'Next' }).click();
// select Red hat repos Checkbox optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment for the next row? Because that does not select any repos. Same for the comment on line 21

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a reminder to add that optional step i will make it clear thanks !

await page.getByRole('button', { name: 'Next' }).click();
// select checkbox for cutom repo optional
page.getByRole('button', { name: 'Next' }).click();
await page.getByRole('radio', { name: 'use-latest-snapshot' }).fill('True');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.fill(True) ? I though we should be using https://playwright.dev/docs/input#checkboxes-and-radio-buttons or is that not working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it with the locator attribute
await page.locator('input[name="use-latest-snapshot"]').click();

Comment on lines 25 to 28
const nameInput = page.getByPlaceholder('Enter name');
const descriptionInput = page.getByPlaceholder('Enter Description'); //optional
await nameInput.fill('demo_template');
await descriptionInput.fill('test'); // optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be easily inline

const descriptionInput = page.getByPlaceholder('Enter Description'); //optional
await nameInput.fill('demo_template');
await descriptionInput.fill('test'); // optional
page.getByRole('button', { name: 'Next' }).click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without await it does not do much - I think :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes right added it

await descriptionInput.fill('test'); // optional
page.getByRole('button', { name: 'Next' }).click();
// teamplate with system
page.getByRole('button').locator('pf-v5-c-menu-toggle__button');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this selector used for? You need to do some assertion or waiting for some action

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its this "create template only" button

image

page.getByRole('button', { name: 'Next' }).click();
// teamplate with system
page.getByRole('button').locator('pf-v5-c-menu-toggle__button');
page.getByRole('button', { name: 'Create template only' }).click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need await. And then the test should continue and wait for the template to be created

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added thanks !

@mayurilahane mayurilahane force-pushed the mlahane/template_add_playwright branch from 58239b5 to 6fa551b Compare February 19, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants