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

[Bug]: Unselect isn't recorded by codegen #31290

Closed
mtsmfm opened this issue Jun 13, 2024 · 3 comments · Fixed by #32127 or #33076
Closed

[Bug]: Unselect isn't recorded by codegen #31290

mtsmfm opened this issue Jun 13, 2024 · 3 comments · Fixed by #32127 or #33076
Labels
feature-codegen open-to-a-pull-request The feature request looks good, we are open to reviewing a PR P3-collecting-feedback

Comments

@mtsmfm
Copy link
Contributor

mtsmfm commented Jun 13, 2024

Version

1.44.1

Steps to reproduce

  1. $ npx playwright codegen https://html-preview.github.io/\?url\=https://gist.githubusercontent.com/mtsmfm/a57f12f80fbfbda30ebec8790d760610/raw/002585795a6c1ef5a9f450b386db3618c1c2e8dc/multiselect.html
  2. Click "Dog"
  3. Ctrl Click "Dog"

Expected behavior

It records selectOption([])

Actual behavior

Nothing recorded and codegen stops working

Additional context

2024-06-13.17-44-27.mp4

Environment

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 5.22 GB / 15.54 GB
    Container: Yes
  Binaries:
    Node: 20.13.1 - ~/.local/share/mise/installs/node/20/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 10.8.0 - ~/.local/share/mise/installs/node/20/bin/npm
  IDEs:
    VSCode: 1.90.0 - /home/mtsmfm/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/bin/remote-cli/code
  Languages:
    Bash: 5.0.17 - /usr/bin/bash
@yury-s
Copy link
Member

yury-s commented Jun 13, 2024

I cannot reproduce it on Ubuntu 22.04

@mtsmfm
Copy link
Contributor Author

mtsmfm commented Jun 14, 2024

I uploaded a screencast to show you the symptom

@yury-s
Copy link
Member

yury-s commented Jun 14, 2024

Could be a difference between Ubuntu 20 and 22. I any case, I tried again: click 'dog' and then ctrl+click 'cat'. First time ctrl+click on cat does not change selection (just 'dog'), but repeating ctrl+click second time it is added to the selection, resulting in the following overall snippet:

import { test, expect } from '@playwright/test';

test('test', async ({ page }) => {
  await page.goto('https://html-preview.github.io/?url=https://gist.githubusercontent.com/mtsmfm/a57f12f80fbfbda30ebec8790d760610/raw/002585795a6c1ef5a9f450b386db3618c1c2e8dc/multiselect.html');
  await page.getByLabel('Choose a pet:').selectOption('dog');
  await page.getByLabel('Choose a pet:').selectOption('dog');
  await page.getByLabel('Choose a pet:').selectOption(['dog', 'cat']);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-codegen open-to-a-pull-request The feature request looks good, we are open to reviewing a PR P3-collecting-feedback
Projects
None yet
2 participants