QA/Execution/Web Testing/Docs/Automation/Testcases/AMO POM Libraries: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
= AMO Page Object Model classes =
= AMO Page Object Model classes =
* Utilites
* Base page class
* AMO pages class


* Search results pages
*[[QA/Execution/Web Testing/Docs/Automation/Testcases/AMO POM Libraries/Utilities|Utilities]]
*Base page class
*AMO pages class


*Search results pages
<br>


== Extensions search results page  ==
== Extensions search results page  ==


'''Search results for extensions and themes'''
'''Search results for extensions and themes'''  


=== Get data from page  ===
=== Get data from page  ===
Line 30: Line 32:
**If the extension is not found on a page and the page has no link to the Next page then (0,0) is returned.
**If the extension is not found on a page and the page has no link to the Next page then (0,0) is returned.


=== Get data from an extension ===
=== Get data from an extension ===
 
The following get_extension_x methods return an element from an extension from the current page. The value is retrieved from the ''listing_index''-th item.  
The following get_extension_x methods return an element from an extension from the current page. The value is retrieved from the ''listing_index''-th item.  


Line 38: Line 40:
*Returns the text from the name element
*Returns the text from the name element


'''get_extension_name_link'''( '' listing_index'' )
'''get_extension_name_link'''( ''listing_index'' )  


*Returns the href attribute in the name element
*Returns the href attribute in the name element


'''get_extension_image_link'''( ''listing_index'' )
'''get_extension_image_link'''( ''listing_index'' )  


*Returns the href attribute in the image element
*Returns the href attribute in the image element


'''get_extension_info'''( ''listing_index'' )
'''get_extension_info'''( ''listing_index'' )  


*Returns the text on the info element
*Returns the text on the info element


'''get_extension_rating_title'''( ''listing_index'' )
'''get_extension_rating_title'''( ''listing_index'' )  


*Returns the title attribute in the rating element
*Returns the title attribute in the rating element


'''get_extension_updated_date_as_date'''( ''listing_index'' )
'''get_extension_updated_date_as_date'''( ''listing_index'' )  


*Returns the date with the Updated label from the info section. Value is returned as a date type.
*Returns the date with the Updated label from the info section. Value is returned as a date type.


'''get_extension_review_count_as_integer'''( ''listing_index'' )
'''get_extension_review_count_as_integer'''( ''listing_index'' )  


*Returns the count with the Reviews label from the info section. Value is returned as an integer.
*Returns the count with the Reviews label from the info section. Value is returned as an integer.


'''get_extension_download_count_as_integer'''( ''listing_index'' )
'''get_extension_download_count_as_integer'''( ''listing_index'' )  


*Returns the count with the Weekly Downloads label from the info section. Value is returned as an integer.
*Returns the count with the Weekly Downloads label from the info section. Value is returned as an integer.


=== Actions ===
=== Actions ===
           
 
''' click_sort_option_in_header'''( ''sort_option'' )
'''click_sort_option_in_header'''( ''sort_option'' )  
* Clicks on a sort option in the listing header. Clicks on the sort option link which contains ?sort=''sort_option'' in its href.
 
*Clicks on a sort option in the listing header. Clicks on the sort option link which contains&nbsp;?sort=''sort_option'' in its href.

Revision as of 21:12, 8 October 2010

AMO Page Object Model classes

  • Search results pages


Extensions search results page

Search results for extensions and themes

Get data from page

get_extension_count( )

  • Returns the number of extensions listed on the current page. Value is returned as an integer.

find_extension_in_search_results( extension_name, extension_url, console_trace=False )

  • Returns the tuple (p, e) where p is the page the extension was found and i is the index on the page. An exception is thrown if extension is not found on any pages.
  • Parameters:
    • extension_name: text on name element which must match exactly.
    • extension_url: href attribute on name element which must match exactly.
    • console_trace: If True console prints will display the search results as they are checked. If False no console prints occur.
  • Other notes:
    • Either extension_name or extension_url must be supplied.
    • The method assumes that search results are currently displayed.
    • If the extension is not found on the first page the methods selects the Next link in the listing footer, if it exists, to display the next page.
    • If the extension is not found on a page and the page has no link to the Next page then (0,0) is returned.

Get data from an extension

The following get_extension_x methods return an element from an extension from the current page. The value is retrieved from the listing_index-th item.

get_extension_name( listing_index )

  • Returns the text from the name element

get_extension_name_link( listing_index )

  • Returns the href attribute in the name element

get_extension_image_link( listing_index )

  • Returns the href attribute in the image element

get_extension_info( listing_index )

  • Returns the text on the info element

get_extension_rating_title( listing_index )

  • Returns the title attribute in the rating element

get_extension_updated_date_as_date( listing_index )

  • Returns the date with the Updated label from the info section. Value is returned as a date type.

get_extension_review_count_as_integer( listing_index )

  • Returns the count with the Reviews label from the info section. Value is returned as an integer.

get_extension_download_count_as_integer( listing_index )

  • Returns the count with the Weekly Downloads label from the info section. Value is returned as an integer.

Actions

click_sort_option_in_header( sort_option )

  • Clicks on a sort option in the listing header. Clicks on the sort option link which contains ?sort=sort_option in its href.