Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue #87. Moztrap #5930 #101

Merged
merged 7 commits into from

4 participants

@sashakruglov
Collaborator

https://moztrap.mozilla.org/manage/case/5930/

this test is not fast. there are 2 reasons for that:

  • test setup (need to create product, test cases and test suites)
  • web client is slow on filtering

hopefully with upcoming API we can speed it up.

@sashakruglov
Collaborator

About the second issue: we could ask devs to clean up the database on dev platform. It might improve performance.

@AlinT

Please resolve the merge conflicts.

@sashakruglov
Collaborator

Resolved merge conflicts

@AndreiH
Collaborator

merge conflicts again :)

@sashakruglov
Collaborator

I guess all others pull requests require updates as well.
I can update this one, and then wait until its merged, then update the next one and till there are none of outstanding PRs.

@sashakruglov
Collaborator

Fixed merge conflict. Again ;)

@AndreiH
Collaborator

I will try to find out if cleaning the database should be a better solution.

@AndreiH
Collaborator

Looks good to me, don't know what we can do to improve performance for now. Maybe somebody else would like something else to add/comment on this pull

@sashakruglov
Collaborator

@AndreiH I heard that @bobsilverberg is working on this problem.
And I'm trying to progress on moztrap restful API, but it requires some time before I can send a pull request for moztrap API client.

@sashakruglov
Collaborator

resolve merge conflicts in pull request.

@AndreiH
Collaborator

again nice pull @sashakruglov, this LGTM :)

@stephendonner

Merging per the r+

@stephendonner stephendonner merged commit ae4d5fa into from
@sashakruglov sashakruglov deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 30, 2013
  1. @sashakruglov
  2. @sashakruglov

    cleaned up

    sashakruglov authored
Commits on Feb 12, 2013
  1. @sashakruglov

    resolved merge conflicts

    sashakruglov authored
Commits on Feb 14, 2013
  1. @sashakruglov

    resolved merge conflict

    sashakruglov authored
Commits on Mar 10, 2013
  1. @sashakruglov

    resolved merge conflict

    sashakruglov authored
  2. @sashakruglov
  3. @sashakruglov

    remove duplicates in code

    sashakruglov authored
This page is out of date. Refresh to see the latest.
View
10 pages/manage_suites_page.py
@@ -22,11 +22,6 @@ class MozTrapManageSuitesPage(MozTrapBasePage):
def filter_form(self):
return Filter(self.testsetup)
- @property
- def test_suites(self):
- return [self.TestSuiteItem(self.testsetup, web_element)
- for web_element in self.find_elements(*self._test_suite_item_locator)]
-
def go_to_manage_suites_page(self):
self.selenium.get(self.base_url + '/manage/suites/')
self.is_the_current_page
@@ -51,6 +46,11 @@ def click_create_suite_button(self):
from pages.create_suite_page import MozTrapCreateSuitePage
return MozTrapCreateSuitePage(self.testsetup)
+ @property
+ def test_suites(self):
+ return [self.TestSuiteItem(self.testsetup, web_element)
+ for web_element in self.find_elements(*self._test_suite_item_locator)]
+
class TestSuiteItem(PageRegion):
_delete_suite_locator = (By.CSS_SELECTOR, '.action-delete')
View
21 pages/regions/filter.py
@@ -18,9 +18,10 @@ class Filter(Page):
_filter_suggestion_locator = (
By.CSS_SELECTOR,
'.textual .suggest .suggestion[data-type="%(filter_type)s"][data-name="%(filter_name)s"]')
- _filter_item_locator = (
+ _detailed_filter_item_locator = (
By.CSS_SELECTOR,
'input[data-name="%(filter_type)s"][value="%(filter_name)s"]:checked + .onoff')
+ _filter_item_locator = (By.CSS_SELECTOR, 'input:checked + .onoff')
def filter_by(self, lookup, value):
_suggestion_locator = (
@@ -36,8 +37,8 @@ def filter_by(self, lookup, value):
suggestion.click()
_filter_item_locator = (
- self._filter_item_locator[0],
- self._filter_item_locator[1] % {'filter_type': lookup, 'filter_name': data_id.lower()})
+ self._detailed_filter_item_locator[0],
+ self._detailed_filter_item_locator[1] % {'filter_type': lookup, 'filter_name': data_id.lower()})
self.wait_for_element_to_be_visible(*_filter_item_locator)
self.wait_for_ajax()
@@ -58,8 +59,8 @@ def filter_without_mouse_by(self, lookup, value):
suggestion.click()
_filter_item_locator = (
- self._filter_item_locator[0],
- self._filter_item_locator[1] % {'filter_type': lookup, 'filter_name': data_id.lower()})
+ self._detailed_filter_item_locator[0],
+ self._detailed_filter_item_locator[1] % {'filter_type': lookup, 'filter_name': data_id.lower()})
filter_input.send_keys(Keys.RETURN)
self.wait_for_element_to_be_visible(*_filter_item_locator)
@@ -69,11 +70,17 @@ def filter_without_mouse_by(self, lookup, value):
filter_item = self.find_element(*_filter_item_locator)
return FilterItem(self.testsetup, filter_item)
+ @property
+ def filter_items(self):
+ return [FilterItem(self.testsetup, web_element)
+ for web_element in self.find_elements(*self._filter_item_locator)]
+
class FilterItem(PageRegion):
_remove_button_locator = (By.CSS_SELECTOR, '.onoffswitch')
_pin_button_locator = (By.CSS_SELECTOR, '.pinswitch')
+ _filter_content_locator = (By.CSS_SELECTOR, '.content')
def pin_filter(self):
self.find_element(*self._pin_button_locator).click()
@@ -89,3 +96,7 @@ def get_filter_color(self, coding='hex'):
@property
def is_pinned(self):
return u'pinned' in self._selenium_root.get_attribute('className')
+
+ @property
+ def content_text(self):
+ return self.find_element(*self._filter_content_locator).text
View
69 tests/test_pinning_filters.py
@@ -47,6 +47,75 @@ 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(5930)
+ @pytest.mark.nondestructive
+ def test_that_pinning_name_field_filter_only_works_for_current_page(self, mozwebqa_logged_in):
+ good_case_name = u'MOZILLA'
+ good_suite_name = u'MozTrap'
+
+ product = self.create_product(mozwebqa_logged_in)
+ self.create_bulk_cases(mozwebqa_logged_in, name=good_case_name, product=product, cases_amount=3)
+ self.create_bulk_cases(mozwebqa_logged_in, name=u'ALLIZOM', product=product, cases_amount=2)
+ self.create_suite(mozwebqa_logged_in, name=good_suite_name, product=product)
+ self.create_suite(mozwebqa_logged_in, name=u'PartZom', product=product)
+
+ from pages.manage_cases_page import MozTrapManageCasesPage
+ manage_cases_pg = MozTrapManageCasesPage(mozwebqa_logged_in)
+ manage_cases_pg.go_to_manage_cases_page()
+
+ #filter cases by name and assert that only cases with mozilla in their name are found
+ cases_filter = manage_cases_pg.filter_form.filter_by(lookup='name', value=good_case_name)
+ Assert.equal(cases_filter.content_text, good_case_name.lower())
+ Assert.not_equal(cases_filter.get_filter_color(), PINNED_FILTER_COLOR)
+ for case in manage_cases_pg.test_cases:
+ Assert.contains(good_case_name, case.name)
+
+ #pin filter and assert that it turns orange
+ cases_filter.pin_filter()
+ Assert.equal(cases_filter.get_filter_color(), PINNED_FILTER_COLOR)
+
+ from pages.manage_suites_page import MozTrapManageSuitesPage
+ manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
+ manage_suites_pg.go_to_manage_suites_page()
+
+ #check that there is no filters applied
+ Assert.equal(manage_suites_pg.filter_form.filter_items, [])
+
+ #filter suites by name and assert that only suites with moztrap in their name are found
+ suites_filter = manage_suites_pg.filter_form.filter_by(lookup='name', value=good_suite_name)
+ Assert.equal(suites_filter.content_text, good_suite_name.lower())
+ Assert.not_equal(suites_filter.get_filter_color(), PINNED_FILTER_COLOR)
+ for suite in manage_suites_pg.test_suites:
+ Assert.contains(good_suite_name, suite.name)
+
+ #pin filter and assert that it turns orange
+ suites_filter.pin_filter()
+ Assert.equal(suites_filter.get_filter_color(), PINNED_FILTER_COLOR)
+
+ #and check everything again on manage cases page
+ manage_cases_pg.go_to_manage_cases_page()
+ applied_filter = manage_cases_pg.filter_form.filter_items
+ Assert.equal(len(applied_filter), 1)
+ Assert.equal(applied_filter[0].content_text, good_case_name.lower())
+ for case in manage_cases_pg.test_cases:
+ Assert.contains(good_case_name, case.name)
+
+ #and check everything one more time on manage suites page
+ manage_suites_pg.go_to_manage_suites_page()
+ applied_filter = manage_suites_pg.filter_form.filter_items
+ Assert.equal(len(applied_filter), 1)
+ Assert.equal(applied_filter[0].content_text, good_suite_name.lower())
+ for suite in manage_suites_pg.test_suites:
+ Assert.contains(good_suite_name, suite.name)
+
+ #and go to manage runs page and see no filters there
+ from pages.manage_runs_page import MozTrapManageRunsPage
+ manage_runs_pg = MozTrapManageRunsPage(mozwebqa_logged_in)
+ manage_runs_pg.go_to_manage_runs_page()
+
+ #check that there is no filters applied
+ Assert.equal(manage_runs_pg.filter_form.filter_items, [])
+
@pytest.mark.moztrap(5933)
@pytest.mark.nondestructive
def test_that_pinning_filters_on_product_sets_defaults_in_new_suite(self, mozwebqa_logged_in):
Something went wrong with that request. Please try again.