From c47c37e107c87da86c43041aa750494796314e71 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Thu, 11 Jul 2024 14:17:02 +0800 Subject: [PATCH] DEV: Print page's HTML at the end after test fails (#226) This system spec is flaky and we are getting a blank page so I would like to see what the HTML is. Previously printing of the page's HTML was doing it too early such that the ember application has not even boot. --- spec/system/admin_update_spec.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spec/system/admin_update_spec.rb b/spec/system/admin_update_spec.rb index 0e929ff..4688904 100644 --- a/spec/system/admin_update_spec.rb +++ b/spec/system/admin_update_spec.rb @@ -11,15 +11,11 @@ RSpec.describe "Admin update", type: :system do it "displays the admin update page with the right respositories" do visit("/admin/update") - # We are getting a blank page on CI so adding debugging steps to figure out why - if ENV["CI"] - expect(page).to have_current_path("/admin/update") - puts page.html - end - expect(page).to have_css("h3", exact_text: I18n.t("js.admin.docker.update_title")) expect(page).to have_css("tr.repo .repo__name", exact_text: "Discourse") expect(page).to have_css("tr.repo .repo__name", exact_text: "Docker Manager") expect(page).to have_css("tr.repo .repo__about a[href='https://meta.discourse.org/t/12655']") + ensure + puts page.html if ENV["CI"] end end