From 18358c448cde8796844e4358c3cbe5010275ea98 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 1 Aug 2023 09:06:56 +0800 Subject: [PATCH] DEV: Assert that user has been signed in successfully in system tests (#22892) We have seen instances where the user has not been signed in but we need more debugging information to know why. Exmaple where test fails due to user not being signed in https://github.com/discourse/discourse/actions/runs/5718655343/job/15494917165 --- spec/support/system_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/system_helpers.rb b/spec/support/system_helpers.rb index 381bcea83fc..5c26342d530 100644 --- a/spec/support/system_helpers.rb +++ b/spec/support/system_helpers.rb @@ -18,6 +18,8 @@ module SystemHelpers GlobalSetting.relative_url_root || "", "/session/#{user.encoded_username}/become.json?redirect=false", ) + + expect(page).to have_content("Signed in to #{user.encoded_username} successfully") end def sign_out