X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a59152e34814f453a7380e68a55534e2f8922d57..ae8ed6d9d0e5231379564beedc08c812352b7043:/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 3fea27b916..843aa3aed4 100644 --- a/apps/workbench/test/performance/browsing_test.rb +++ b/apps/workbench/test/performance/browsing_test.rb @@ -1,12 +1,45 @@ +# http://guides.rubyonrails.org/v3.2.13/performance_testing.html + require 'test_helper' require 'rails/performance_test_help' +require 'performance_test_helper' +require 'selenium-webdriver' +require 'headless' + +class BrowsingTest < WorkbenchPerformanceTest + self.profile_options = { :runs => 5, + :metrics => [:wall_time], + :output => 'tmp/performance', + :formats => [:flat] } + + setup do + need_javascript + end + + test "home page" do + visit_page_with_token + assert_text 'Dashboard' + assert_selector 'a', text: 'Run a pipeline' + end + + test "search for hash" do + visit_page_with_token + assert_text 'Dashboard' -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] } + 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 - def test_homepage - get '/' + # 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