Skip to content

日本語のテスト名を英語に変更#8878

Merged
komagata merged 3 commits intomainfrom
chore/fix-japanese-test-title
Oct 1, 2025
Merged

日本語のテスト名を英語に変更#8878
komagata merged 3 commits intomainfrom
chore/fix-japanese-test-title

Conversation

@karlley
Copy link
Copy Markdown
Contributor

@karlley karlley commented Jul 2, 2025

Issue

概要

日本語のテスト名を英語に変更

変更確認方法

  1. chore/fix-japanese-test-titleをローカルに取り込む
  2. test/system/notification/reports_test.rb 内の以下のテスト名が英語になっていることを確認
126:  test '複数の日報が投稿されているときは通知が飛ばない' do
183:  test '研修生が日報を作成し提出した時、企業のアドバイザーに通知する' do
200:  test '初めて提出した時だけ、フォローされているユーザーに通知する' do
218:  test '初めて提出した時だけ、メンション通知する' do
232:  test '初日報は初めて公開した時だけ通知する' do
  1. 以下のコマンドでテストが全てパスすることを確認
bin/rails test test/system/notification/reports_test.rb:126
bin/rails test test/system/notification/reports_test.rb:183
bin/rails test test/system/notification/reports_test.rb:200
bin/rails test test/system/notification/reports_test.rb:218
bin/rails test test/system/notification/reports_test.rb:232

Summary by CodeRabbit

  • Tests
    • テスト名を日本語から英語に翻訳しました(テスト内容は変更なし)。
    • メンション対象の一部を kimura→komagata に変更しました(振る舞いは維持)。
    • ログイン後やダッシュボード、通知、日報作成・編集画面の表示確認を追加しました。
    • 日報作成完了を待つ仕組みと通知の未読チェックの待機方法を改善しました。
    • 日報関連テストを支援する待機ヘルパーを追加・調整しました。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 2, 2025

Walkthrough

システムテストの日本語テスト名が英語に置換され、メンション対象ログイン名が1箇所変更されました。テスト支援ヘルパー群にページ表示の明示的アサーションと待機ロジック(通知ページヘッダー待ち、ボタン待ち、レポート作成完了待ち)が追加されました。既存の公開API署名は一部メソッドで微調整されましたが、通知本体の実装変更はありません。

Changes

Cohort / File(s) Change Summary
Notification Reports Test
test/system/notification/reports_test.rb
日本語テスト名を英語表記へリネーム。メンション対象のログイン名を kimurakomagata に変更。テスト本体ロジックはほぼ不変。
Login Helper
test/supports/login_helper.rb
ログインページ訪問後に <h1.auth-form__title>「ログイン」をアサート。ログイン送信後は3秒以内に <h2.page-header__title>「ダッシュボード」または再表示された <h1.auth-form__title>「ログイン」を待つアサーションを追加。
Notification Helper
test/supports/notification_helper.rb
一律の sleep を廃止し、通知ページ到達を <h2.page-header__title>「通知」出現で同期。通知メッセージ検出に最大5秒の待機を導入。メソッド署名は不変。
Report Helper
test/supports/report_helper.rb
create_report が作成前の件数取得と「日報作成」ヘッダー表示アサート、作成完了待ちを行うよう変更。update_report が「日報編集」ヘッダー表示アサートと提出ボタン検出に最大3秒の待機を導入。wait_for_report_created(before_count, timeout: 5) を追加。メソッド実装に待機ロジックが追加。

Sequence Diagram(s)

sequenceDiagram
    participant Test as SystemTest
    participant Helper as ReportHelper / NotificationHelper / LoginHelper
    participant Browser as Browser/Page
    Test->>Helper: 呼び出し (例: create_report / exists_unread_notification / login_user)
    Helper->>Browser: visit ページ
    Browser-->>Helper: ページレンダリング
    Helper->>Browser: assert ヘッダー要素待機 (例: 日報作成 / 通知 / ログイン)
    alt 要素出現
        Browser-->>Helper: 要素存在
        Helper->>Helper: 必要に応じて wait/poll (Report.count 等)
        Helper-->>Test: 成功/戻り値
    else タイムアウト
        Browser-->>Helper: 要素未検出
        Helper-->>Test: 失敗 (テストアサーション)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related issues

Suggested reviewers

  • matuaya
  • komagata

Poem

うさぎが跳ねるテストの庭、
名を変えても中身はそのまま、
見出しを待ち、数を確かめ、
小さな待機が安心を運ぶ。
ピョンと祝おう、この一行の変更。 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 RuboCop (1.76.1)
test/system/notification/reports_test.rb

rubocop-minitest extension supports plugin, specify plugins: rubocop-minitest instead of require: rubocop-minitest in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
rubocop-capybara extension supports plugin, specify plugins: rubocop-capybara instead of require: rubocop-capybara in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
Unable to find gem rubocop-fjord; is the gem installed? Gem::MissingSpecError
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:309:in rescue in gem_config_path' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:293:in gem_config_path'
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:84:in block (2 levels) in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:82:in reverse_each'
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:82:in block in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:76:in each_pair'
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader_resolver.rb:76:in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_loader.rb:58:in load_file'
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/config_store.rb:29:in options_config=' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/cli.rb:162:in act_on_options'
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/cli.rb:47:in block in run' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/cli.rb:82:in profile_if_needed'
/var/lib/gems/3.1.0/gems/rubocop-1.79.2/lib/rubocop/cli.rb:43:in run' /var/lib/gems/3.1.0/gems/rubocop-1.79.2/exe/rubocop:19:in <top (required)>'
/usr/local/bin/rubocop:25:in load' /usr/local/bin/rubocop:25:in

'

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c91edf4 and c129dde.

📒 Files selected for processing (1)
  • test/system/notification/reports_test.rb (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/system/notification/reports_test.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build_and_test
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix-japanese-test-title

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@karlley karlley self-assigned this Jul 4, 2025
@karlley karlley changed the title テスト名が日本語のため英語のテスト名に変更 日本語のテスト名を英語に変更 Jul 7, 2025
@karlley karlley marked this pull request as ready for review July 7, 2025 22:56
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/system/notification/reports_test.rb (1)

126-149: 末尾の余分な空白を除去してください

テストタイトルの末尾にスペースが 1 つ残っています。
IDE によってはテスト名の一意性判定や検索に影響する場合があるため、削除を推奨します。

-test 'no notification if report already posted '
+test 'no notification if report already posted'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c558731 and 6f62965.

📒 Files selected for processing (1)
  • test/system/notification/reports_test.rb (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: hirokiej
PR: fjordllc/bootcamp#8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
test/system/notification/reports_test.rb (1)
Learnt from: masyuko0222
PR: fjordllc/bootcamp#8277
File: test/models/searcher_test.rb:0-0
Timestamp: 2025-07-07T12:46:01.631Z
Learning: テストにおいて、`result.all? { |condition| }` でコレクションの全要素が条件を満たすことを確認できれば、その条件を満たさない要素が含まれていないことも論理的に保証されるため、追加のアサーションは冗長となる。
🔇 Additional comments (4)
test/system/notification/reports_test.rb (4)

183-198: 英語化 👍

日本語タイトルからの置き換えのみでロジックへ影響なし。
命名も十分に意味が通るためこの変更は問題ありません。


200-216: 英語化 👍

同上。テスト名は一意でわかりやすくなっています。


218-230: 英語化 👍

同上。
特記事項はありません。


232-244: 英語化 👍

同上。テスト名が簡潔で、一貫性も保たれています。

@karlley karlley force-pushed the chore/fix-japanese-test-title branch from 6f62965 to 9c05c8d Compare July 7, 2025 23:39
@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Jul 13, 2025

@matuaya

お疲れさまです!
レビューとテストの動作確認をお願いしたいのですが対応可能でしょうか?
テストの動作確認の内容ですが、特定の1つのテストがパスするかをローカルで確認いただく作業になります(私の環境ではパスしなかったため)。
経緯: #8826 (comment)

@matuaya
Copy link
Copy Markdown
Contributor

matuaya commented Jul 14, 2025

@karlley
お疲れさまです!
bin/rails test test/system/notification/reports_test.rb:218のテストに関してですが、
私の環境でもエラーが発生してしまいます。
私の場合は、パスワードの警告ポップアップが出現してしまい、それによってタイミングがずれてテストが失敗しているみたいです。
ポップアップを無効にすることができず、ポップアップが出ない場合の検証ができていないので確証はないです💦
また、私の環境ではこのテストだけではなく他のテストでも同様のエラーが発生しているので、私の環境が特別悪い気がします。他の方の環境では問題なく通る可能性もあるんじゃないかなと思っています。
お力になれず申し訳ないです😥

@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Jul 14, 2025

@matuaya

テストの動作確認ありがとうございます!
確認方法の詳細を明記できておらずお手数お掛けしてすみませんでした🙇‍♂️

私の環境でもエラーが発生してしまいます。
私の場合は、パスワードの警告ポップアップが出現してしまい、それによってタイミングがずれてテストが失敗しているみたいです。

やはりエラーが出てしまうんですね💦
修正が必要になる可能性が高いので原因の調査を行い、その後の対応をkomagataさんに相談してみます。
レビューに関してはだいぶ先になりそうなのでレビュー依頼は一旦取り下げさせてください🙏
修正後に再度レビューをお願いするかもしれませんが、その際はよろしくお願いいたします。
matuayaさんのレビュー対応状況によっては別の方に依頼することも可能なので無理な場合は遠慮なくおっしゃってください!

@matuaya
Copy link
Copy Markdown
Contributor

matuaya commented Jul 15, 2025

@karlley
普通にbin/rails test test/system/notification/reports_test.rb:218を実行する場合はポップアップの干渉は関係なかったですね・・すみません💦
テスト5つ全て実行したのですが、私の環境では4つのテストが失敗しているのでやっぱり私の環境が特別悪いんじゃないかなと思っています。

修正後に再度レビューをお願いするかもしれませんが、その際はよろしくお願いいたします。

了解です😊

@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Jul 16, 2025

@matuaya

テスト5つ全て実行したのですが、私の環境では4つのテストが失敗しているのでやっぱり私の環境が特別悪いんじゃないかなと思っています。

色々と検証ありがとうございます!!
私の方でも原因調査してみます。

@tyrrell-IH
Copy link
Copy Markdown
Contributor

tyrrell-IH commented Aug 5, 2025

@karlley
'notify mention target only on first report posted'のテストが動くように修正してみました。
ヘッドフル、ヘッドレス両方で試してみても問題なくテストがパスすると思います。

気になる点があったら教えてください〜

CIのcheckが通らなくなってしまったので、原因解明します。
しばしお待ちください🙏

@tyrrell-IH tyrrell-IH force-pushed the chore/fix-japanese-test-title branch 4 times, most recently from edf58c2 to 1676af4 Compare August 7, 2025 17:18
@tyrrell-IH
Copy link
Copy Markdown
Contributor

tyrrell-IH commented Aug 7, 2025

@karlley
テストの修正終わりましたのでご確認ください。

修正した箇所が他のテストに影響してしまい、その調整に手間取ってしまったので遅くなりました🙏

karlleyさんの環境でテストが通らないor通りづらい等ありましたら教えてください

また、以下に修正の内容を簡単に書きました。

修正内容の説明

パスワードマネジャーの警告回避

commit: 2a4ae56

user: kimura、password: testestのペアでログインフォームに入力するとパスワードマネジャーの警告メッセージが出てテストが止まります。

パスワードを変更してください_と_ダッシュボード___FBC.png

警告メッセージ回避のため
user: komagataに変更しました。

assert_selectorでDOMの構築を待つ

commit: c77a917

visit '/login'等で画面を移動した際、DOMが構築される前に

  • ログインフォームにて情報を入れようとする
  • 「提出」等のボタンを押そうとする

等の処理が走ってエラーになっていました。
assert_selector等を入れて確実にDOMの構築を待ってから処理が走るようにしました。

Reportの保存を待ってidを返す

追記: メインの方で別の実装がマージされたので以下の変更は削除

commit: 508ba04

日報の提出ボタンを押した後すぐにReport.last.idをすると、日報がまだ保存されていないため、Report.last.idが今回作成した日報のひとつ前の日報のidを返し、その内容を修正してメンションを送ってしまうことがわかりました。

通知___FBC.png

wait_for_report_createdを定義して、日報の保存を待ってからReport.last.idを返すようにしました。

待機時間の調整

commit: 1676af4

現在Capybara.default_max_wait_timeが15秒に設定(参考)されているためclick_button(page.has_button?('提出') ? '提出' : '内容変更')のようなコードの場合「提出ボタンがないこと」の確認のために15秒要します。

待機時間をDOM構築に必要と思われる時間に調整しました。

2025/8/9 12:00 追記

test test/system/notification/reports_test.rb:218ついては単体でテストすれば30回連続で実行してもテストが通りました。
ただそれでも、ごく稀にテストが通らない時があってその点は解決できませんでした。

test/system/notification/reports_test.rb全体をテスト実行した際には上記と比較してテストが落ちやすい傾向にあります。他のテストが影響しているかもしれませんが、この点も解決できていません。

なので私の修正は「単体でのテストは通るようにした」という修正になります🙏

@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Aug 8, 2025

@tyrrell-IH

お疲れさまです。
テストの修正ありがとうございました!
該当のテストがローカルで全てパスするのを確認できました。
調査難航していたので大変助かりました🙇‍♂️
また、修正の内容についての記載もありがとうございました。
assert_selector でDOM描画を待機するような使い方があると大変勉強になりました!
修正内容についても確認できたのでメンバーレビューに進めようと思います。
ありがとうございました!

@karlley karlley closed this Aug 8, 2025
@karlley karlley reopened this Aug 8, 2025
@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Aug 8, 2025

@matuaya

お疲れさまです。
以前依頼させていただいていたレビューについてですが改めて依頼させていただくことは可能でしょうか?
ローカルでテストが落ちる件についてですがtyrrell-IHさんに修正していただきました(経緯)。
テストの修正については私の方でも問題無いことは確認しましたが、念の為matuayaさんにも確認いただけたらと思っています。
都合等によりレビューできない場合は遠慮なくおっしゃってください!

@matuaya
Copy link
Copy Markdown
Contributor

matuaya commented Aug 8, 2025

@karlley
お疲れ様です!
レビュー承りました😊今日中には確認いたしますので少々お待ちいただけると嬉しいです🙏

Copy link
Copy Markdown
Contributor

@matuaya matuaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

私の環境では一番最後のテストtest/system/notification/reports_test.rb:232のみFailしてしまいました。karlleyさんの環境では問題ないとのことなので、やっぱり私の環境がいつも通りテストと相性悪いんだと思います💦

ちょっと英語のニュアンスの部分でコメントさせていただきました🙏
検討していただけたら嬉しいです!

end

test '研修生が日報を作成し提出した時、企業のアドバイザーに通知する' do
test 'notify company advisor only on first report posted' do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと細かい英語表現の話になってしまうのですが💦
この文脈での"on first report posted"は実は結構曖昧で、

  • 「日報が初めて投稿された時だけ通知して、同じ日報が編集などで再投稿された場合は通知しない」という意味と、
  • 「一番最初に投稿された日報だけ通知して、その後に投稿される他の日報は通知しない」
    という意味のどっちにも解釈できてしまうんです。

テストの内容を見るまではどっちなのかちょっと判断つかない部分があるので、パッとテスト名だけで内容をわかるようにするには、例えば

  • notify company advisor only when report is initially posted
    だと一目でテストの内容を把握できるんじゃないかなと思います!
  • notify company advisor only when report is first posted
    なんかもいいと思います。

他のテスト名についても同様に検討していただければと思います🙏

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matuaya

なるほどです!
onwhen のニュアンスの違いを理解できていませんでした💦
以下のようなニュアンスで認識しましたが正しいでしょうか?

  • on: 出来事が起きたタイミング(条件は無関係)
  • when: 状況/条件が揃ったタイミング

また、以下のように修正しましたのでご確認お願いします。

183:notify company advisor only on first report posted
183:notify company advisor only when report is initially posted

200:notify follower only on first report posted
200:notify follower only when report is initially posted

218:notify mention target only on first report posted
218:notify mention target only when report is initially posted

232:notify user only on first report posted
232:notify user only when report is initially posted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karlley

修正ありがとうございます!

「onとwhenの違い」についてですが、ここでの文脈でのonとwhenはどちらも出来事のタイミングを指しているので、細かいニュアンスの違いはなくほとんど同じような感じがします。
なのでonでもいけそうな感じがするのですが、あまり使わないというか違和感が残ってしまう感じがします💦
もしonを使用するとしたら、"Notify only on initial posting of report"だといけるのですが、あまり自然じゃない気がします💦

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matuaya

回答ありがとうございます!

onでもいけそうな感じがするのですが、あまり使わないというか違和感が残ってしまう感じがします💦

なるほどです。英語があまり得意でないことと感覚的な部分になりそうなので難しいですね😭
今後はonwhen などは意識的に慎重に選ぶように気をつけようと思ます!

end

test '初日報は初めて公開した時だけ通知する' do
test 'notify user only on first report posted' do
Copy link
Copy Markdown
Contributor

@matuaya matuaya Aug 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これも細かい話になってしまうのですが・・・

これもちょっと曖昧で、
確かに「初日報のみ通知する」とも読み取れるですが、その場合は「初投稿のみ通知して再投稿は通知しない」というニュアンスが伝わりにくくなってしまいそうです。

なので、「初日報の初投稿の時のみ通知する」という意味が伝わると、テスト名がより内容を正確に反映できるんじゃないかなと思います!

@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Aug 13, 2025

@matuaya

レビューありがとうございます!

私の環境では一番最後のテストtest/system/notification/reports_test.rb:232のみFailしてしまいました。karlleyさんの環境では問題ないとのことなので、やっぱり私の環境がいつも通りテストと相性悪いんだと思います💦

承知しました!
どのように対応するかはkomagataさんに確認してみます。

Copy link
Copy Markdown
Contributor

@matuaya matuaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approveさせていただきます😊

最後に一点だけ、”notify user only when report is initially posted”に関してですが、「”初日報”の初投稿」というニュアンスが消えてしまったので、
”notify user only when first report is initially posted”
のほうが、日本語のテスト名”初日報は初めて公開した時だけ通知する”により近くなるかもしれないです!
動作には関係ないので細かすぎるのかな・・とも思うのでもし余裕があればご検討いただけたら嬉しいです🙏

@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Aug 14, 2025

@matuaya

「”初日報”の初投稿」というニュアンスが消えてしまった

すみません、初日報の部分が抜けてました💦
初日報のニュアンスを追加しました!

@matuaya
Copy link
Copy Markdown
Contributor

matuaya commented Aug 15, 2025

@karlley
修正ありがとうございます!
細かいところまで最後まで対応していただきありがとうございます🙇‍♀️
Approveは昨日させていただきました😊

@tyrrell-IH tyrrell-IH force-pushed the chore/fix-japanese-test-title branch 2 times, most recently from 3157735 to f71722a Compare August 19, 2025 01:19
@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Aug 20, 2025

@matuaya

返信遅くなりすみませんでした!
レビューとApproveありがとうござました😄

@karlley karlley force-pushed the chore/fix-japanese-test-title branch from f71722a to bf7efdf Compare August 24, 2025 21:52
@karlley karlley requested a review from komagata August 26, 2025 21:24
@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Aug 26, 2025

@komagata
メンバーレビューが完了しましたのでレビューお願いします!

Comment on lines +13 to +14
has_selector?('h2.page-header__title', text: 'ダッシュボード', wait: 3) ||
has_selector?('h1.auth-form__title', text: 'ログイン', wait: 3)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait: 3の部分ですが下記のところがデフォルトを15にしているので逆に短くなっちゃってるかもです。(それが狙いだったらすみません)

Copy link
Copy Markdown
Contributor

@tyrrell-IH tyrrell-IH Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@komagata
私の方でcommitした内容なので、karlleyさんに許可を得た上で回答させていただきます🙏
やり取り

例えば
has_selector?('h2.page-header__title', text: 'ダッシュボード'がfalseで
has_selector?('h1.auth-form__title', text: 'ログイン'がtrue
になるようなテスト(ログイン権限がないユーザーがログインしようとして確実にはじかれることの確認、等)の場合に
has_selector?('h2.page-header__title', text: 'ダッシュボード'の確認で15秒待つのは長すぎるように感じました。

テストの試行を繰り返すうちにwait: 3程度ならテストが問題なく通ることを確認したので、wait: 3に設定しました。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyrrell-IH なるほどです。意図的に設定されていたんですね。

必ず15秒待つわけではなく、要素が見つかった場合はすぐ終わるはずです。
(見つからない場合にMAXで15秒待つ)

そして、MAXでもそこまで待たなくて良いという意図があるのであれば、そういったものは他にも膨大にあると思うのでここだけ変更するとわかりづらいように思いました。

15秒の部分を変えることを検討するか、例えば短い版の秒数を定義して設定するかなど(あんまりやらない方がいい気がしますが)の方がいいかもと思いました。

Copy link
Copy Markdown
Contributor

@tyrrell-IH tyrrell-IH Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@komagata

そして、MAXでもそこまで待たなくて良いという意図があるのであれば、そういったものは他にも膨大にあると思うのでここだけ変更するとわかりづらいように思いました。

この点は確かにおっしゃる通りですね😓

15秒の部分を変えることを検討するか、例えば短い版の秒数を定義して設定するかなど(あんまりやらない方がいい気がしますが)の方がいいかもと思いました。

15秒の部分を変えるのは他のテストに与える影響を考慮しきれないので、waitの個別設定を全て削除しました!

commit: f494f2a

@tyrrell-IH tyrrell-IH force-pushed the chore/fix-japanese-test-title branch from d5d0dcc to f494f2a Compare September 4, 2025 07:11
@ryufuta
Copy link
Copy Markdown
Contributor

ryufuta commented Sep 13, 2025

@karlley
横から失礼します🙇🏻‍♂️
こちらのテストがfalkyなのを修正しようとしていたのですが、ほぼ修正済みのこのPRを見つけたのでコメントします!

3806358 でパスワードマネージャのモーダルが表示されないよう対応していますが、根本的な解決策ではないので別の方法を提案します。
test/application_system_test_case.rbで以下のように1行追加することでパスワードマネージャのモーダルがテスト実行時に表示されなくなります🙌

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  # ...
    driven_by(:selenium, using: :headless_chrome) do |driver_option|
      driver_option.add_argument('--no-sandbox')
      driver_option.add_argument('--disable-dev-shm-usage')
      driver_option.add_argument('enable-blink-features=Clipboard')
      driver_option.add_preference('profile.password_manager_leak_detection', false) # この行を追加
    end
  # ...

私の方で別PRで対応しても良いのですが、軽微ですし、動作確認手順が無駄に面倒になる(本PRがマージ後に上記のコミットをrevertしてもテストがパスすることを確認する)ため、こちらのPRで対応をお願いしたいと思っています🙏

あと、本PRはもとのIssueの範囲を逸脱しているので、PRのタイトルと概要を変更した方が良さそうですー

Comment on lines +12 to +15
assert(
has_selector?('h2.page-header__title', text: 'ダッシュボード') ||
has_selector?('h1.auth-form__title', text: 'ログイン')
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertをifのように使っているのがちょっとトリッキーに見えてこの場所が気になりました。

ログインしてログインページに遷移してしまう場合は何か問題が起きてると思うので、ログイン自体のテスト以外ではログインページに飛んでしまうのはエラーにすべきかなと思いました。

@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Sep 13, 2025

@ryufuta

情報の共有ありがとうございます!
大変助かります🙇‍♂️

私の方で別PRで対応しても良いのですが、軽微ですし、動作確認手順が無駄に面倒になる(本PRがマージ後に上記のコミットをrevertしてもテストがパスすることを確認する)ため、こちらのPRで対応をお願いしたいと思っています🙏

承知しました!
こちらの修正についてtyrrellさんとどのように進めるか現在相談中です。
https://discord.com/channels/715806612824260640/1399268903527518248/1416422156455121080

進め方の結果次第にはなりますが、少なくとも私かtyrrellさんが対応することになるとは思っています。

本PRはもとのIssueの範囲を逸脱しているので、PRのタイトルと概要を変更した方が良さそうですー

ご指摘ありがとうございます!
確かに、元のissueの範囲を逸脱しているように見えますね。
こちらに関しても当PRで対応するかどうかを検討中ですので、必要であればタイトル修正いたします。

@tyrrell-IH
Copy link
Copy Markdown
Contributor

tyrrell-IH commented Sep 16, 2025

@komagata
本PRの方針について、ご相談したいことがあります。

今後の本PRの方針について

本PRは現在

  • karlley さんの「日本語のテスト名を英語に変更する」の部分
  • tyrrellの「テストを通るようにする修正」の部分

が混在したPRになっています。

このPRについて

  • tyrrellのcommit(テストを通るようにする修正の部分)をgit reset等で戻す(なかった事にする)
  • 本PRは「日本語のテスト名を英語に変更する」の部分だけでレビュー、問題なければマージしてもらう。
  • 「テストを通るようにする修正」の部分はtyrrellの方で別途Issue、PRを作成する

という方針で進めさせいただきたいですがよろしいでしょうか?

なぜその方針にしたいのか

当初私の見込みでは軽微な修正で済む予定でしたので、本PRの中でテスト修正のコミットを積ませていただいておりました、。
しかし現状テスト修正のコードが多くなり本来のIssueの範囲を超えてしまっています。

今回のコメントの対応を本PR上で行うと「テストを通るようにする修正」の項目がさらに多くなる見込みなので、上記コメントを機に別途Issueとして対応した方が良いと考えました。

karlleyさんには以上の方針について相談のうえ了承を得ていますので、ご検討のほどよろしくお願いいたします🙏
やり取り

@komagata
Copy link
Copy Markdown
Member

@tyrrell-IH はい、そちらの方向で大丈夫です〜

@tyrrell-IH tyrrell-IH force-pushed the chore/fix-japanese-test-title branch from e2a7318 to 95f31c3 Compare September 19, 2025 02:49
@karlley
Copy link
Copy Markdown
Contributor Author

karlley commented Sep 23, 2025

@komagata
本PR内に含めていたテストの修正を別PRで対応するにあたって不要なコミットをtyrrellさんに除外してもらいました。
経緯

結果的に本PRには「日本語のテスト名を英語に変更する」という内容のみになっています。
また、「日本語のテスト名を英語に変更する」部分についてはメンバーレビューは完了しています。
改めてメンターレビューをお願いします。

Copy link
Copy Markdown
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認させていただきました。OKです〜!

@komagata komagata merged commit 5f1522f into main Oct 1, 2025
4 checks passed
@komagata komagata deleted the chore/fix-japanese-test-title branch October 1, 2025 04:52
@github-actions github-actions bot mentioned this pull request Oct 1, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants