4227: much simplified date display test
[arvados.git] / apps / workbench / test / integration / projects_test.rb
index 11895acfdd0efc5ee514b24ca2495f50c57ef0b7..a6e8ec4101089f75e4ee89853da29b59ed00e6c3 100644 (file)
@@ -182,7 +182,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     find('#project_sharing').all('tr')
   end
 
-  def add_share_and_check(share_type, name)
+  def add_share_and_check(share_type, name, obj=nil)
     assert(page.has_no_text?(name), "project is already shared with #{name}")
     start_share_count = share_rows.size
     click_on("Share with #{share_type}")
@@ -194,6 +194,9 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       find(".selectable", text: name).click
       assert(has_no_selector?(".modal-dialog-preview-pane"),
              "preview pane available in sharing dialog")
+      if share_type == 'users' and obj and obj['email']
+        assert(page.has_text?(obj['email']), "Did not find user's email")
+      end
       assert_raises(Capybara::ElementNotFound,
                     "Projects pulldown available from sharing dialog") do
         click_on "All projects"
@@ -240,7 +243,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     show_project_using("active")
     click_on "Sharing"
-    add_share_and_check("users", new_name)
+    add_share_and_check("users", new_name, add_user)
     modify_share_and_check(new_name)
   end
 
@@ -490,6 +493,10 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     ['project with 201 collections', 201], # two pages of data
   ].each do |project_name, amount|
     test "scroll collections tab for #{project_name} with #{amount} objects" do
+      headless = Headless.new
+      headless.start
+      Capybara.current_driver = :selenium
+
       visit page_with_token 'user1_with_load'
 
       find("#projects-menu").click
@@ -542,17 +549,21 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
   [
     ['project with 10 pipelines', 10, 0],
-    ['project with 10 jobs and 10 pipelines', 10, 10],
-    ['project with 25 pipelines', 25, 0],   # 20 is the page limit for this tab; hence two pages
+    ['project with 2 pipelines and 200 jobs', 2, 200],
+    ['project with 25 pipelines', 25, 0],
   ].each do |project_name, num_pipelines, num_jobs|
     test "scroll pipeline instances tab for #{project_name} with #{num_pipelines} pipelines and #{num_jobs} jobs" do
+      headless = Headless.new
+      headless.start
+      Capybara.current_driver = :selenium
+
       visit page_with_token 'user1_with_load'
 
       find("#projects-menu").click
       find(".dropdown-menu a", text: project_name).click
 
       my_pipelines = []
-      (1..num_pipelines).each do |i|
+      (0..num_pipelines-1).each do |i|
         name = "pipeline_#{i}"
         my_pipelines << name
       end
@@ -569,7 +580,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       unexpected_items = []
       object_count = 0
       within('.arv-project-Jobs_and_pipelines') do
-        page.execute_script "window.scrollBy(0,99999999)"
+        page.execute_script "window.scrollBy(0,999000)"
         begin
           wait_for_ajax
         rescue