playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: press enter in contenteditable doesn't make keypress code in codegen

Open ed-jinyoung-park opened this issue 1 year ago • 0 comments

Version

1.43.1

Steps to reproduce

  1. run playwright codegen
  2. go to contenteditable demo site (https://d-toybox.com/studio/lib/input_event_viewer.html)
  3. write any word in contenteditable element
  4. press enter

playwright test

Expected behavior

i expect codegen generated code to make like this

...
await page.keyboard.press('enter')
... 

Actual behavior

enter event just append '\n\n' word at last of fill method value

...
await page.locator('#editor').fill('aaaaa\n\n\n\n\n\n');
...

Additional context

No response

Environment

System:
    OS: macOS 13.3.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 401.03 MB / 32.00 GB
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
    pnpm: 8.15.3 - ~/.nvm/versions/node/v18.16.1/bin/pnpm
  IDEs:
    VSCode: 1.88.1 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.43.1 => 1.43.1 
    playwright: ^1.43.1 => 1.43.1

ed-jinyoung-park avatar Apr 29 '24 08:04 ed-jinyoung-park