From 04c5d33f07e468b8799cd4f5a6e221ddbf187272 Mon Sep 17 00:00:00 2001 From: Yasuhito Takamiya Date: Tue, 4 Jun 2024 11:50:39 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/www/test/application_system_test_case.rb | 4 +++- apps/www/test/system/share_test.rb | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) 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