From: Lucas Di Pentima Date: Thu, 22 Sep 2016 15:31:23 +0000 (-0300) Subject: 10037: Test enhancement to check for other statuses on the dashboard, also adding... X-Git-Tag: 1.1.0~716^2~2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/8db021c5f87e21c18debc8093d83823f62131750?ds=sidebyside 10037: Test enhancement to check for other statuses on the dashboard, also adding pipeline instances on those checks. --- diff --git a/apps/workbench/test/controllers/projects_controller_test.rb b/apps/workbench/test/controllers/projects_controller_test.rb index 7848444efd..741fa7afe1 100644 --- a/apps/workbench/test/controllers/projects_controller_test.rb +++ b/apps/workbench/test/controllers/projects_controller_test.rb @@ -410,18 +410,55 @@ class ProjectsControllerTest < ActionController::TestCase end end - test "in dashboard the progress bar should only show on running containers" do + test "dashboard should show the correct status for containers and processes" do get :index, {}, session_for(:active) assert_select 'div.panel-body.recent-processes' do [ - ['completed', false], - ['uncommitted', false], - ['queued', false], - ['running', true], - ].each do |cr_state, should_show| - uuid = api_fixture('container_requests')[cr_state]['uuid'] + { + fixture: 'container_requests', + state: 'completed', + selectors: [['div.progress', false], + ['span.label.label-success', true, 'Complete']] + }, + { + fixture: 'container_requests', + state: 'uncommitted', + selectors: [['div.progress', false], + ['span.label.label-default', true, 'Uncommitted']] + }, + { + fixture: 'container_requests', + state: 'queued', + selectors: [['div.progress', false], + ['span.label.label-default', true, 'Queued']] + }, + { + fixture: 'container_requests', + state: 'running', + selectors: [['div.progress', true]] + }, + { + fixture: 'pipeline_instances', + state: 'new_pipeline', + selectors: [['div.progress', false], + ['span.label.label-default', true, 'Not started']] + }, + { + fixture: 'pipeline_instances', + state: 'pipeline_in_running_state', + selectors: [['div.progress', true]] + }, + ].each do |c| + uuid = api_fixture(c[:fixture])[c[:state]]['uuid'] assert_select "div.dashboard-panel-info-row.row-#{uuid}" do - assert_select 'div.progress', should_show + if c.include? :selectors + c[:selectors].each do |selector, should_show, label| + assert_select selector, should_show, "UUID #{uuid} should #{should_show ? '' : 'not'} show '#{selector}'" + if should_show and not label.nil? + assert_select selector, label, "UUID #{uuid} state label should show #{label}" + end + end + end end end end