Commit graph

19 commits

Author SHA1 Message Date
Rémy Coutable
60797a42b4 Ensure Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-28 16:33:30 +02:00
Douwe Maan
af5bf71365 Don't reset the session when the example failed, because we need capybara-screenshot to have access to it 2017-06-21 21:38:16 -05:00
Rémy Coutable
abc5d1d0a5
Call Capybara.reset_sessions! before block_and_wait_for_requests_complete
capybara/rspec already calls Capybara.reset_sessions! in an
`after` hook, but `block_and_wait_for_requests_complete` is called
before it so by calling it explicitely here, we prevent any new
requests from being fired.
See
ffb41cfad6/lib/capybara/rspec.rb (L20-L25)

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-16 17:23:49 +02:00
Rémy Coutable
448fc23e47
Let PhantomJS load local images
This change fix a memory leak due to a Webkit bug:
https://github.com/ariya/phantomjs/issues/12903

Also:

- Whitelist only localhost and 127.0.0.1 in Capybara + JS specs
- Blacklist all requests to media such as images, videos, PDFs, CSVs etc.
- Log all the requests made.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-12 19:00:03 +02:00
Rémy Coutable
2fa5607448
Properly eagerly-load the Capybara server for JS feature specs only
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-31 14:43:36 +02:00
Rémy Coutable
f659c406ab Eager-load the Capybara server to prevent timeouts
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-31 11:43:17 +02:00
Rémy Coutable
e559283cc0 Increase Capybara's timeout
Also disabled assets warming for Capybara/RSpec and remove a check to
skip assets warming when ./tmp/cache/assets/test exists because assets
are now served by webpack-dev-server.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-31 11:43:17 +02:00
Kamil Trzciński
b8a54fc002 Merge branch 'rs-capybara-screenshot-artifacts' into 'master'
Store capybara screenshots as build artifacts

Closes #13971

See merge request !7985
2017-03-14 15:43:53 +00:00
Robert Speicher
460c2d1c51 Decrease Capybara timeout for CI environment 2017-03-08 12:50:19 -05:00
Robert Speicher
a61c197781 Don't disable capybara-screenshot in CI environment 2016-12-08 16:46:25 +11:00
Robert Speicher
1e66f35c56 Pass --load-images=no to PhantomJS via Capybara/Poltergeist
We were unintentionally hitting `gravatar.com` whenever a test that used
Poltergeist was run. This was certainly wasting their resources and
slowing down our tests even further, for no reason.
2016-11-28 16:50:08 +08:00
Stan Hu
7c61bdcf6f Fix Capybara 2.6.2 deprecation warnings 2016-03-15 11:03:17 -07:00
Alfredo Sumaran
78bf02e93d Set window_size to 1366*768 2016-02-23 15:29:55 -05:00
Robert Speicher
bbe0fa91d0 Prevent transient Capybara timeouts during feature tests
The problem occurred because asset compilation takes a long time, so
when the asset cache didn't exist and the first test ran, it would often
(randomly) time out during the generation before the actual test even
had a chance to run.

Now we check if the cache exists before the suite runs, and if not, we
manually fire a request to the root URL in order to generate it. This
should allow subsequent tests to use the cached assets.
2016-01-28 20:56:49 -05:00
Robert Speicher
da135119aa Move CapybaraHelpers to its own support file
In case we end up wanting to use it in Spinach as well.
2015-06-22 12:13:47 +02:00
Robert Speicher
b00f447db4 Add allowing_for_delay helper method for feature specs 2015-06-14 20:33:29 -04:00
Robert Speicher
652c15b585 Don't use capybara-screenshot in CI environments 2015-04-25 21:33:17 -04:00
Robert Speicher
3875930793 Enable js_errors for Capybara in Spinach and RSpec 2015-04-25 21:33:16 -04:00
Robert Speicher
86edfce442 Move RSpec setup for Capybara to its own support file 2015-04-25 21:33:16 -04:00