Merge pull request #146 from sashakruglov/issue_119
test for issue #119
This commit is contained in:
Коммит
498f629d36
|
@ -39,12 +39,14 @@ class TestResult(PageRegion):
|
||||||
_result_failed_locator = (By.CSS_SELECTOR, '.result.failed')
|
_result_failed_locator = (By.CSS_SELECTOR, '.result.failed')
|
||||||
_result_invalid_locator = (By.CSS_SELECTOR, '.result.invalidated')
|
_result_invalid_locator = (By.CSS_SELECTOR, '.result.invalidated')
|
||||||
_result_blocked_locator = (By.CSS_SELECTOR, '.result.blocked')
|
_result_blocked_locator = (By.CSS_SELECTOR, '.result.blocked')
|
||||||
|
_result_skipped_locator = (By.CSS_SELECTOR, '.result.skipped')
|
||||||
|
|
||||||
_open_test_summary_locator = (By.CSS_SELECTOR, '.item-summary')
|
_open_test_summary_locator = (By.CSS_SELECTOR, '.item-summary')
|
||||||
_pass_test_button_locator = (By.CSS_SELECTOR, '.action-pass')
|
_pass_test_button_locator = (By.CSS_SELECTOR, '.action-pass')
|
||||||
_fail_test_button_locator = (By.CSS_SELECTOR, '.stepfail-summary')
|
_fail_test_button_locator = (By.CSS_SELECTOR, '.stepfail-summary')
|
||||||
_invalidate_test_button_locator = (By.CSS_SELECTOR, '.invalid-summary')
|
_invalidate_test_button_locator = (By.CSS_SELECTOR, '.invalid-summary')
|
||||||
_block_test_button_locator = (By.CSS_SELECTOR, '.block-summary')
|
_block_test_button_locator = (By.CSS_SELECTOR, '.block-summary')
|
||||||
|
_skip_test_button_locator = (By.CSS_SELECTOR, '.action-skip')
|
||||||
|
|
||||||
_failed_step_comment_locator = (By.CSS_SELECTOR, '.fail-field textarea[name="comment"]')
|
_failed_step_comment_locator = (By.CSS_SELECTOR, '.fail-field textarea[name="comment"]')
|
||||||
_failed_step_submit_locator = (By.CSS_SELECTOR, '.fail')
|
_failed_step_submit_locator = (By.CSS_SELECTOR, '.fail')
|
||||||
|
@ -81,6 +83,10 @@ class TestResult(PageRegion):
|
||||||
def is_blocked(self):
|
def is_blocked(self):
|
||||||
return self.is_element_present(*self._result_blocked_locator)
|
return self.is_element_present(*self._result_blocked_locator)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_skipped(self):
|
||||||
|
return self.is_element_present(*self._result_skipped_locator)
|
||||||
|
|
||||||
def open_test_summary(self):
|
def open_test_summary(self):
|
||||||
self.find_element(*self._open_test_summary_locator).click()
|
self.find_element(*self._open_test_summary_locator).click()
|
||||||
|
|
||||||
|
@ -112,3 +118,8 @@ class TestResult(PageRegion):
|
||||||
u'Test case "%s" is blocked' % self.case_name)
|
u'Test case "%s" is blocked' % self.case_name)
|
||||||
self.selenium.find_element(*self._blocked_test_submit_locator).click()
|
self.selenium.find_element(*self._blocked_test_submit_locator).click()
|
||||||
self.wait_for_ajax()
|
self.wait_for_ajax()
|
||||||
|
|
||||||
|
def skip_test(self):
|
||||||
|
self.open_test_summary()
|
||||||
|
self.find_element(*self._skip_test_button_locator).click()
|
||||||
|
self.wait_for_ajax()
|
||||||
|
|
|
@ -122,3 +122,15 @@ class TestRunTestsPage(BaseTest):
|
||||||
|
|
||||||
test_result = run_tests_pg.get_test_result(case['name'])
|
test_result = run_tests_pg.get_test_result(case['name'])
|
||||||
Assert.true(test_result.is_blocked)
|
Assert.true(test_result.is_blocked)
|
||||||
|
|
||||||
|
def test_that_user_can_skip_test(self, mozwebqa_logged_in, product, element):
|
||||||
|
case = self.create_and_run_test(mozwebqa_logged_in, product, element)[0]
|
||||||
|
|
||||||
|
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
|
||||||
|
test_result = run_tests_pg.get_test_result(case['name'])
|
||||||
|
Assert.false(test_result.is_skipped)
|
||||||
|
|
||||||
|
test_result.skip_test()
|
||||||
|
|
||||||
|
test_result = run_tests_pg.get_test_result(case['name'])
|
||||||
|
Assert.true(test_result.is_skipped)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче