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

fix(codegen): fix unselect issue #32127

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

Conversation

mtsmfm
Copy link
Contributor

@mtsmfm mtsmfm commented Aug 13, 2024

Fixes #31290

@mtsmfm mtsmfm mentioned this pull request Aug 13, 2024
if (withCtrl) {
await page.keyboard.down("Control");
}
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While investigating test failure on webkit, I noticed locator.click for multiple select option doesn't work.

I think it's another problem so I've created an issue

#32126

This comment has been minimized.

This comment has been minimized.

tests/library/inspector/cli-codegen-1.spec.ts Outdated Show resolved Hide resolved
// Webkit can't click multiple select options
// https://github.com/microsoft/playwright/issues/32126
if (page.context().browser().browserType().name() === 'webkit') {
const elem = await locator.elementHandle();
Copy link
Member

Choose a reason for hiding this comment

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

element handles are discouraged, there is a way to get bounding box from locator in one line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

boundingBox returns null as it's assumed as not visible. That's why I use eval thing here


const locator = await recorder.hoverOverElement('select');
expect(locator).toBe(`locator('#age')`);
await clickMultipleSelectOption(page.getByRole('option', { name: '1' }));
Copy link
Member

Choose a reason for hiding this comment

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

I hope clicking the select instead of option with offset to pick an element would work across the browsers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pavelfeldman
Um, I'm not sure what kind of operation you're referring to. Could you show me a code example?

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

2 flaky ⚠️ [firefox-page] › page/frame-goto.spec.ts:46:3 › should continue after client redirect
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:80:5 › should show console messages for test

36432 passed, 758 skipped
✔️✔️✔️

Merge workflow run.

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.

[Bug]: Unselect isn't recorded by codegen
2 participants