From e5a9cfd9ee2a30c30e7720e9ce400b7288a53481 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Fri, 8 Dec 2023 15:01:28 +0100 Subject: [PATCH] Add additional check in `t/ui/15-comments.t` for easier debugging See https://progress.opensuse.org/issues/152077 --- t/ui/15-comments.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/ui/15-comments.t b/t/ui/15-comments.t index 5016111e9ed..70be2af5299 100644 --- a/t/ui/15-comments.t +++ b/t/ui/15-comments.t @@ -18,6 +18,7 @@ my $test_case = OpenQA::Test::Case->new; my $schema_name = OpenQA::Test::Database->generate_schema_name; my $schema = $test_case->init_data(schema_name => $schema_name, fixtures_glob => '01-jobs.pl 03-users.pl 04-products.pl'); +my $comments = $schema->resultset('Comments'); my $t = Test::Mojo->new('OpenQA::WebAPI'); @@ -483,6 +484,11 @@ subtest 'editing when logged in as regular user' => sub { $driver->get($group_url); is(scalar @{$driver->find_elements('.pinned-comment-row')}, 1, 'there shouldn\'t appear more pinned comments'); + # verify the number of comments we have added so far for easier debugging in case subsequent tests fail + my $group_id = (split('/', $group_url))[-1]; + my %cond = (-or => [{group_id => $group_id}, {parent_group_id => $group_id}]); + is $comments->search(\%cond)->count, 5, 'expected number of comments present in database at this point'; + # pagination present is(scalar @{$driver->find_elements('.comments-pagination a')}, 1, 'one pagination button present'); $driver->get($group_url . '?comments_limit=2');