Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tmp][Draft]Flakyテスト調査用PR #8043

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/system/articles_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

class ArticlesTest < ApplicationSystemTestCase
setup do
puts '*****************set up start*****************'
@article = articles(:article1)
puts '*****************@article*****************'
@article2 = articles(:article2)
puts '*****************@article2*****************'
@article3 = articles(:article3)
puts '*****************@article3*****************'
puts '*****************set up end*****************'
end

test 'show listing articles' do
Expand Down Expand Up @@ -138,10 +143,15 @@ class ArticlesTest < ApplicationSystemTestCase
assert_selector 'nav.pagination', count: 2
end

# Flaky test
test "general user can't see edit and delete buttons" do
puts "*************general user can't see edit and delete buttons***************"
visit_with_auth article_path(@article), 'kimura'
puts "*************visit_with_auth article_path(@article), 'kimura'*************"
assert_no_text '内容修正'
puts "*************assert_no_text '内容修正'*************"
assert_no_text '削除'
puts "*************assert_no_text '削除'*************"
end

test 'admin can see edit and delete buttons' do
Expand Down Expand Up @@ -192,13 +202,19 @@ class ArticlesTest < ApplicationSystemTestCase
assert_no_text @article.title
end

# Flaky test
test 'mentor can delete an article' do
puts "*************general user can't see edit and delete buttons***************"
visit_with_auth articles_path, 'mentormentaro'
puts "*************visit_with_auth articles_path, 'mentormentaro'***************"
assert_text @article.title

puts '*************assert_text @article.title***************'
visit article_path(@article)
puts '*************visit article_path(@article)***************'
accept_confirm do
click_on '削除'
puts "*************click_on '削除'***************"
end

assert_no_text @article.title
Expand Down