Add 'apps/arv-web/' from commit 'f9732ad8460d013c2f28363655d0d1b91894dca5'
[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     wait_for_ajax
22     assert_text 'Dashboard'
23     assert_selector 'a', text: 'Run a pipeline'
24   end
25
26   test "search for hash" do
27     visit_page_with_token
28     wait_for_ajax
29     assert_text 'Dashboard'
30
31     within('.navbar-fixed-top') do
32       page.find_field('search').set('hash')
33       wait_for_ajax
34       page.find('.glyphicon-search').click
35     end
36
37     # In the search dialog now. Expect at least one item in the result display.
38     within '.modal-content' do
39       wait_for_ajax
40       assert_text 'All projects'
41       assert_text 'Search'
42       assert(page.has_selector?(".selectable[data-object-uuid]"))
43       click_button 'Cancel'
44     end
45   end
46 end