checkly / headless-recorder

Chrome extension that records your browser interactions and generates a Playwright or Puppeteer script.
https://checklyhq.com/headless-recorder
MIT License
15.03k stars 722 forks source link

integration tests failing on master #58

Closed ephetic closed 5 years ago

ephetic commented 5 years ago
npm --version
6.4.1
node --version
v10.15.3
npm test

> puppeteer-recorder@0.7.0 test /Users/bcleary/dev/puppeteer-recorder
> npm run unit-test && npm run e2e-test

> puppeteer-recorder@0.7.0 unit-test /Users/bcleary/dev/puppeteer-recorder
> jest __tests__/.*.spec.js --silent

 PASS  src/content-scripts/__tests__/UIController.spec.js
 PASS  src/code-generator/__tests__/CodeGenerator.spec.js
 PASS  src/popup/components/__tests__/ResultsTab.spec.js
 PASS  src/popup/components/__tests__/RecordingTab.spec.js
 PASS  src/popup/components/__tests__/App.spec.js
 PASS  src/options/components/__tests__/App.spec.js
 FAIL  src/content-scripts/__tests__/forms.spec.js (31.767s)
  ● forms › it should load the form

    Evaluation failed: TypeError: Cannot read property '_clearEventLog' of undefined

      at __puppeteer_evaluation_script__:2:33
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:112:20)
        -- ASYNC --
      at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at Page.evaluate (node_modules/puppeteer/lib/Page.js:782:43)
      at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:112:23)
      at evaluate (src/content-scripts/__tests__/helpers.js:18:15)
      at _callee2$ (src/content-scripts/__tests__/forms.spec.js:29:11)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

  ● forms › it should record text input elements

    Evaluation failed: TypeError: Cannot read property '_clearEventLog' of undefined

      at __puppeteer_evaluation_script__:2:33
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:112:20)
        -- ASYNC --
      at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at Page.evaluate (node_modules/puppeteer/lib/Page.js:782:43)
      at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:112:23)
      at evaluate (src/content-scripts/__tests__/helpers.js:18:15)
      at _callee2$ (src/content-scripts/__tests__/forms.spec.js:29:11)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

  ● forms › it should record text input elements

    Evaluation failed: TypeError: Cannot read property '_getEventLog' of undefined

      at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:3:30)
      at onRaf (__puppeteer_evaluation_script__:56:33)
      at pollRaf (__puppeteer_evaluation_script__:48:5)
      at waitForPredicatePageFunction (__puppeteer_evaluation_script__:7:18)
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at WaitTask.rerun (node_modules/puppeteer/lib/DOMWorld.js:582:65)

  ● forms › it should record textarea elements

    Evaluation failed: TypeError: Cannot read property '_clearEventLog' of undefined

      at __puppeteer_evaluation_script__:2:33
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:112:20)
        -- ASYNC --
      at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at Page.evaluate (node_modules/puppeteer/lib/Page.js:782:43)
      at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:112:23)
      at evaluate (src/content-scripts/__tests__/helpers.js:18:15)
      at _callee2$ (src/content-scripts/__tests__/forms.spec.js:29:11)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

  ● forms › it should record textarea elements

    Evaluation failed: TypeError: Cannot read property '_getEventLog' of undefined

      at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:3:30)
      at onRaf (__puppeteer_evaluation_script__:56:33)
      at pollRaf (__puppeteer_evaluation_script__:48:5)
      at waitForPredicatePageFunction (__puppeteer_evaluation_script__:7:18)
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at WaitTask.rerun (node_modules/puppeteer/lib/DOMWorld.js:582:65)

  ● forms › it should record radio input elements

    Evaluation failed: TypeError: Cannot read property '_clearEventLog' of undefined

      at __puppeteer_evaluation_script__:2:33
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:112:20)
        -- ASYNC --
      at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at Page.evaluate (node_modules/puppeteer/lib/Page.js:782:43)
      at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:112:23)
      at evaluate (src/content-scripts/__tests__/helpers.js:18:15)
      at _callee2$ (src/content-scripts/__tests__/forms.spec.js:29:11)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

  ● forms › it should record radio input elements

    Evaluation failed: TypeError: Cannot read property '_getEventLog' of undefined

      at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:3:30)
      at onRaf (__puppeteer_evaluation_script__:56:33)
      at pollRaf (__puppeteer_evaluation_script__:48:5)
      at waitForPredicatePageFunction (__puppeteer_evaluation_script__:7:18)
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at WaitTask.rerun (node_modules/puppeteer/lib/DOMWorld.js:582:65)

  ● forms › it should record select and option elements

    Evaluation failed: TypeError: Cannot read property '_clearEventLog' of undefined

      at __puppeteer_evaluation_script__:2:33
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:112:20)
        -- ASYNC --
      at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at Page.evaluate (node_modules/puppeteer/lib/Page.js:782:43)
      at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:112:23)
      at evaluate (src/content-scripts/__tests__/helpers.js:18:15)
      at _callee2$ (src/content-scripts/__tests__/forms.spec.js:29:11)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

  ● forms › it should record select and option elements

    Evaluation failed: TypeError: Cannot read property '_getEventLog' of undefined

      at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:3:30)
      at onRaf (__puppeteer_evaluation_script__:56:33)
      at pollRaf (__puppeteer_evaluation_script__:48:5)
      at waitForPredicatePageFunction (__puppeteer_evaluation_script__:7:18)
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at WaitTask.rerun (node_modules/puppeteer/lib/DOMWorld.js:582:65)

  ● forms › it should record checkbox input elements

    Evaluation failed: TypeError: Cannot read property '_clearEventLog' of undefined

      at __puppeteer_evaluation_script__:2:33
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:112:20)
        -- ASYNC --
      at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at Page.evaluate (node_modules/puppeteer/lib/Page.js:782:43)
      at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:112:23)
      at evaluate (src/content-scripts/__tests__/helpers.js:18:15)
      at _callee2$ (src/content-scripts/__tests__/forms.spec.js:29:11)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

  ● forms › it should record checkbox input elements

    Evaluation failed: TypeError: Cannot read property '_getEventLog' of undefined

      at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:3:30)
      at onRaf (__puppeteer_evaluation_script__:56:33)
      at pollRaf (__puppeteer_evaluation_script__:48:5)
      at waitForPredicatePageFunction (__puppeteer_evaluation_script__:7:18)
      at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
        -- ASYNC --
      at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
      at WaitTask.rerun (node_modules/puppeteer/lib/DOMWorld.js:582:65)

Test Suites: 1 failed, 6 passed, 7 total
Tests:       6 failed, 23 passed, 29 total
Snapshots:   8 passed, 8 total
Time:        34.366s
tnolet commented 5 years ago

@ephetic this must be a local problem. It builds fine on my machine and builds are triggered on Travis on each push. They also are building fine (see https://travis-ci.org/checkly/puppeteer-recorder for the build log of the last commit).

ephetic commented 5 years ago

I'll check the versions in CI and see if that helps. Thanks.

$ node --version
v8.11.4
$ npm --version
5.6.0
$ nvm --version
0.34.0
ephetic commented 5 years ago

@tnolet Okay, figured out the problem. I hadn't run npm run dev (I was installing the extension from the dist folder) so I didn't have a build folder which caused the npm run test tests to fail. npm run test-prod passed fine because i did have a dist folder. Having sorted that out, the tests pass for node 8 and 10, but not 12. fwiw.