Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

React event not triggered [help] #895

Closed
wenderjean opened this issue Jun 1, 2017 · 2 comments
Closed

React event not triggered [help] #895

wenderjean opened this issue Jun 1, 2017 · 2 comments

Comments

@wenderjean
Copy link

hey guys,

I'm running a Rails project with Rspec, Capybara and Poltergeist and I'm currently fighting with a problem related to React components, I have a feature with a button managed by React with an onclick event that only render some content, running my tests against that feature with Poltergeist driver my tests fail once the click_on function doesn't trigger the action.

The curios thing is that I tried with chromedriver and selenium and both work well.

I'm running in an os x (sierra) and my project configuration is:

ruby: 2.2.4
rails: 4.2.6
phantomjs: 2.2.1

poltergeist: 1.10.0
react-rails: 1.8.0
Capybara.javascript_driver = :poltergeist

options = {
  timeout: 360,
  logger: nil,
  phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes']
}

Capybara.register_driver(:poltergeist) do |app|
  Capybara::Poltergeist::Driver.new app, options
end

We're writing modules using es6 transpiled by babel, and we don't have javascript errors in logs

@twalpole
Copy link
Contributor

twalpole commented Jun 1, 2017

Are you 100% all JS is getting transpiled to ES5 compatible? Unfortunately parse time errors for ES6 features like let can be silently swallowed by PhantomJS, so you end up with no errors but also with no JS being actually run.

@wenderjean
Copy link
Author

The problem: We were using Promise, js was getting transpiled well but phantomjs does not recognize Promise as well.

Thanks @twalpole

weedySeaDragon added a commit to weedySeaDragon/shf-project that referenced this issue Jun 26, 2017
teampoltergeist/poltergeist#895

 Unfortunately parse time errors for ES6 features like *let* can be silently swallowed by PhantomJS, so you end up with no errors but also with no JS being actually run.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants