Merge branch 'master' into 3408-production-datamanager
[arvados.git] / apps / workbench / test / performance / browsing_test.rb
1 # http://guides.rubyonrails.org/v3.2.13/performance_testing.html
2
3 require 'test_helper'
4 require 'rails/performance_test_help'
5 require 'performance_test_helper'
6 require 'selenium-webdriver'
7 require 'headless'
8
9 class BrowsingTest < WorkbenchPerformanceTest
10   self.profile_options = { :runs => 5,
11                            :metrics => [:wall_time],
12                            :output => 'tmp/performance',
13                            :formats => [:flat] }
14
15   setup do
16     need_javascript
17   end
18
19   test "home page" do
20     visit_page_with_token
21     assert_text 'Dashboard'
22     assert_selector 'a', text: 'Run a pipeline'
23   end
24
25   test "search for hash" do
26     visit_page_with_token
27     assert_text 'Dashboard'
28
29     assert_selector '.navbar-fixed-top'
30     assert_triggers_dom_event 'shown.bs.modal' do
31       within '.navbar-fixed-top' do
32         find_field('search').set 'hash'
33         find('.glyphicon-search').click
34       end
35     end
36
37     # In the search dialog now. Expect at least one item in the result display.
38     within '.modal-content' do
39       assert_text 'All projects'
40       assert_text 'Search'
41       assert_selector '.selectable[data-object-uuid]'
42       click_button 'Cancel'
43     end
44   end
45 end