Permalink
Browse files

Split by file in 6 different files

  • Loading branch information...
1 parent 574d9e9 commit 3c31d76e8707c2798d79d9bfed263897cdb7a5fa alintrif committed Jun 18, 2012
@@ -141,8 +141,8 @@ def signature(self):
def click_signature(self):
self._columns[1].find_element(*self._link_locator).click()
- from pages.crash_stats_by_page import CrashStatsSignatureReport
- return CrashStatsSignatureReport(self.testsetup)
+ from pages.signature_report_page import SignatureReport
+ return SignatureReport(self.testsetup)
@property
def is_plugin_icon_visible(self):
View
@@ -114,19 +114,19 @@ def select_report(self, report_name):
select.select_by_visible_text(report_name)
if 'Top Crashers' == report_name:
- from pages.crash_stats_by_page import CrashStatsTopCrashers
+ from pages.crash_stats_top_crashers_page import CrashStatsTopCrashers
return CrashStatsTopCrashers(self.testsetup)
elif 'Top Crashers by TopSite' == report_name:
- from pages.crash_stats_by_page import CrashStatsTopCrashersBySite
+ from pages.crash_stats_top_crashers_by_site_page import CrashStatsTopCrashersBySite
return CrashStatsTopCrashersBySite(self.testsetup)
elif 'Crashes per User' == report_name:
- from pages.crash_stats_by_page import CrashStatsPerActiveDailyUser
+ from pages.crash_stats_per_active_daily_user_page import CrashStatsPerActiveDailyUser
return CrashStatsPerActiveDailyUser(self.testsetup)
elif 'Nightly Builds' == report_name:
- from pages.crash_stats_by_page import CrashStatsNightlyBuilds
+ from pages.crash_stats_nightly_builds_page import CrashStatsNightlyBuilds
return CrashStatsNightlyBuilds(self.testsetup)
elif 'Top Changers' == report_name:
- from pages.crash_stats_by_page import CrashStatsTopChangers
+ from pages.crash_stats_top_changers_page import CrashStatsTopChangers
return CrashStatsTopChangers(self.testsetup)
def search_for_crash(self, crash_id_or_signature):
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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 CrashStatsBasePage
+
+
+class CrashStatsNightlyBuilds(CrashStatsBasePage):
+
+ _link_to_ftp_locator = (By.CSS_SELECTOR, '.notitle > p > a')
+
+ @property
+ def link_to_ftp(self):
+ return self.selenium.find_element(*self._link_to_ftp_locator).get_attribute('href')
+
+ def click_link_to_ftp(self):
+ self.selenium.find_element(*self._link_to_ftp_locator).click()
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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 selenium.webdriver.support.select import Select
+
+from pages.base_page import CrashStatsBasePage
+
+
+class CrashStatsPerActiveDailyUser(CrashStatsBasePage):
+
+ _page_title = 'Crashes per Active Daily User for Firefox'
+
+ _product_select_locator = (By.ID, 'daily_search_version_form_products')
+ _date_start_locator = (By.CSS_SELECTOR, '.daily_search_body .date[name="date_start"]')
+ _generate_button_locator = (By.ID, 'daily_search_version_form_submit')
+ _table_locator = (By.ID, 'crash_data')
+ _row_table_locator = (By.CSS_SELECTOR, '#crash_data > tbody > tr')
+ _last_row_date_locator = (By.CSS_SELECTOR, '#crash_data > tbody > tr > td:nth-child(1):not(:last):last')
+
+ @property
+ def product_select(self):
+ element = self.selenium.find_element(*self._product_select_locator)
+ select = Select(element)
+ return select.first_selected_option.text
+
+ def type_start_date(self, date):
+ date_element = self.selenium.find_element(*self._date_start_locator)
+ date_element.clear()
+ date_element.send_keys(date)
+
+ def click_generate_button(self):
+ self.selenium.find_element(*self._generate_button_locator).click()
+
+ @property
+ def is_mixed_content_warning_shown(self):
+ return self.is_alert_present()
+
+ @property
+ def is_table_visible(self):
+ return self.is_element_visible(None, *self._table_locator)
+
+ @property
+ def table_row_count(self):
+ return len(self.selenium.find_elements(self._row_table_locator))
+
+ @property
+ def last_row_date_value(self):
+ return self.selenium.find_element(*self._last_row_date_locator).text
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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 pages.base_page import CrashStatsBasePage
+
+
+class CrashStatsTopChangers(CrashStatsBasePage):
+
+ pass
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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 CrashStatsBasePage
+
+
+class CrashStatsTopCrashersBySite(CrashStatsBasePage):
+
+ _product_header_locator = (By.ID, 'tcburl-product')
+ _product_version_header_locator = (By.ID, 'tcburl-version')
+
+ @property
+ def product_header(self):
+ return self.selenium.find_element(*self._product_header_locator).text
+
+ @property
+ def product_version_header(self):
+ return self.selenium.find_element(self._product_version_header_locator).text
@@ -1,73 +1,16 @@
#!/usr/bin/env python
+
# This Source Code Form is subject to the terms of the Mozilla Public
# 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 selenium.webdriver.support.select import Select
from selenium.common.exceptions import NoSuchElementException
from pages.base_page import CrashStatsBasePage
from pages.page import Page
-class CrashStatsSignatureReport(CrashStatsBasePage):
-
- # https://crash-stats.allizom.org/report/list?
-
- _total_items_locator = (By.CSS_SELECTOR, 'span.totalItems')
- _reports_page_locator = (By.CSS_SELECTOR, '.ui-state-default.ui-corner-top:nth-of-type(4) > a > span')
-
- def click_reports(self):
- self.selenium.find_element(*self._reports_page_locator).click()
-
- @property
- def total_items_label(self):
- return self.selenium.find_element(*self._total_items_locator).text.replace(",", "")
-
-
-class CrashStatsPerActiveDailyUser(CrashStatsBasePage):
-
- _page_title = 'Crashes per Active Daily User for Firefox'
-
- _product_select_locator = (By.ID, 'daily_search_version_form_products')
- _date_start_locator = (By.CSS_SELECTOR, '.daily_search_body .date[name="date_start"]')
- _generate_button_locator = (By.ID, 'daily_search_version_form_submit')
- _table_locator = (By.ID, 'crash_data')
- _row_table_locator = (By.CSS_SELECTOR, '#crash_data > tbody > tr')
- _last_row_date_locator = (By.CSS_SELECTOR, '#crash_data > tbody > tr > td:nth-child(1):not(:last):last')
-
- @property
- def product_select(self):
- element = self.selenium.find_element(*self._product_select_locator)
- select = Select(element)
- return select.first_selected_option.text
-
- def type_start_date(self, date):
- date_element = self.selenium.find_element(*self._date_start_locator)
- date_element.clear()
- date_element.send_keys(date)
-
- def click_generate_button(self):
- self.selenium.find_element(*self._generate_button_locator).click()
-
- @property
- def is_mixed_content_warning_shown(self):
- return self.is_alert_present()
-
- @property
- def is_table_visible(self):
- return self.is_element_visible(None, *self._table_locator)
-
- @property
- def table_row_count(self):
- return len(self.selenium.find_elements(self._row_table_locator))
-
- @property
- def last_row_date_value(self):
- return self.selenium.find_element(*self._last_row_date_locator).text
-
-
class CrashStatsTopCrashers(CrashStatsBasePage):
_page_heading_product_locator = (By.ID, 'current-product')
@@ -162,34 +105,3 @@ def is_plugin_icon_visible(self):
@property
def is_browser_icon_visible(self):
return self.is_element_visible(self._root_element, *self._browser_icon_locator)
-
-
-class CrashStatsTopCrashersBySite(CrashStatsBasePage):
-
- _product_header_locator = (By.ID, 'tcburl-product')
- _product_version_header_locator = (By.ID, 'tcburl-version')
-
- @property
- def product_header(self):
- return self.selenium.find_element(*self._product_header_locator).text
-
- @property
- def product_version_header(self):
- return self.selenium.find_element(self._product_version_header_locator).text
-
-
-class CrashStatsNightlyBuilds(CrashStatsBasePage):
-
- _link_to_ftp_locator = (By.CSS_SELECTOR, '.notitle > p > a')
-
- @property
- def link_to_ftp(self):
- return self.selenium.find_element(*self._link_to_ftp_locator).get_attribute('href')
-
- def click_link_to_ftp(self):
- self.selenium.find_element(*self._link_to_ftp_locator).click()
-
-
-class CrashStatsTopChangers(CrashStatsBasePage):
-
- pass
View
@@ -46,5 +46,5 @@ def product_version_label(self):
def click_top_crasher(self):
self._root_element.find_element(*self._top_crashers_link_locator).click()
- from pages.crash_stats_by_page import CrashStatsTopCrashers
+ from pages.crash_stats_top_crashers_page import CrashStatsTopCrashers
return CrashStatsTopCrashers(self.testsetup)
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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 CrashStatsBasePage
+
+
+class SignatureReport(CrashStatsBasePage):
+
+ # https://crash-stats.allizom.org/report/list?
+
+ _total_items_locator = (By.CSS_SELECTOR, 'span.totalItems')
+ _reports_page_locator = (By.CSS_SELECTOR, '.ui-state-default.ui-corner-top:nth-of-type(4) > a > span')
+
+ def click_reports(self):
+ self.selenium.find_element(*self._reports_page_locator).click()
+
+ @property
+ def total_items_label(self):
+ return self.selenium.find_element(*self._total_items_locator).text.replace(",", "")
View
@@ -8,7 +8,7 @@
from unittestzero import Assert
from pages.home_page import CrashStatsHomePage
-from pages.crash_stats_by_page import CrashStatsTopCrashers
+from pages.crash_stats_top_crashers_page import CrashStatsTopCrashers
xfail = pytest.mark.xfail

0 comments on commit 3c31d76

Please sign in to comment.