Skip to content

Commit

Permalink
New crash report class
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Markus committed Aug 15, 2011
1 parent 2478dbf commit e3d7ff7
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions crash_stats_page.py
Expand Up @@ -170,7 +170,6 @@ class CrashStatsHomePage(CrashStatsBasePage):
_first_product_top_crashers_link_locator = 'css=#release_channels .release_channel:first li:first a'
_first_signature_locator = 'css=div.crash > p > a'
_second_signature_locator = 'css=.crash:nth(2) > p > a'
_signature_locator = 'css=#signatureList tbody tr:nth-of-type(%s) td:nth-of-type(5) a.signature'
_right_column_locator = 'css=div.product_topcrasher > h4'
_centre_column_locator = 'css=div.product_topcrasher + div > h4'
_left_column_locator = 'css=div.product_topcrasher + div + div > h4'
Expand Down Expand Up @@ -230,15 +229,15 @@ def click_first_product_top_crashers_link(self):
self.sel.click(self._first_product_top_crashers_link_locator)
self.sel.wait_for_page_to_load(self.timeout)

def get_signature(self, index):
return self.sel.get_text(self._signature_locator % index)
def get_report(self, index):
return CrashReport(self.testsetup, count)

@property
def first_non_null_signature(self):
count = 1
while self.get_signature(count) == "(empty signature)":
while CrashReport(self.testsetup, count).has_empty_signature:
count += 1
return self.get_signature(count)
return CrashReport(self.testsetup, count).signature

@property
def get_product_list(self):
Expand All @@ -265,6 +264,27 @@ def left_column_heading(self):
return self.sel.get_text(self._left_column_locator)[:-9]


class CrashReport(CrashStatsBasePage):

_crash_report_locator = "css=#signatureList tbody tr:nth-of-type(%s)"
_signature_locator = _crash_report_locator + " td:nth-of-type(5) a.signature"
_index = 0

def __init__(self, testsetup, index):
CrashStatsBasePage.__init__(self, testsetup)
self._index = index

@property
def signature(self):
return self.sel.get_text(self._signature_locator % self._index)

@property
def has_empty_signature(self):
if(self.signature == "empty signature"):
return True
return False


class CrashStatsAdvancedSearch(CrashStatsBasePage):

_product_multiple_select = 'id=product'
Expand Down

0 comments on commit e3d7ff7

Please sign in to comment.