Skip to content
Browse files

Merge pull request #79 from bebef1987/2741

test_that_user_can_create_suite_and_add_some_cases_to_it
  • Loading branch information...
2 parents 2c7da5a + b748b99 commit a1b75eef3140cb8aefedc846d6cd9535635d9ac7 @AlinT AlinT committed
Showing with 24 additions and 1 deletion.
  1. +1 −1 pages/create_suite_page.py
  2. +7 −0 pages/manage_suites_page.py
  3. +16 −0 tests/test_manage_suites_page.py
View
2 pages/create_suite_page.py
@@ -47,7 +47,7 @@ def create_suite(self, name='Test Suite', product='Test Product', desc='This is
if case_list:
for case in case_list:
- case_element = self.selenium.find_element(By.XPATH, "//article[@data-title='%s'/input" % case)
+ case_element = self.selenium.find_element(By.XPATH, "//article[@data-title='%s']/div/label" % case)
case_element.click()
self.selenium.find_element(*self._include_selected_cases_locator).click()
self.selenium.find_element(*self._submit_locator).click()
View
7 pages/manage_suites_page.py
@@ -15,6 +15,7 @@ class MozTrapManageSuitesPage(MozTrapBasePage):
_delete_suite_locator = (By.CSS_SELECTOR, '#managesuites .itemlist .listitem[data-title="%(suite_name)s"] .action-delete')
_suite_status_locator = (By.CSS_SELECTOR, '#managesuites .itemlist .listitem[data-title="%(suite_name)s"] .status-action')
+ _view_cases_locator = ((By.CSS_SELECTOR, '#managesuites .itemlist .listitem[data-title="%(suite_name)s"] .casecount .drill-link'))
_filter_input_locator = (By.ID, 'text-filter')
_filter_suggestion_locator = (By.CSS_SELECTOR, '#filter .textual .suggest .suggestion[data-type="name"][data-name="%(filter_name)s"]')
_filter_locator = (By.CSS_SELECTOR, '#filterform .filter-group input[data-name="name"][value="%(filter_name)s"]:checked')
@@ -41,3 +42,9 @@ def activate_suite(self, name='Test Suite'):
self.selenium.find_element(*self._suite_status_locator).click()
self.wait_for_ajax()
+
+ def view_cases(self, name='Test Suite'):
+ _view_cases_locator = (self._view_cases_locator[0], self._view_cases_locator[1] % {'suite_name': name})
+ self.selenium.find_element(*_view_cases_locator).click()
+ from pages.manage_cases_page import MozTrapManageCasesPage
+ return MozTrapManageCasesPage(self.testsetup)
View
16 tests/test_manage_suites_page.py
@@ -26,3 +26,19 @@ def test_that_user_can_create_and_delete_suite(self, mozwebqa_logged_in):
Assert.false(manage_suites_pg.is_element_present(*suite['locator']))
self.delete_product(mozwebqa_logged_in, product=suite['product'])
+
+ def test_that_user_can_create_suite_and_add_some_cases_to_it(self, mozwebqa_logged_in):
+ manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
+
+ product = self.create_product(mozwebqa_logged_in)
+ cases = [self.create_case(mozwebqa=mozwebqa_logged_in, product=product) for i in range(3)]
+
+ suite = self.create_suite(mozwebqa=mozwebqa_logged_in, product=product, case_name_list=[case['name'] for case in cases])
+
+ manage_suites_pg.filter_suites_by_name(name=suite['name'])
+ Assert.true(manage_suites_pg.is_element_present(*suite['locator']))
+
+ manage_test_cases_pg = manage_suites_pg.view_cases(name=suite['name'])
+
+ for case in cases:
+ Assert.true(manage_test_cases_pg.is_element_present(*case['locator']))

0 comments on commit a1b75ee

Please sign in to comment.
Something went wrong with that request. Please try again.