[ARVADOS] updated: 76ab57bbe5363cce5ecc2585f9ad5a4bcff21e0d
git at public.curoverse.com
git at public.curoverse.com
Tue Jan 6 17:49:15 EST 2015
Summary of changes:
.../test/integration/pipeline_instances_test.rb | 9 +++------
apps/workbench/test/integration_helper.rb | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 8 deletions(-)
via 76ab57bbe5363cce5ecc2585f9ad5a4bcff21e0d (commit)
from 33515b84b0689a984c812c8bc3c0cd663baf9b55 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 76ab57bbe5363cce5ecc2585f9ad5a4bcff21e0d
Author: Tom Clegg <tom at curoverse.com>
Date: Tue Jan 6 17:48:42 2015 -0500
3021: Wait for shown.bs.modal before trying to click butttons in the modal.
Remove a stray Headless.new.start.
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 52819e1..bab40cc 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -299,7 +299,9 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
# Now re-run the pipeline
if with_options
- find('a,button', text: 'Re-run options').click
+ assert_triggers_dom_event 'shown.bs.modal' do
+ find('a,button', text: 'Re-run options').click
+ end
within('.modal-dialog') do
page.assert_selector 'a,button', text: 'Copy and edit inputs'
page.assert_selector 'a,button', text: 'Run now'
@@ -313,11 +315,6 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
find('a,button', text: 'Re-run with latest').click
end
- # Wait for the dialog to close. (Otherwise, the next assertion
- # could fail while we're still looking at the source instance
- # page, even if the correct behavior is about to happen.)
- assert_no_selector 'body.modal-open'
-
# Verify that the newly created instance is created in the right
# project. In case of project_viewer user, since the user cannot
# write to the project, the pipeline should have been created in
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index 4c1d505..f430e84 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -12,8 +12,6 @@ Capybara.register_driver :poltergeist do |app|
}
end
-Headless.new.start
-
module WaitForAjax
Capybara.default_wait_time = 5
def wait_for_ajax
@@ -27,6 +25,22 @@ module WaitForAjax
end
end
+module AssertDomEvent
+ # Yield the supplied block, then wait for an event to arrive at a
+ # DOM element.
+ def assert_triggers_dom_event events, target='body'
+ magic = 'RXC0lObcVwEXwSvA'
+ page.evaluate_script <<eos
+ $('#{target}').one('#{events}', function() {
+ $('body').append('<div id="#{magic}"></div>');
+ });
+eos
+ yield
+ assert_selector "##{magic}"
+ page.evaluate_script "$('##{magic}').remove();";
+ end
+end
+
module HeadlessHelper
class HeadlessSingleton
def self.get
@@ -72,6 +86,7 @@ class ActionDispatch::IntegrationTest
include Capybara::DSL
include ApiFixtureLoader
include WaitForAjax
+ include AssertDomEvent
include HeadlessHelper
@@API_AUTHS = self.api_fixture('api_client_authorizations')
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list