webdriverio / recorder-extension

WebdriverIO Extension for Devtools that allows you to export tests directly from the Recorder panel.
https://webdriver.io
MIT License
10 stars 4 forks source link

Not able to replay KeyUp and KeyDown step #4

Closed jecfish closed 2 years ago

jecfish commented 2 years ago

Steps:

  1. Import this JSON file in Recorder. https://github.com/puppeteer/replay/issues/268
  2. Export it as WebDriverIO script.
  3. Observe the step { "type": "keyDown","key": "Escape"} is transform to
     await browser.performActions([{
      type: 'key',
      id: 'keyboard',
      actions: [{ type: 'keyDown', value: 'ESCAPE' }] 
    }])
  4. Run it with chromedriver
  5. Receive error invalid argument: 'value' must be a single Unicode code point [NOT OK]
  6. Change the value to \x1B. Step executed successfully.

Expect the keyboard action map to unicode correctly.

Notes:

When the error happen, I tried to search for relevant official documentation, no useful info found.

Search online randomly return some suggests to add a config. Doesn't work either.

'goog:chromeOptions': {
            w3c: true,
        },
christian-bromann commented 2 years ago

Thanks for raising the issue.

Sending ESCAPE is not quite correct here. WebdriverIO has a table to map these value to an unicode character.

christian-bromann commented 2 years ago

fixed and published as v0.3.3