Permalink
Browse files

Issue #87. Moztrap #5933

  • Loading branch information...
1 parent b010f06 commit e12d26b737a94a0d0c381d9471f46c2e7acb1b37 @sashakruglov committed Jan 30, 2013
Showing with 46 additions and 7 deletions.
  1. +5 −0 pages/create_suite_page.py
  2. +6 −0 pages/manage_suites_page.py
  3. +35 −7 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_value(self):
+ product_select = self.find_element(*self._product_select_locator)
+ return Select(product_select).first_selected_option.text
@@ -17,6 +17,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'))
+ _create_suite_button_locator = (By.CSS_SELECTOR, '#managesuites .create.single')
@property
def filter_form(self):
@@ -43,3 +44,8 @@ def view_cases(self, name='Test Suite'):
self.selenium.find_element(*_view_cases_locator).click()
from pages.manage_cases_page import MozTrapManageCasesPage
return MozTrapManageCasesPage(self.testsetup)
+
+ 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)
@@ -5,41 +5,69 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
-
from unittestzero import Assert
from pages.base_test import BaseTest
-from pages.manage_runs_page import MozTrapManageRunsPage
+
+
+PINNED_FILTER_COLOR = u'#DFB081'
class TestPinningFilters(BaseTest):
@pytest.mark.moztrap(5935)
@pytest.mark.nondestructive
def test_that_pinning_filter_on_product_version_set_defaults_in_new_run(self, mozwebqa_logged_in):
- pinned_filter_color = u'#DFB081'
product = self.create_product(mozwebqa_logged_in)
product_version_name = u'%s %s' % (product['name'], product['version']['name'])
+ from pages.manage_runs_page import MozTrapManageRunsPage
manage_runs_pg = MozTrapManageRunsPage(mozwebqa_logged_in)
manage_runs_pg.go_to_manage_runs_page()
- filter_item = manage_runs_pg.filter_form.filter_by(
- lookup='productversion', value=product_version_name)
+ filter_item = manage_runs_pg.filter_form.filter_by(lookup='productversion', value=product_version_name)
#check that filter is not orange before it's pinned
Assert.not_equal(
filter_item.get_filter_color(),
- pinned_filter_color)
+ PINNED_FILTER_COLOR)
filter_item.pin_filter()
#check that filter is orange after it's been pinned
Assert.equal(
filter_item.get_filter_color(),
- pinned_filter_color)
+ PINNED_FILTER_COLOR)
create_run_pg = manage_runs_pg.click_create_run_button()
Assert.equal(
create_run_pg.product_version,
product_version_name)
+
+ @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)
+
+ filter_item.pin_filter()
+
+ #check that filter is orange after it's been pinned
+ Assert.equal(
+ filter_item.get_filter_color(),
+ PINNED_FILTER_COLOR)
+
+ create_suite_pg = manage_suites_pg.click_create_suite_button()
+
+ Assert.equal(
+ create_suite_pg.product_value,
+ product['name'])

0 comments on commit e12d26b

Please sign in to comment.