Skip to content

/test/system/notifications_test.rb:256 のテストが通らない #9029

@tyrrell-IH

Description

@tyrrell-IH

テスト内容

test 'notify comment and check' do
  login_user 'hatsuno', 'testtest'
  report = create_report 'コメントと', '確認があった', false

  perform_enqueued_jobs do
    visit_with_auth "/reports/#{report}", 'komagata'
    visit "/reports/#{report}"
    fill_in 'new_comment[description]', with: 'コメントと確認した'
    click_button '確認OKにする'
    assert_text 'コメントと確認した'
    visit_with_auth "/reports/#{report}", 'hatsuno'
    assert_text 'コメントと確認した'
    find('.header-links__link.test-show-notifications').click
    assert_text 'hatsunoさんの日報「コメントと」にkomagataさんがコメントしました。'
  end
end

テストを実行すると以下の結果になり、テストが通らない。
テストが通るように修正したい。

実行結果その1
bin/rails test test/system/notifications_test.rb:256
Running via Spring preloader in process 65510
Run options: --seed 61527

# Running:

[Screenshot Image]: /Users/iwamurahiroshi/practice/bootcamp/tmp/screenshots/failures_test_notify_comment_and_check.png
E

Error:
NotificationsTest#test_notify_comment_and_check:
Capybara::ElementNotFound: Unable to find button "確認OKにする" that is not disabled
    test/system/notifications_test.rb:264:in `block (2 levels) in <class:NotificationsTest>'
    test/system/notifications_test.rb:260:in `block in <class:NotificationsTest>'

rails test test/system/notifications_test.rb:256


[Minitest::CI] Generating test report in JUnit XML format...


Finished in 23.083605s, 0.0433 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
Image
実行結果その2
bin/rails test test/system/notifications_test.rb:256
Running via Spring preloader in process 66212
Run options: --seed 42580

# Running:

[Screenshot Image]: /Users/iwamurahiroshi/practice/bootcamp/tmp/screenshots/failures_test_notify_comment_and_check.png
F

Failure:
NotificationsTest#test_notify_comment_and_check [test/system/notifications_test.rb:269]:
expected to find text "hatsunoさんの日報「コメントと」にkomagataさんがコメントしました。" in "お知らせ\nプラクティス\n日報・ブログ\n15\nQ&A\nDocs・動画\nポートフォリオ\nユーザー\nイベント\n相談\n検索\nヘルプ\nMe\n2\n通知\n未読\n全て\n全ての未読通知一覧へ\n募集期間中のイベント(補欠者あり)で、補欠から参加に繰り上がりました。\n数秒前\n[FBC] 定期イベント【開発MTG】が更新されました。\n数秒前\n全て既読にする\n全て別タブで開く\nwith-hyphen\nフォローする\nユーザー一覧\nプロフィール\nポートフォリオ\n日報 (36)\nコメント (0)\n提出物 (46)\n質問 (0)\n回答 (0)\nイベント (0)\n分報 (0)\n確認済\n2025/08/14\nkomagata\nwith-hyphen (ハイフンアリユーザー)\n日報60\n2021年03月02日(\n26\n)の日報\nコメント(\n1\n)\nWatch\nBookmark\nURLコピー\nRaw\n学習時間無し\n頑張れませんでした\nwith-hyphenさんの日報一覧へ\n前の日報\n日報一覧\n次の日報\nコメント\nkomagata\n2025年08月14日(木) 01:59\nRaw\nコメントと確認した\nコメント\nプレビュー\nファイルを挿入\nコメントする\n見たよ\n直近の日報\n日報70\nwith-hyphen (ハイフンアリユーザー)\n2021年03月12日の日報\n日報69\nwith-hyphen (ハイフンアリユーザー)\n2021年03月11日の日報\n日報68\nwith-hyphen (ハイフンアリユーザー)\n2021年03月10日の日報\n日報67\nwith-hyphen (ハイフンアリユーザー)\n2021年03月09日の日報\n日報66\nwith-hyphen (ハイフンアリユーザー)\n2021年03月08日の日報\n日報65\nwith-hyphen (ハイフンアリユーザー)\n2021年03月07日の日報\n日報64\nwith-hyphen (ハイフンアリユーザー)\n2021年03月06日の日報\n日報63\nwith-hyphen (ハイフンアリユーザー)\n2021年03月05日の日報\n日報62\nwith-hyphen (ハイフンアリユーザー)\n2021年03月04日の日報\n日報61\nwith-hyphen (ハイフンアリユーザー)\n2021年03月03日の日報\nホームページ\nブログ\n参考書籍\nbootcampリポジトリ\nbootcampカンバン\nFjord Minutes\nグッズ購入\nフィヨブーファンブック\nアンチハラスメントポリシー\n利用規約\nプライバシーポリシー\n特定商取引法に基づく表記\nコース一覧\n企業一覧\n#fjordbootcamp\nFjord Choice\nFjordContributions\nBuzzcord\nDiscordBotF\nBookRin\nFBC Stack\nフィヨルドブートキャスト\nRouletteTalk\nagentリポジトリ\nagentカンバン\nYouTubeチャンネル\nFBCのXアカウント\nLokka Inc.2012 - 2025"

rails test test/system/notifications_test.rb:256

[Minitest::CI] Generating test report in JUnit XML format...

Finished in 26.579286s, 0.0376 runs/s, 0.1129 assertions/s.
1 runs, 3 assertions, 1 failures, 0 errors, 0 skips
Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions