Commit graph

12 commits

Author SHA1 Message Date
🙈 jacopo beschi 🙉
729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Mike Greiling
ed3b23fec9
refactor wait_for_requests, add slow_requests block helper 2017-11-02 16:36:36 -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
Stan Hu
fdf78bb9c7 Avoid including Capybara::DSL to conflict with definition of page 2017-06-15 19:54:09 -07:00
Stan Hu
806ffd2cec Don't include Capybara::DSL in the global scope 2017-06-15 18:33:44 -07:00
Stan Hu
aac1e8181c Wait for all Ajax and Vue requests to complete in JavaScript tests
From logs in #33756, we that it's possible for an Ajax call to be made
before the middleware receives it. To prevent stray Ajax calls from
breaking other specs, we need to wait for all scheduled calls to finish.

Closes #33756
2017-06-15 16:48:40 -07:00
Oswaldo Ferreira
2338785ec9 Use wait_for_requests to wait all JS request 2017-05-22 20:39:49 -03:00
Douwe Maan
718350dc9f Wait for requests after each Spinach scenario instead of feature 2017-05-12 17:10:12 -05:00
Fatih Acet
0151325dac Merge request widget redesign 2017-05-09 04:15:34 +00:00
Rémy Coutable
60a5273d7d
Wait for AJAX requests at the JS level in addition to wait for requests at the middleware level
Hopefully, this can solve transient failures such as
https://gitlab.com/gitlab-org/gitlab-ce/issues/29836.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-26 12:08:53 +02:00
Rémy Coutable
f879e40da7 Don't navigate to about:blank
This turned out to prevent the browser from clearing the local storage.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-22 19:45:21 +01:00
Rémy Coutable
645a55f19b Introduce a new middleware for the test environment that can block requests
The idea is that after each feature spec example, we block all incoming
requests at the Rack level, go to the 'about:blank' page, and wait until
the current requests reach 0.

This should solve the problem where a request would end after database
cleaner performed the database truncation. The problem was that a GET
request can still lead to records creation (e.g. namespaces or routes).

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-22 19:45:21 +01:00