From 4acbfb17c01f7f6aa240b2c14bcd279b6c57d626 Mon Sep 17 00:00:00 2001 From: Dave Hunt Date: Mon, 23 Oct 2017 21:31:14 +0100 Subject: [PATCH] Improve test_expanding_group_count by looking beyond the first result set if required (#2858) --- tests/jenkins/tests/test_expanding_group_count.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/jenkins/tests/test_expanding_group_count.py b/tests/jenkins/tests/test_expanding_group_count.py index d88f3adce..fe0ab66d9 100644 --- a/tests/jenkins/tests/test_expanding_group_count.py +++ b/tests/jenkins/tests/test_expanding_group_count.py @@ -1,3 +1,5 @@ +import itertools + import pytest from pages.treeherder import TreeherderPage @@ -6,7 +8,9 @@ from pages.treeherder import TreeherderPage @pytest.mark.nondestructive def test_expanding_group_count(base_url, selenium): page = TreeherderPage(selenium, base_url).open() - group = next(g for g in page.result_sets[0].job_groups if not g.expanded) + all_groups = list(itertools.chain.from_iterable( + r.job_groups for r in page.result_sets)) + group = next(g for g in all_groups if not g.expanded) jobs = group.jobs group.expand() assert len(group.jobs) > len(jobs)