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