diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-10-16 12:37:52 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-10-19 14:01:15 -0500 |
commit | 43377979c6cfee922702a5dc6324fded96b1f111 (patch) | |
tree | 8ac0061a979a611c9927e04815a1df5a71d2d505 /spec/support | |
parent | 96d8c7fff114911faa7d3e1b6322c2b9e3377e9b (diff) | |
download | gitlab-ce-43377979c6cfee922702a5dc6324fded96b1f111.tar.gz |
Check for element before evaluate_script
Tip from
https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara#directly-interacting-with-javascript
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/select2_helper.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb index 6b1853c2364..55da961e173 100644 --- a/spec/support/select2_helper.rb +++ b/spec/support/select2_helper.rb @@ -16,6 +16,7 @@ module Select2Helper selector = options.fetch(:from) + first(selector, visible: false) if options[:multiple] execute_script("$('#{selector}').select2('val', ['#{value}']).trigger('change');") else |