Merge branch '4523-owner_uuid-index' refs #4523
[arvados.git] / apps / workbench / test / performance / browsing_test.rb
index 27b55c4268e05b11f013a8c94acd73e05762afce..ec299e295528b6c35632fa39d6119435dc9059a6 100644 (file)
@@ -2,16 +2,12 @@
 
 require 'test_helper'
 require 'rails/performance_test_help'
-require 'integration_helper'
+require 'performance_test_helper'
 require 'selenium-webdriver'
 require 'headless'
 
-class BrowsingTest < ActionDispatch::PerformanceTest
-  # Refer to the documentation for all available options
-  # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
-  #                          :output => 'tmp/performance', :formats => [:flat] }
-
-  self.profile_options = { :runs => 10,
+class BrowsingTest < WorkbenchPerformanceTest
+  self.profile_options = { :runs => 5,
                            :metrics => [:wall_time],
                            :output => 'tmp/performance',
                            :formats => [:flat] }
@@ -23,9 +19,31 @@ class BrowsingTest < ActionDispatch::PerformanceTest
     Capybara.current_session.driver.browser.manage.window.resize_to(1024, 768)
   end
 
-  def test_homepage
-    visit page_with_token('active')
+  test "home page" do
+    visit_page_with_token
+    wait_for_ajax
     assert_text 'Dashboard'
     assert_selector 'a', text: 'Run a pipeline'
   end
+
+  test "search for hash" do
+    visit_page_with_token
+    wait_for_ajax
+    assert_text 'Dashboard'
+
+    within('.navbar-fixed-top') do
+      page.find_field('search').set('hash')
+      wait_for_ajax
+      page.find('.glyphicon-search').click
+    end
+
+    # In the search dialog now. Expect at least one item in the result display.
+    within '.modal-content' do
+      wait_for_ajax
+      assert_text 'All projects'
+      assert_text 'Search'
+      assert(page.has_selector?(".selectable[data-object-uuid]"))
+      click_button 'Cancel'
+    end
+  end
 end