8784: Fix test for latest firefox.
[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 process'
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     sleep(50)
38
39     # In the search dialog now. Expect at least one item in the result display.
40     within '.modal-content' do
41       assert_text 'All projects'
42       assert_text 'Search'
43       assert_selector '.selectable[data-object-uuid]'
44       click_button 'Cancel'
45     end
46   end
47 end