Commit Graph

31 Commits

Author SHA1 Message Date
Javi Martín
3267c81ba0 Upgrade to Rails 5.2
All the code in the `bin/` and the `config/` folder has been generated
running `rake app:update`, except the `escape_javascript_fix` file,
which we've removed since the code there is already included in Rails
5.2.
2020-10-15 14:46:20 +02:00
Javi Martín
72c2b87227 Wait till CKEditor is ready before checking it
With chromedriver >= 80, the tests are freezing sometimes, particularly
when the same editor is loaded again.

We don't know whether it's a CKEditor issue or a chromedriver issue. In
the past we've had some errors related to CKEditor trying to load the
same instance twice and we aren't sure they have been fixed since we
could never reproduce them.

It could be a coincidence, though. If we modify the views so the only
content of the `<body>` tag is a textarea with the `html-area` class,
chromedriver freezes even if we only access the page once. So maybe
we're only detecting the problem on the second visit because the second
request is faster than the first one.

Since chromedriver no longer hangs after this change, we don't have to
force any chromedriver version anymore.
2020-06-09 13:29:56 +02:00
Javi Martín
2c4acb0bf7 Use chromedriver 2.38
The latest stable version is causing problems on some machines, hanging
forever in tests involving frames. So we're installing an old version
which works with the latest Chrome.

Note this means we're using an unsupported version. Officially, only the
latest chromedriver supports the latest Chrome.

We're using 2.38 instead of a more recent one (like 2.40) because it's
the one we specified in our Dockerfile.

See also:
https://bugs.chromium.org/p/chromedriver/issues/detail?id=3361
2020-05-25 15:50:36 +02:00
Javi Martín
7e702fc7ed Fix DB corruption in system tests after exceptions
This is a known bug in Rails, fixed in the Rails 5.2 and Rails 6.x
branches:

https://github.com/rails/rails/pull/32293/commits/5c4e1338
2020-04-24 15:43:54 +02:00
Javi Martín
9427f01442 Use system specs instead of feature specs
We get rid of database cleaner, and JavaScript tests are faster because
between tests we now rollback transactions instead of truncating the
database.
2020-04-24 15:43:54 +02:00
Julian Herrero
cb3a1f2860 Update chromeOptions for newer versions of chromedriver 2019-11-14 11:58:39 +07:00
Javier Martín
cb6539d170 Merge pull request #3537 from PierreMesure/set-locales-in-test-environment
Set locales in test environment to avoid failed specs
2019-09-11 18:43:03 +02:00
Pierre Mesure
7fc4106780 Cleaning a few lines 2019-09-08 22:39:01 +02:00
Javi Martín
8bb5462253 Use capybara-webmock to avoid external requests
The images from OpenStreetMap take a while to load, sometimes even
causing Net::ReadTimeout errors if the internet connection is slow. It's
happened a lot recently on Travis builds.

Using capybara-webmock we guarantee the test suite doesn't fail due to
network issues.
2019-09-07 13:09:05 +02:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javi Martín
ea9576096b Don't load tasks if they're already loaded
We were having problems under certain conditions with Travis and
Knapsack where tasks were still being loaded twice and so they were
being executed twice.
2018-11-30 17:28:59 +01:00
Javi Martín
1a5b73a0bd Don't load tasks several times in specs
Calling `load_tasks` in several files made rails load the tasks several
times, and so they were executed several times when called.

Since the milestone migration can't be executed twice in a row (it would
fail with duplicated ID records), loading the tasks several times made
the milestone migrations task specs fail.
2018-11-30 14:15:21 +01:00
Angel Perez
ff1fced609 Update Dockerfile to install Headless Chrome 2018-06-07 14:11:16 -04:00
Angel Perez
eb2926ab42 Fix failing scenario related to Headless Chrome window-size flag 2018-03-27 14:47:50 -04:00
Angel Perez
0bf4afe8bc Replace PhantomJS/Poltergeist config with Headless Chrome 2018-03-27 14:47:48 -04:00
rgarcia
7b7a426f6a Run Coveralls only in Travis CI
We were seeing a log message when running specs locally

```
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
```

As Coveralls is mainly used in Travis CI, we do not need to load it in
every spec run
2018-02-06 12:22:34 +01:00
Bertocq
1441de5107 Enable RSpec/HookArgument cop and fix issues
To be consistent about before/after arguments, as `:each` or `:example`
 are same and default scopes, best not to send an argument in those
 scenarios.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
2018-01-07 02:07:19 +01:00
Amaia Castro
551e8dc6c1 Increase Poltergeist timeout in specs
This is to try to avoid flaky js specs in Travis
2017-01-19 13:38:06 +01:00
Juanjo Bazán
4a888e95c2 disables js fx in specs via poltergeist config 2016-03-04 12:26:47 +01:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
kikito
eda47effc4 Configures tests to minimize flackyness
Reference: https://bibwild.wordpress.com/2016/02/18/struggling-towards-reliable-capybara-javascript-testing/

The only thing I did not do was removing the random order in the tests.
2016-02-24 11:37:07 +01:00
kikito
e3cbae4f02 Makes capybara exact. Should fix some randomly-failing specs 2015-09-02 18:05:43 +02:00
David Gil
de15bbe911 adds feature tests for sign up and sign using OAuth 2015-08-25 14:15:04 +02:00
rgarcia
c2091f570c integrates coveralls in test suite 2015-08-05 14:16:58 +02:00
Juanjo Bazán
9073037a45 makes test suite default to :en locale
ref: #38
2015-07-28 12:52:10 +02:00
kikito
be173ff581 removes use_transaction_fixtures from rails_helper
It is already configured in spec_helper.rb (and makes other things fail)
2015-07-27 19:07:02 +02:00
kikito
1e2f8704a5 Change order in requires to fix tests 2015-07-27 19:01:06 +02:00
rgarcia
0aaa8169f0 tmp commit [#21] 2015-07-27 11:12:55 +02:00
rgarcia
8f78509b0c adds basic devise feature specs 2015-07-17 19:53:19 +02:00
rgarcia
223eb06da2 configures capybara [#4] 2015-07-16 17:07:12 +02:00
rgarcia
4aa16e78c2 configure rspec 2015-07-15 13:59:26 +02:00