From 3668cd30e964ecd96dc94fba981e64a0830bae31 Mon Sep 17 00:00:00 2001 From: appsu-mi Date: Mon, 2 Dec 2024 13:16:36 +0900 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=A0=B1=E6=9C=AA=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=8C=E5=87=BA=E3=81=A6=E3=83=86=E3=82=B9=E3=83=88=E3=81=8C?= =?UTF-8?q?=E4=B8=8D=E5=AE=89=E5=AE=9A=E3=81=AA=E3=81=9F=E3=82=81=E3=80=81?= =?UTF-8?q?setCheckable=E3=81=8C=E5=AE=9F=E8=A1=8C=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=81=BE=E3=81=A7=E5=BE=85=E3=81=A4=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/comments_test.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/system/comments_test.rb b/test/system/comments_test.rb index 12eeeacc78b..fdd0de557c9 100644 --- a/test/system/comments_test.rb +++ b/test/system/comments_test.rb @@ -37,6 +37,11 @@ class CommentsTest < ApplicationSystemTestCase test 'post new comment for report' do visit_with_auth "/reports/#{reports(:report1).id}", 'komagata' + # テストが落ちやすいため、setCheckableが実行されるまで待つ + within('.page-content-header') do + find('.stamp.stamp-approve') + end + within('.thread-comment-form__form') do fill_in('new_comment[description]', with: 'test') end @@ -81,6 +86,10 @@ class CommentsTest < ApplicationSystemTestCase test 'post new comment with emoji for report' do visit_with_auth "/reports/#{reports(:report1).id}", 'komagata' + within('.page-content-header') do + find('.stamp.stamp-approve') + end + find('#comments.loaded', wait: 10) Timeout.timeout(Capybara.default_max_wait_time, StandardError) do @@ -96,6 +105,10 @@ class CommentsTest < ApplicationSystemTestCase test 'post new comment with image for report' do visit_with_auth "/reports/#{reports(:report1).id}", 'komagata' + within('.page-content-header') do + find('.stamp.stamp-approve') + end + find('#comments.loaded', wait: 10) find('#js-new-comment').set('画像付きで説明します。 ![Image](https://example.com/test.png)') click_button 'コメントする' @@ -106,6 +119,10 @@ class CommentsTest < ApplicationSystemTestCase test 'post new comment with linked image for report' do visit_with_auth "/reports/#{reports(:report1).id}", 'komagata' + within('.page-content-header') do + find('.stamp.stamp-approve') + end + find('#comments.loaded', wait: 10) find('#js-new-comment').set('[![Image](https://example.com/test.png)](https://example.com)') click_button 'コメントする' @@ -204,6 +221,10 @@ class CommentsTest < ApplicationSystemTestCase test 'prevent double submit' do visit_with_auth report_path(users(:komagata).reports.first), 'komagata' + within('.page-content-header') do + find('.stamp.stamp-approve') + end + within('.thread-comment-form__form') do fill_in('new_comment[description]', with: 'test') end @@ -214,6 +235,10 @@ class CommentsTest < ApplicationSystemTestCase test 'submit_button is enabled after a post is done' do visit_with_auth report_path(users(:komagata).reports.first), 'komagata' + within('.page-content-header') do + find('.stamp.stamp-approve') + end + within('.thread-comment-form__form') do fill_in('new_comment[description]', with: 'test') end @@ -283,6 +308,10 @@ class CommentsTest < ApplicationSystemTestCase test 'clear preview after posting new comment for report' do visit_with_auth "/reports/#{reports(:report1).id}", 'komagata' + within('.page-content-header') do + find('.stamp.stamp-approve') + end + find('#js-new-comment').set('test') click_button 'コメントする' assert_text 'test'