Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #102 from sashakruglov/moztrap_5932

Issue #87. Moztrap #5932
  • Loading branch information...
commit 9e14ad45e78769c66f96241e0cb36f8761c58c42 2 parents 64011fe + be53afa
@teodosia teodosia authored
View
15 pages/create_bulk_cases_page.py
@@ -66,3 +66,18 @@ def create_bulk_cases(
self.selenium.find_element(*self._submit_locator).click()
return cases
+
+ @property
+ def product_value(self):
+ product_select = self.find_element(*self._product_select_locator)
+ return product_select.find_element(By.CSS_SELECTOR, 'option:checked').text
+
+ @property
+ def product_version_value(self):
+ version_select = self.find_element(*self._version_select_locator)
+ return version_select.find_element(By.CSS_SELECTOR, 'option:checked').text
+
+ @property
+ def suite_value(self):
+ suite_select = self.find_element(*self._suite_select_locator)
+ return suite_select.find_element(By.CSS_SELECTOR, 'option:checked').text
View
15 pages/create_case_page.py
@@ -61,3 +61,18 @@ def create_case(self, name='Test Case', product='Test Product', version='Test Ve
self.selenium.find_element(*self._submit_locator).click()
return case
+
+ @property
+ def product_value(self):
+ product_select = self.find_element(*self._product_select_locator)
+ return product_select.find_element(By.CSS_SELECTOR, 'option:checked').text
+
+ @property
+ def product_version_value(self):
+ version_select = self.find_element(*self._version_select_locator)
+ return version_select.find_element(By.CSS_SELECTOR, 'option:checked').text
+
+ @property
+ def suite_value(self):
+ suite_select = self.find_element(*self._suite_select_locator)
+ return suite_select.find_element(By.CSS_SELECTOR, 'option:checked').text
View
12 pages/manage_cases_page.py
@@ -16,6 +16,8 @@ class MozTrapManageCasesPage(MozTrapBasePage):
_delete_case_locator = (By.CSS_SELECTOR, '#managecases .itemlist .listitem[data-title="%(case_name)s"] .action-delete')
_case_status_locator = (By.CSS_SELECTOR, '#managecases .itemlist .listitem[data-title="%(case_name)s"] .status-action')
+ _create_case_button_locator = (By.CSS_SELECTOR, '#managecases .create.single')
+ _create_bulk_cases_button_locator = (By.CSS_SELECTOR, '#managecases .create.bulk')
@property
def filter_form(self):
@@ -25,6 +27,16 @@ def go_to_manage_cases_page(self):
self.selenium.get(self.base_url + '/manage/cases/')
self.is_the_current_page
+ def click_create_case_button(self):
+ self.find_element(*self._create_case_button_locator).click()
+ from pages.create_case_page import MozTrapCreateCasePage
+ return MozTrapCreateCasePage(self.testsetup)
+
+ def click_create_bulk_cases_button(self):
+ self.find_element(*self._create_bulk_cases_button_locator).click()
+ from pages.create_bulk_cases_page import MozTrapCreateBulkCasesPage
+ return MozTrapCreateBulkCasesPage(self.testsetup)
+
def delete_case(self, name='Test Case'):
_delete_locator = (self._delete_case_locator[0], self._delete_case_locator[1] % {'case_name': name})
View
2  pages/page.py
@@ -107,6 +107,8 @@ def find_element(self, *locator):
def find_elements(self, *locator):
return self._selenium_root.find_elements(*locator)
+ def go_back(self):
+ self.selenium.back()
class PageRegion(Page):
View
35 tests/test_pinning_filters.py
@@ -47,6 +47,41 @@ def test_that_pinning_filter_on_product_version_set_defaults_in_new_run(self, mo
product_version_name,
u'default product version is incorrect')
+ @pytest.mark.moztrap(5932)
+ @pytest.mark.nondestructive
+ def test_that_pinning_filters_on_product_and_version_and_suite_set_defaults_in_new_case(self, mozwebqa_logged_in):
+ product = self.create_product(mozwebqa_logged_in)
+ version = product['version']
+ product_version_name = u'%s %s' % (product['name'], version['name'])
+ suite = self.create_suite(mozwebqa_logged_in, product=product)
+
+ from pages.manage_cases_page import MozTrapManageCasesPage
+ manage_cases_pg = MozTrapManageCasesPage(mozwebqa_logged_in)
+ manage_cases_pg.go_to_manage_cases_page()
+
+ filters = []
+ filters.append(manage_cases_pg.filter_form.filter_by(lookup='product', value=product['name']))
+ filters.append(manage_cases_pg.filter_form.filter_by(lookup='productversion', value=product_version_name))
+ filters.append(manage_cases_pg.filter_form.filter_by(lookup='suite', value=suite['name']))
+
+ for item in filters:
+ item.pin_filter()
+ Assert.equal(item.get_filter_color(), PINNED_FILTER_COLOR)
+
+ #go to create case page
+ create_case_pg = manage_cases_pg.click_create_case_button()
+ Assert.equal(create_case_pg.product_value, product['name'])
+ Assert.equal(create_case_pg.product_version_value, version['name'])
+ Assert.equal(create_case_pg.suite_value, suite['name'])
+
+ create_case_pg.go_back()
+
+ #go to create bulk cases page
+ create_bulk_cases_pg = manage_cases_pg.click_create_bulk_cases_button()
+ Assert.equal(create_bulk_cases_pg.product_value, product['name'])
+ Assert.equal(create_bulk_cases_pg.product_version_value, version['name'])
+ Assert.equal(create_bulk_cases_pg.suite_value, suite['name'])
+
@pytest.mark.moztrap(5936)
@pytest.mark.nondestructive
def test_that_pinning_filter_on_product_sets_defaults_in_new_product_version(self, mozwebqa_logged_in):
Please sign in to comment.
Something went wrong with that request. Please try again.