Merge branch 'master' into 3052-crunch-log-stdout
[arvados.git] / apps / workbench / test / integration / user_agreements_test.rb
1 require 'integration_helper'
2 require 'selenium-webdriver'
3 require 'headless'
4
5 class UserAgreementsTest < ActionDispatch::IntegrationTest
6
7   setup do
8     Capybara.current_driver = Capybara.javascript_driver
9   end
10
11   def continuebutton_selector
12     'input[type=submit][disabled][value=Continue]'
13   end
14
15   test "cannot click continue without ticking checkbox" do
16     visit page_with_token('inactive')
17     assert_selector continuebutton_selector
18   end
19
20   test "continue button is enabled after ticking checkbox" do
21     visit page_with_token('inactive')
22     assert_selector continuebutton_selector
23     find('input[type=checkbox]').click
24     assert_no_selector continuebutton_selector
25     assert_nil(find_button('Continue')[:disabled],
26                'Continue button did not become enabled')
27   end
28
29 end