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

Move finished jobs filter subtest to correct file #6051

Merged
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions t/ui/01-list.t
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,19 @@ subtest 'filter-finished' => sub {
cmp_ok scalar $driver->find_elements('#results tbody tr', 'css'), '>', scalar @jobs, 'all jobs shown again';
};

subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');

my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';

my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';

my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};

Comment on lines +429 to +441
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now at best in a separate commit use a more concise style

Suggested change
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';
my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';
my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';
my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';
my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};

or even

Suggested change
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';
my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';
my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
is scalar $driver->find_elements('#running tbody tr'), 3, 'Running jobs are displayed';
is scalar $driver->find_elements('#scheduled tbody tr'), 3, 'Scheduled jobs are displayed';
is scalar $driver->find_elements('#results tbody tr'), 3, 'Finished jobs table is correctly filtered';
};

maybe scalar isn't even needed

subtest 'match parameter' => sub {
$driver->get('/tests?match=staging_e');
wait_for_ajax msg => '"All tests" with match parameter';
Expand Down
13 changes: 0 additions & 13 deletions t/ui/10-tests_overview.t
Original file line number Diff line number Diff line change
Expand Up @@ -623,19 +623,6 @@ subtest "job dependencies displayed on 'Test result overview' page" => sub {
'parent job was highlighted correctly';
};

subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');

my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 2, 'Running jobs are displayed';

my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 4, 'Scheduled jobs are displayed';

my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 6, 'Finished jobs table is correctly filtered';
};

kill_driver();

done_testing();
Loading