1 # frozen_string_literal: true
5 ENV.delete("http_proxy")
7 ActiveSupport.on_load(:action_dispatch_system_test_case) do
8 ActionDispatch::SystemTesting::Server.silence_puma = true
11 class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
12 include ActionMailer::TestCase::ClearTestDeliveries
14 Capybara.configure do |config|
15 config.enable_aria_label = true
17 if ENV["CAPYBARA_SERVER_PORT"]
18 served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"]
20 driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ], options: {
22 url: "http://#{ENV["SELENIUM_HOST"]}:4444"
25 driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
27 options.add_preference("intl.accept_languages", "en")
28 options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary
33 osm_website_app = create(:oauth_application, :name => "OpenStreetMap Web Site", :scopes => "write_api write_notes")
34 Settings.oauth_application = osm_website_app.uid
46 within "form", :text => "Email Address or Username" do
47 fill_in "username", :with => user.email
48 fill_in "password", :with => "s3cr3t"
55 click_on "Logout", :match => :first
59 within("#sidebar_content", &)
62 def within_content_body(&)
63 within("#content > .content-body", &)
66 def within_content_heading(&)
67 within("#content > .content-heading", &)