diff --git a/apps/www/test/application_system_test_case.rb b/apps/www/test/application_system_test_case.rb index 47b3d6b95..b09863090 100644 --- a/apps/www/test/application_system_test_case.rb +++ b/apps/www/test/application_system_test_case.rb @@ -7,7 +7,9 @@ # rubocop:disable Metrics/ClassLength class ApplicationSystemTestCase < ActionDispatch::SystemTestCase - driven_by :selenium_chrome_headless + driven_by(:selenium, using: :headless_chrome) do |driver_option| + driver_option.add_argument('--headless=new') + end def assert_steps(number) assert_selector 'circuit-step:not([data-shadow])', count: number diff --git a/apps/www/test/system/share_test.rb b/apps/www/test/system/share_test.rb index 0a09d641e..27005e76f 100644 --- a/apps/www/test/system/share_test.rb +++ b/apps/www/test/system/share_test.rb @@ -65,7 +65,10 @@ class ShareTest < ApplicationSystemTestCase assert_equal 2, windows.size within_window windows[1] do json = URI.encode_www_form_component('{"cols":[]}') - assert_equal "https://twitter.com/share?hashtags=qni&url=#{current_session_base_url}/#{json}", CGI.unescape(current_url) + url = CGI.unescape(current_url) + expected_url = "https://x.com/share?hashtags=qni&url=#{current_session_base_url}/#{json}" + + assert expected_url.include?(expected_url), "Expected '#{url}' to include '#{expected_url}'" end end @@ -79,7 +82,10 @@ class ShareTest < ApplicationSystemTestCase within_window windows[1] do json = URI.encode_www_form_component('{"cols":[],"title":"Grover反復"}') - assert_equal "https://twitter.com/share?text=Grover反復&hashtags=qni&url=#{current_session_base_url}/#{json}", CGI.unescape(current_url) + url = CGI.unescape(current_url) + expected_url = "https://x.com/share?text=Grover反復&hashtags=qni&url=#{current_session_base_url}/#{json}" + + assert expected_url.include?(expected_url), "Expected '#{url}' to include '#{expected_url}'" end end end