Permalink
Browse files

Merge pull request #103 from sashakruglov/moztrap_5933

Issue #87. Moztrap #5933
  • Loading branch information...
AlinT committed Mar 7, 2013
2 parents 9e14ad4 + 9d996c7 commit 0962853ddfca3937bdac796d6fdd97f87ca03c02
Showing with 42 additions and 0 deletions.
  1. +5 −0 pages/create_suite_page.py
  2. +6 −0 pages/manage_suites_page.py
  3. +31 −0 tests/test_pinning_filters.py
@@ -53,3 +53,8 @@ def create_suite(self, name='Test Suite', product='Test Product', desc='This is
self.selenium.find_element(*self._submit_locator).click()
return suite
+
+ @property
+ def product_name_value(self):
+ product_select = self.find_element(*self._product_select_locator)
+ return product_select.find_element(By.CSS_SELECTOR, 'option:checked').text
@@ -15,6 +15,7 @@ class MozTrapManageSuitesPage(MozTrapBasePage):
_page_title = 'Manage-Suites'
+ _create_suite_button_locator = (By.CSS_SELECTOR, '#managesuites .create.single')
_test_suite_item_locator = (By.CSS_SELECTOR, '#manage-suites-form .listitem')
@property
@@ -45,6 +46,11 @@ def _get_suite(self, name):
return suite
raise NameError(u'test suite with %s name not found' % name)
+ def click_create_suite_button(self):
+ self.find_element(*self._create_suite_button_locator).click()
+ from pages.create_suite_page import MozTrapCreateSuitePage
+ return MozTrapCreateSuitePage(self.testsetup)
+
class TestSuiteItem(PageRegion):
_delete_suite_locator = (By.CSS_SELECTOR, '.action-delete')
@@ -47,6 +47,37 @@ 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(5933)
+ @pytest.mark.nondestructive
+ def test_that_pinning_filters_on_product_sets_defaults_in_new_suite(self, mozwebqa_logged_in):
+ product = self.create_product(mozwebqa_logged_in)
+
+ from pages.manage_suites_page import MozTrapManageSuitesPage
+ manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
+ manage_suites_pg.go_to_manage_suites_page()
+ filter_item = manage_suites_pg.filter_form.filter_by(lookup='product', value=product['name'])
+
+ #check that filter is not orange before it's pinned
+ Assert.not_equal(
+ filter_item.get_filter_color(),
+ PINNED_FILTER_COLOR,
+ u'filter is orange before it was pinned')
+
+ filter_item.pin_filter()
+
+ #check that filter is orange after it's been pinned
+ Assert.equal(
+ filter_item.get_filter_color(),
+ PINNED_FILTER_COLOR,
+ u'pinned filter\'s color is not orange')
+
+ create_suite_pg = manage_suites_pg.click_create_suite_button()
+
+ Assert.equal(
+ create_suite_pg.product_name_value,
+ product['name'],
+ u'default product 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):

0 comments on commit 0962853

Please sign in to comment.