-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: main
Are you sure you want to change the base?
UI - Playwright POC - Templating #435
Conversation
3c765e0
to
58239b5
Compare
const architectureFilterButton = page.getByRole('button', { name: 'Select architecture' }); | ||
await architectureFilterButton.click() |
There was a problem hiding this comment.
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.
const versionFilterButton = page.getByRole('button', { name: 'Select version' }); | ||
await versionFilterButton.click(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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();
const nameInput = page.getByPlaceholder('Enter name'); | ||
const descriptionInput = page.getByPlaceholder('Enter Description'); //optional | ||
await nameInput.fill('demo_template'); | ||
await descriptionInput.fill('test'); // optional |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added thanks !
58239b5
to
6fa551b
Compare
Summary
Testing steps