Merge branch '11917-dont-clear-cache'
[arvados.git] / apps / workbench / test / integration / application_layout_test.rb
index 8e81c7c0d887179d6868cb1f8c58fd9ea6255f4f..7692d8e5dc1b0df9a50c1dae8d258eb298e36e33 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 require 'integration_helper'
 
 class ApplicationLayoutTest < ActionDispatch::IntegrationTest
@@ -52,7 +56,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
 
             assert_selector "a[href=\"/projects/#{user['uuid']}\"]", text: 'Home project'
             assert_selector "a[href=\"/users/#{user['uuid']}/virtual_machines\"]", text: 'Virtual machines'
-            assert_selector "a[href=\"/users/#{user['uuid']}/repositories\"]", text: 'Repositories'
+            assert_selector "a[href=\"/repositories\"]", text: 'Repositories'
             assert_selector "a[href=\"/current_token\"]", text: 'Current token'
             assert_selector "a[href=\"/users/#{user['uuid']}/ssh_keys\"]", text: 'SSH keys'
 
@@ -210,7 +214,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
   end
 
    [
-    ['Repositories', nil, 's0uqq'],
+    ['Repositories', nil, 'active/crunchdispatchtest'],
     ['Virtual machines', nil, 'testvm.shell'],
     ['SSH keys', nil, 'public_key'],
     ['Links', nil, 'link_class'],
@@ -251,15 +255,26 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
 
       assert_text 'Recent pipelines and processes' # seeing dashboard now
       within('.recent-processes-actions') do
-        assert page.has_link?('Run a pipeline')
-        assert page.has_link?('All pipelines')
+        assert page.has_link?('Run a process')
+        assert page.has_link?('All processes')
       end
 
       within('.recent-processes') do
-        assert_text 'zzzzz-d1hrv-partdonepipelin'
+        assert_text 'running'
+
+        within('.row-zzzzz-xvhdp-cr4runningcntnr') do
+          assert_text 'requester_for_running_cr'
+        end
+
         assert_text 'zzzzz-d1hrv-twodonepipeline'
-        assert_text 'zzzzz-dz642-runningcontainr'
-        assert_text 'zzzzz-dz642-runningcontain2'
+        within('.row-zzzzz-d1hrv-twodonepipeline')do
+          assert_text 'No output'
+        end
+
+        assert_text 'completed container request'
+        within('.row-zzzzz-xvhdp-cr4completedctr')do
+          assert page.has_link? 'foo_file'
+        end
       end
 
       within('.compute-node-actions') do
@@ -268,7 +283,6 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
         else
           assert page.has_no_link?('All nodes')
         end
-        assert page.has_link? 'All jobs'
       end
 
       within('.compute-node-summary-pane') do
@@ -277,53 +291,4 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       end
     end
   end
-
-  [
-    ['jobs', 'running_job_with_components', true],
-    ['pipeline_instances', 'components_is_jobspec', false],
-    ['containers', 'running', false],
-    ['container_requests', 'running', true],
-  ].each do |type, fixture, cancelable|
-    test "cancel button for #{type}/#{fixture}" do
-      if cancelable
-        need_selenium 'to cancel'
-      end
-
-      obj = api_fixture(type)[fixture]
-      visit page_with_token "active", "/#{type}/#{obj['uuid']}"
-
-      assert_text 'created_at'
-      if cancelable
-        assert page.has_button?('Cancel'), 'No Cancel button'
-        click_button 'Cancel'
-        wait_for_ajax
-        assert page.has_no_button?('Cancel'), 'Cancel button not expected after clicking'
-      else
-        assert page.has_no_button?('Cancel'), 'Cancel button not expected'
-      end
-    end
-  end
-
-  [
-    ['jobs', 'running_job_with_components'],
-    ['pipeline_instances', 'has_component_with_completed_jobs'],
-    ['container_requests', 'running'],
-    ['container_requests', 'completed'],
-  ].each do |type, fixture|
-    test "edit description for #{type}/#{fixture}" do
-      obj = api_fixture(type)[fixture]
-      visit page_with_token "active", "/#{type}/#{obj['uuid']}"
-
-      within('.arv-description-as-subtitle') do
-        find('.fa-pencil').click
-        find('.editable-input textarea').set('*Textile description for object*')
-        find('.editable-submit').click
-      end
-      wait_for_ajax
-
-      # verify description
-      assert page.has_no_text? '*Textile description for object*'
-      assert page.has_text? 'Textile description for object'
-    end
-  end
 end