From c559b75a2b5c855a12c5a997235515d0f7f7bb87 Mon Sep 17 00:00:00 2001 From: trichoplax Date: Sun, 23 Mar 2025 23:08:40 +0000 Subject: [PATCH 1/9] Add an initial commit to allow making a pull request --- test/system/ci_failures_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/system/ci_failures_test.rb diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb new file mode 100644 index 000000000..e88ad52ac --- /dev/null +++ b/test/system/ci_failures_test.rb @@ -0,0 +1,7 @@ +require 'application_system_test_case' + +class PostTest < ApplicationSystemTestCase + test 'empty test to start with' do + assert true + end +end From 71d54e67eafc08fd362718ba5c1fdabce81cabe8 Mon Sep 17 00:00:00 2001 From: trichoplax Date: Mon, 24 Mar 2025 17:11:39 +0000 Subject: [PATCH 2/9] Fix test class name --- test/system/ci_failures_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index e88ad52ac..f1f327a17 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -1,6 +1,6 @@ require 'application_system_test_case' -class PostTest < ApplicationSystemTestCase +class CIFailuresTest < ApplicationSystemTestCase test 'empty test to start with' do assert true end From 54243ab5626419bfb1d67636ce4635eda46e6f22 Mon Sep 17 00:00:00 2001 From: trichoplax Date: Mon, 24 Mar 2025 17:16:58 +0000 Subject: [PATCH 3/9] Add tests to see what users see --- test/system/ci_failures_test.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index f1f327a17..7dea464f5 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -4,4 +4,32 @@ class CIFailuresTest < ApplicationSystemTestCase test 'empty test to start with' do assert true end + + test 'temporary test to analyse CI failures what does basic user see in main' do + category = categories(:main) + log_in :basic_user + visit category_path(category) + assert_text 'Nonexistent to force screenshot' + end + + test 'temporary test to analyse CI failures what does standard user see in main' do + category = categories(:main) + log_in :standard_user + visit category_path(category) + assert_text 'Nonexistent to force screenshot' + end + + test 'temporary test to analyse CI failures what does standard user see after adding post to meta' do + category = categories(:meta) + log_in :standard_user + visit category_path(category) + post_title = 'Test title text for testing threads' + create_post('Test body text for testing threads.', post_title) + assert_text 'Unfollow new' # Ensure post has finished saving to avoid timing problems + + log_out + log_in :standard_user + visit category_path(category) + assert_text 'Nonexistent to force screenshot' + end end From 5e611baef8a6d1d515c03b8df74da47b993479df Mon Sep 17 00:00:00 2001 From: trichoplax Date: Tue, 25 Mar 2025 15:14:18 +0000 Subject: [PATCH 4/9] Add test to log out before checking basic_user --- test/system/ci_failures_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index 7dea464f5..1493e26e1 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -12,6 +12,14 @@ class CIFailuresTest < ApplicationSystemTestCase assert_text 'Nonexistent to force screenshot' end + test 'temporary test to analyse CI failures what does basic user see in main with log out first' do + category = categories(:main) + log_out + log_in :basic_user + visit category_path(category) + assert_text 'Nonexistent to force screenshot' + end + test 'temporary test to analyse CI failures what does standard user see in main' do category = categories(:main) log_in :standard_user From 95c14ef6331cefedf0edb355aea417e9228cb98e Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Tue, 25 Mar 2025 18:22:40 +0300 Subject: [PATCH 5/9] quick test for logging out on teardown --- test/system/ci_failures_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index 1493e26e1..82961de02 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -1,6 +1,8 @@ require 'application_system_test_case' class CIFailuresTest < ApplicationSystemTestCase + teardown :log_out + test 'empty test to start with' do assert true end From 64bdfdaef732552e80be7d47df938da2c32a8aa4 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Tue, 25 Mar 2025 18:26:30 +0300 Subject: [PATCH 6/9] Revert "quick test for logging out on teardown" This reverts commit 95c14ef6331cefedf0edb355aea417e9228cb98e. --- test/system/ci_failures_test.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index 82961de02..1493e26e1 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -1,8 +1,6 @@ require 'application_system_test_case' class CIFailuresTest < ApplicationSystemTestCase - teardown :log_out - test 'empty test to start with' do assert true end From 07c87269008b239cb9334a1760a49a301261bf0e Mon Sep 17 00:00:00 2001 From: trichoplax Date: Tue, 25 Mar 2025 18:43:59 +0000 Subject: [PATCH 7/9] Visit page before trying to log out --- test/system/ci_failures_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index 1493e26e1..6153a0843 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -14,6 +14,7 @@ class CIFailuresTest < ApplicationSystemTestCase test 'temporary test to analyse CI failures what does basic user see in main with log out first' do category = categories(:main) + visit category_path(category) log_out log_in :basic_user visit category_path(category) From 816b15e75578ff2ee92227a3506d3dc65a23d88e Mon Sep 17 00:00:00 2001 From: trichoplax Date: Wed, 16 Jul 2025 01:19:04 +0100 Subject: [PATCH 8/9] Extra tests to try to see why posts don't show in category page --- test/application_system_test_case.rb | 12 ++++++++++ test/system/ci_failures_test.rb | 36 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 73a444150..ccfe1c765 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -97,4 +97,16 @@ def post_form_select_tag(tag_name, create_new = false) 'but could not select it from options without creating a new tag.' end end + + def create_post(button_label, body, title, tags) + click_button(button_label) + fill_in("Body", with: body) + fill_in("Summarize your post with a title:", with: title) + + tags.each do |tag| + post_form_select_tag(tag) + end + + click_button("Save Post in ") + end end diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index 6153a0843..a47bb1327 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -5,6 +5,23 @@ class CIFailuresTest < ApplicationSystemTestCase assert true end + + test 'Anyone can view question' do + post = posts(:question_one) + visit post_url(post) + # category=categories(:main) + # visit category_path(category) + + assert_text 'Nonexistent to force screenshot' + end + + test 'temporary test to analyse CI failures what does main look like before logging in' do + clear_cache + category = categories(:main) + visit category_path(category) + assert_text 'Nonexistent to force screenshot' + end + test 'temporary test to analyse CI failures what does basic user see in main' do category = categories(:main) log_in :basic_user @@ -41,4 +58,23 @@ class CIFailuresTest < ApplicationSystemTestCase visit category_path(category) assert_text 'Nonexistent to force screenshot' end + + test 'temporary test to analyse CI failures what does basic user see after adding post to main' do + category = categories(:main) + log_in :standard_user + visit category_path(category) + button_label = 'Create Post' + post_body = 'Test body text for testing threads.' + post_title = 'Test title text for testing threads' + tags = ['bug'] + create_post(button_label, post_body, post_title, tags) + assert_text 'Unfollow new' # Ensure post has finished saving to avoid timing problems + + log_out + assert_text 'Sign in' + + log_in :basic_user + visit category_path(category) + assert_text '0 posts' + end end From e9a341643661f004d244f465d4c436fc8fce6016 Mon Sep 17 00:00:00 2001 From: trichoplax Date: Mon, 28 Jul 2025 14:28:02 +0100 Subject: [PATCH 9/9] Fix double quotes and blank line for rubocop --- test/application_system_test_case.rb | 6 +++--- test/system/ci_failures_test.rb | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index ccfe1c765..6fbb4cb3b 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -100,13 +100,13 @@ def post_form_select_tag(tag_name, create_new = false) def create_post(button_label, body, title, tags) click_button(button_label) - fill_in("Body", with: body) - fill_in("Summarize your post with a title:", with: title) + fill_in('Body', with: body) + fill_in('Summarize your post with a title:', with: title) tags.each do |tag| post_form_select_tag(tag) end - click_button("Save Post in ") + click_button('Save Post in ') end end diff --git a/test/system/ci_failures_test.rb b/test/system/ci_failures_test.rb index a47bb1327..800f3da77 100644 --- a/test/system/ci_failures_test.rb +++ b/test/system/ci_failures_test.rb @@ -5,7 +5,6 @@ class CIFailuresTest < ApplicationSystemTestCase assert true end - test 'Anyone can view question' do post = posts(:question_one) visit post_url(post)