Jenkins: Improve range tests by working around bug 1411264 and picking result sets relative to the end of the list (#2871)

This commit is contained in:
Dave Hunt 2017-10-25 00:04:57 +01:00 коммит произвёл Ed Morley
Родитель c982b2e983
Коммит 6b80a95ed4
2 изменённых файлов: 16 добавлений и 9 удалений

Просмотреть файл

@ -316,13 +316,19 @@ class TreeherderPage(Base):
return self.find_element(*self._pin_all_jobs_locator).click()
def set_as_bottom_of_range(self):
# TODO workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1411264
el = self.page.find_element(By.CSS_SELECTOR, 'body')
self.find_element(*self._dropdown_toggle_locator).click()
self.find_element(*self._set_bottom_of_range_locator).click()
self.wait.until(EC.staleness_of(el))
self.page.wait_for_page_to_load()
def set_as_top_of_range(self):
# TODO workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1411264
el = self.page.find_element(By.CSS_SELECTOR, 'body')
self.find_element(*self._dropdown_toggle_locator).click()
self.find_element(*self._set_top_of_range_locator).click()
self.wait.until(EC.staleness_of(el))
self.page.wait_for_page_to_load()
def view(self):

Просмотреть файл

@ -6,17 +6,18 @@ from pages.treeherder import TreeherderPage
@pytest.mark.nondestructive
def test_set_as_top_of_range(base_url, selenium):
page = TreeherderPage(selenium, base_url).open()
current_top_of_range = page.result_sets[0].datestamp
page.result_sets[1].set_as_top_of_range()
page.wait_for_page_to_load()
new_top_of_range = page.result_sets[0].datestamp
assert not new_top_of_range == current_top_of_range
result_sets = page.result_sets
datestamp = result_sets[1].datestamp
assert result_sets[0].datestamp != datestamp
result_sets[1].set_as_top_of_range()
assert page.result_sets[0].datestamp == datestamp
@pytest.mark.nondestructive
def test_set_as_bottom_of_range(base_url, selenium):
page = TreeherderPage(selenium, base_url).open()
current_bottom_of_range = page.result_sets[9].datestamp
page.result_sets[0].set_as_bottom_of_range()
new_bottom_of_range = page.result_sets[0].datestamp
assert not new_bottom_of_range == current_bottom_of_range
result_sets = page.result_sets
datestamp = result_sets[-2].datestamp
assert result_sets[-1].datestamp != datestamp
page.result_sets[-2].set_as_bottom_of_range()
assert page.result_sets[-1].datestamp == datestamp