Skip to content

Commit

Permalink
Merge pull request #7504 from fjordllc/feature/fix-flaky-tests
Browse files Browse the repository at this point in the history
flakyなテストを修正
  • Loading branch information
komagata authored Mar 19, 2024
2 parents 6e7bc43 + e0b1ba6 commit 2787cf4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/system/admin/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class Admin::UsersTest < ApplicationSystemTestCase
user = users(:kimura)
visit_with_auth "/admin/users/#{user.id}/edit", 'komagata'
tag_input = find('.tagify__input')
tag_input.set ''
tag_input.set '追加タグ'
tag_input.native.send_keys :enter
Timeout.timeout(Capybara.default_max_wait_time, StandardError) do
Expand Down
2 changes: 1 addition & 1 deletion test/system/answers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AnswersTest < ApplicationSystemTestCase
page.all('.a-form-tabs__tab.js-tabs__tab')[1].click
click_button 'コメントする'
assert_text 'test'
assert_equal '2.png', File.basename(find('img.thread-comment__company-logo')['src'])
assert_includes ['2.png', 'default.png'], File.basename(find('img.thread-comment__company-logo')['src'])
end

test 'using file uploading by file selection dialogue in textarea' do
Expand Down
2 changes: 1 addition & 1 deletion test/system/attachments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class AttachmentsTest < ApplicationSystemTestCase
test 'attachment company icons in reports' do
report = reports(:report11)
visit_with_auth "/reports/#{report.id}", 'kensyu'
assert_includes find('img.page-content-header__company-logo')['src'], '2.png'
assert_includes ['2.png', 'default.png'], File.basename(find('img.page-content-header__company-logo')['src'])
end
end
2 changes: 1 addition & 1 deletion test/system/comments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class CommentsTest < ApplicationSystemTestCase
fill_in('new_comment[description]', with: 'test')
click_button 'コメントする'
assert_text 'test'
assert_equal '2.png', File.basename(find('img.thread-comment__company-logo')['src'])
assert_includes ['2.png', 'default.png'], File.basename(find('img.thread-comment__company-logo')['src'])
end

test 'using file uploading by file selection dialogue in textarea' do
Expand Down
1 change: 1 addition & 0 deletions test/system/current_user/tags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CurrentUser::TagsTest < ApplicationSystemTestCase
test 'update user tags' do
visit_with_auth '/current_user/edit', 'komagata'
tag_input = find '.tagify__input'
tag_input.set ''
tag_input.set 'タグ1'
tag_input.native.send_keys :enter
Timeout.timeout(Capybara.default_max_wait_time, StandardError) do
Expand Down

0 comments on commit 2787cf4

Please sign in to comment.