diff options
author | Nick Thomas <nick@gitlab.com> | 2019-01-26 03:39:28 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-01-28 14:20:54 +0300 |
commit | 654f7fe8ffbce488c11c38f46e2b2f3bea3b9fee (patch) | |
tree | 861426cfb440df96bd073646e63a8a68a02bf00d /spec/support | |
parent | 49c12f9b0fec9a0153f866a0f6f27ed5eb336bf0 (diff) |
Wait for requests in specs before interacting with select2
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/select2_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/support/helpers/select2_helper.rb b/spec/support/helpers/select2_helper.rb index 90618ba5b19..100e62489ab 100644 --- a/spec/support/helpers/select2_helper.rb +++ b/spec/support/helpers/select2_helper.rb @@ -11,9 +11,13 @@ # module Select2Helper + include WaitForRequests + def select2(value, options = {}) raise ArgumentError, 'options must be a Hash' unless options.is_a?(Hash) + wait_for_requests unless options[:async] + selector = options.fetch(:from) first(selector, visible: false) |