diff --git a/config/environments/test.rb b/config/environments/test.rb index 7d008cd214..f886d4ada1 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -62,6 +62,9 @@ # config.action_view.annotate_rendered_view_with_filenames = true config.i18n.enforce_available_locales = false + + # Add config/routes_test.rb to routes + config.paths['config/routes.rb'] << Rails.root.join('config/routes_test.rb') end # Used by Rails' routes url_helpers (typically when including a link in an email) diff --git a/config/routes_test.rb b/config/routes_test.rb new file mode 100644 index 0000000000..90555516a2 --- /dev/null +++ b/config/routes_test.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +Rails.application.routes.draw do + # Define your test-specific routes here + + # This route will return an empty response with a 200 OK status code + # when the browser requests the favicon.ico file. + get '/favicon.ico', to: proc { |_env| [200, {}, ['']] } +end diff --git a/spec/features/super_admins/merge_org_spec.rb b/spec/features/super_admins/merge_org_spec.rb index 3e8338655a..29c682f410 100644 --- a/spec/features/super_admins/merge_org_spec.rb +++ b/spec/features/super_admins/merge_org_spec.rb @@ -45,7 +45,16 @@ expect(page).to have_text('Merge Organisations') choose_suggestion('org_org_name', @to_org) - click_button 'Analyze' + # rubocop:disable Layout/LineLength + # Using JS to click on button as click_button 'Analyze' fails due to error like + # Selenium::WebDriver::Error::ElementClickInterceptedError: element click intercepted: + # Element is not clickable at point (86, 349). + # Other element would receive the click:
...
+ # So replacing click_button 'Analyze'with + # rubocop:enable Layout/LineLength + analyze_button = find('button', text: 'Analyze') + execute_script('arguments[0].click();', analyze_button) + # Wait for response sleep(0.3) expect(page).to have_text('Summary:') diff --git a/spec/features/templates/templates_upgrade_customisations_spec.rb b/spec/features/templates/templates_upgrade_customisations_spec.rb index 715691b69c..0fd0121689 100644 --- a/spec/features/templates/templates_upgrade_customisations_spec.rb +++ b/spec/features/templates/templates_upgrade_customisations_spec.rb @@ -52,7 +52,16 @@ # Move to the other funder Org's Templates choose_suggestion('superadmin_user_org_name', funder) - click_button('Change affiliation') + + # rubocop:disable Layout/LineLength + # Using JS to click as click_button "Change affiliation" fails due to error like + # Selenium::WebDriver::Error::ElementClickInterceptedError: element click intercepted: + # Element + # is not clickable at point (101, 203). Other element would receive the click:
...
+ # So replacing click_button('Change affiliation') + # rubocop:enable Layout/LineLength + change_affiliation_input_button = find('input[value="Change affiliation"]') + execute_script('arguments[0].click();', change_affiliation_input_button) # Edit the original Template click_link "#{funder.name} Templates"