X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5defe6cc7e4a0abdd12d92806b2790f7f485dda6..43a6204d0292fc4a41c370a2b77a84bc778fbdae:/apps/workbench/test/performance/browsing_test.rb diff --git a/apps/workbench/test/performance/browsing_test.rb b/apps/workbench/test/performance/browsing_test.rb index 27b55c4268..dcfd7d86e0 100644 --- a/apps/workbench/test/performance/browsing_test.rb +++ b/apps/workbench/test/performance/browsing_test.rb @@ -2,30 +2,46 @@ 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] } setup do - headless = Headless.new - headless.start - Capybara.current_driver = :selenium - Capybara.current_session.driver.browser.manage.window.resize_to(1024, 768) + need_javascript + end + + test "home page" do + visit_page_with_token + assert_text 'Dashboard' + assert_selector 'a', text: 'Run a process' end - def test_homepage - visit page_with_token('active') + test "search for hash" do + visit_page_with_token assert_text 'Dashboard' - assert_selector 'a', text: 'Run a pipeline' + + assert_selector '.navbar-fixed-top' + assert_triggers_dom_event 'shown.bs.modal' do + within '.navbar-fixed-top' do + find_field('search').set 'hash' + find('.glyphicon-search').click + end + end + + sleep(50) + + # In the search dialog now. Expect at least one item in the result display. + within '.modal-content' do + assert_text 'All projects' + assert_text 'Search' + assert_selector '.selectable[data-object-uuid]' + click_button 'Cancel' + end end end