From 43377979c6cfee922702a5dc6324fded96b1f111 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 16 Oct 2017 12:37:52 -0500 Subject: Check for element before evaluate_script Tip from https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara#directly-interacting-with-javascript --- spec/features/ci_lint_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/features/ci_lint_spec.rb') diff --git a/spec/features/ci_lint_spec.rb b/spec/features/ci_lint_spec.rb index 9accd7bb07c..9bc23baf6cf 100644 --- a/spec/features/ci_lint_spec.rb +++ b/spec/features/ci_lint_spec.rb @@ -10,6 +10,7 @@ describe 'CI Lint', :js do visit ci_lint_path # Ace editor updates a hidden textarea and it happens asynchronously # `sleep 0.1` is actually needed here because of this + find('#ci-editor') execute_script("ace.edit('ci-editor').setValue(" + yaml_content.to_json + ");") sleep 0.1 click_on 'Validate' -- cgit v1.2.3