Remove cruft. No issue #
[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     headless = Headless.new
17     headless.start
18     Capybara.current_driver = :selenium
19     Capybara.current_session.driver.browser.manage.window.resize_to(1024, 768)
20   end
21
22   test "home page" do
23     visit_page_with_token
24     wait_for_ajax
25     assert_text 'Dashboard'
26     assert_selector 'a', text: 'Run a pipeline'
27   end
28
29   test "search for hash" do
30     visit_page_with_token
31     wait_for_ajax
32     assert_text 'Dashboard'
33
34     within('.navbar-fixed-top') do
35       page.find_field('search').set('hash')
36       wait_for_ajax
37       page.find('.glyphicon-search').click
38     end
39
40     # In the search dialog now. Expect at least one item in the result display.
41     within '.modal-content' do
42       wait_for_ajax
43       assert_text 'All projects'
44       assert_text 'Search'
45       assert(page.has_selector?(".selectable[data-object-uuid]"))
46       click_button 'Cancel'
47     end
48   end
49 end