Skip to content

Commit

Permalink
travis runs poltergeist_errors_ok
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 committed Nov 25, 2016
1 parent fa19c23 commit 63cbdda
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ before_script:

script:
- bundle exec rake db:schema:load
- bundle exec rake
- DRIVER=poltergeist_errors_ok bundle exec rake
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ See package.json and Gemfile for versions

## Javascript development without Rails: using the Webpack Dev Server

We include a sample setup for developing your JavaScript files without Rails. However, this is no longer recommended as it's best to create your APIs in Rails, and take advantage of the hot reloading of your react components provided by this project.

1. Run the node server with file `server-express.js` with command `npm run` or `cd client && node server-express.js`.
2. Point your browser to [http://localhost:4000](http://localhost:4000)

Expand Down Expand Up @@ -141,6 +143,9 @@ Save a change to a JSX file and see it update immediately in the browser! Note,
<%= env_javascript_include_tag(static: 'application_static', hot: 'application_non_webpack', options: { 'data-turbolinks-track' => true }) %>
```

## Testing

+ Be sure to see [Integration Test Notes](./docs/integration-test-notes.md) for advice on running your integration tests.

+ **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`
line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.
Expand Down
34 changes: 34 additions & 0 deletions docs/integration-test-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Integration Test Notes


## Driver Options
The current default driver is selenium chrome.

Support is included for the following drivers:

1. Selenium Chrome (`DRIVER=selenium_chrome rspec`)
1. Selenium Firefox (`DRIVER=selenium_firefox rspec`)
1. Poltergeist (`DRIVER=poltergeist rspec`)
1. Poltergeist no animations (`DRIVER=poltergeist_no_animations rspec`)
1. Poltergeist errors ok (`DRIVER=poltergeist_errors_ok rspec`)

You may want to experiment with using the different drivers.

## Rspec-retry
* The current retry count is 4, configured in spec_helper.rb.
* When developing new tests, you do not want retry a failure multiple times.
* Set this env value: `export RSPEC_RETRY_RETRY_COUNT=1`

## Selenium Chrome

You may want to see the [chromedriver-helper docs](https://github.com/flavorjones/chromedriver-helper) and run chromedriver-update to get the latest version of the Chrome driver.


## Poltergeist

Poltergeist is awesome because it will crash on JS Errors. Poltergeist is not aswesome because phantomjs is currently having race conditions on crashing a lot.

### 2016-11-25
Polteregeist is consistently crashing due to [issue 830](https://github.com/teampoltergeist/poltergeist/issues/830) and [issue 232](https://github.com/teampoltergeist/poltergeist/issues/232). Hopefully, this will be fixed in the future.

`support/poltergeist.rb:34` contains code to restart phantomjs with the hopes that this will cause a failing test to pass.

0 comments on commit 63cbdda

Please sign in to comment.