cypress-io / cypress-chrome-recorder

Export Cypress Tests from Google Chrome DevTools' Recorder
MIT License
226 stars 18 forks source link

Error: Step.key is not a string #51

Open simsketch opened 1 year ago

simsketch commented 1 year ago

Trying to use on JSON file that was exported from Chrome Recorder.

Error: Step.key is not a string
    at parseString (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@puppeteer/replay/lib/main.js:182:11)
    at parseKeyDownStep (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@puppeteer/replay/lib/main.js:326:14)
    at parseStep (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@puppeteer/replay/lib/main.js:457:20)
    at parseSteps (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@puppeteer/replay/lib/main.js:486:21)
    at parse (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@puppeteer/replay/lib/main.js:528:16)
    at parseRecordingContent (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@cypress/chrome-recorder/dist/main.js:4:12)
    at cypressStringifyChromeRecording (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@cypress/chrome-recorder/dist/main.js:22:29)
    at file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@cypress/chrome-recorder/dist/cli/transforms.js:43:39
    at Array.map (<anonymous>)
    at runTransforms (file:///Users/username/.npm/_npx/46e9de2b1105cb4c/node_modules/@cypress/chrome-recorder/dist/cli/transforms.js:40:18)
username@username-username-M4C-MBP-MGYCXWHQDH fmg-nia-matgen-ui % 
ksubramanian2 commented 1 year ago

Getting the same error - similar stack track, except it is while parsing KeyUp step. I had only one keyUp step in the Json file and it has the structure in the recording Json file:

{
    "type": "keyUp",
    "target": "main"
}

It doesn't show any 'key'.