thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 428 forks source link

Capybara-Webkit: js/React is missing & Can't find variable: WeakMap #1018

Closed WillWylie-Modro closed 6 years ago

WillWylie-Modro commented 7 years ago

I am using Capybara-Webkit in my step-definitions for my cucumber feature files. This particular scenario tests that a successful login to a system. Capybara loads up the login form, enters the username and password perfectly, yet when it hits the login button it gets hung up on the loading page and never properly logs in.

The errors that are printed out to the console are:

  1. ReferenceError: Can't find variable: WeakMap

  2. Error: js/React is missing

  3. |TypeError: undefined is not an object (evaluating 'reagent.impl.util.memoize_1.call')

  4. TypeError: undefined is not an object (evaluating 'window["deps"]["fine"]')

  5. Feature :formatters cannot be installed. Unsupported Javascript context: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) capybara-webkit Safari/538.1.

  6. Error: js/ReactDOM is missing

  7. (typeof goog == \"undefined\") console.warn(\"ClojureScript could not load :main, did you forget to specify :asset-path?\");goog.require(\"myapp.app\")

Relevant Info:

From what I gather from the forums (this one specifically: https://github.com/thoughtbot/capybara-webkit/issues/849) the lack of QtWebKit: 5.5.1 support for es6 might be the issue. I have tried installing an older version of qt (qt-everywhere-opensource-src-5.4.2) but I am getting build errors, and even if it did work its not a long term solution to use a much older version.

Any assistance on this issue would be appreciated. Thank you

AlanFoster commented 6 years ago

@WillWylie-Modro Are you running your code through a transpiler such as a babel with polyfills turned on?