Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'rbillings/manage_suites' into webdriver

  • Loading branch information...
commit c1eef2b1f0d170d48b62ba9a89b35987c0aa6206 2 parents f089e30 + 1033381
Zac authored
Showing with 17 additions and 18 deletions.
  1. +17 −18 pages/manage_suites_page.py
View
35 pages/manage_suites_page.py
@@ -4,6 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+from selenium.webdriver.common.by import By
+
from pages.base_page import MozTrapBasePage
@@ -11,35 +13,32 @@ class MozTrapManageSuitesPage(MozTrapBasePage):
_page_title = 'MozTrap'
- _delete_suite_locator = u'css=#managesuites .itemlist .listitem[data-title="%(suite_name)s"] .action-delete'
- _suite_status_locator = u'css=#managesuites .itemlist .listitem[data-title="%(suite_name)s"] .status-action'
- _filter_input_locator = 'id=text-filter'
- _filter_suggestion_locator = u'css=#filter .textual .suggest .suggestion[data-type="name"][data-name="%(filter_name)s"]'
- _filter_locator = u'css=#filterform .filter-group input[data-name="name"][value="%(filter_name)s"]:checked'
+ _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')
+ _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')
def go_to_manage_suites_page(self):
- self.selenium.open('/manage/suites/')
+ self.selenium.get(self.base_url + '/manage/suites/')
self.is_the_current_page
def delete_suite(self, name='Test Suite'):
- _delete_locator = self._delete_suite_locator % {'suite_name': name}
+ _delete_locator = (self._delete_suite_locator[0], self._delete_product_locator[1] % {'suite_name': name})
- self.click(_delete_locator)
+ self.selenium.find_element(*self._delete_locator).click()
self.wait_for_ajax()
def filter_suites_by_name(self, name):
- _filter_locator = self._filter_locator % {'filter_name': name.lower()}
- _filter_suggestion_locator = self._filter_suggestion_locator % {'filter_name': name}
-
- self.type(self._filter_input_locator, name)
- self.selenium.type_keys(self._filter_input_locator, name)
- self.wait_for_element_present(_filter_suggestion_locator)
- self.click(_filter_suggestion_locator)
- self.wait_for_element_present(_filter_locator)
+ _filter_locator = (self._filter_locator[0], self._filter_locator[1] % {'filter_name': name.lower()})
+ _filter_suggestion_locator = (self._filter_suggestion_locator[0], self._filter_suggestion_locator[1] % {'filter_name': name})
+
+ self.selenium.find_element(*self._filter_input_locator).send_keys(name)
+ self.selenium.find_element(*self._filter_suggestion_locator).click()
self.wait_for_ajax()
def activate_suite(self, name='Test Suite'):
- _suite_status_locator = self._suite_status_locator % {'suite_name': name}
+ _suite_status_locator = (self._suite_status_locator[0], self._suite_status_locator[1] % {'suite_name': name})
- self.click(_suite_status_locator)
+ self.selenium.find_element(*self._suite_status_locator).click()
self.wait_for_ajax()
Please sign in to comment.
Something went wrong with that request. Please try again.