QA/Execution/Web Testing/Docs/Automation/Testcases/AMO POM Libraries: Difference between revisions
< QA | Execution | Web Testing | Docs/Automation | Testcases
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
'''Search results for extensions and themes''' | '''Search results for extensions and themes''' | ||
=== Get data from page === | === Get data from page === | ||
'''get_extension_count'''( ) | |||
'''find_extension_in_search_results'''( ''extension_name'', ''extension_url'', ''console_trace=False'' ) | *Returns the number of extensions listed on the current page. Value is returned as an integer. | ||
* Returns the tuple (p, e) where ''p'' is the page the extension was found and ''i'' is the index on the page. | |||
* Parameters: | '''find_extension_in_search_results'''( ''extension_name'', ''extension_url'', ''console_trace=False'' ) | ||
** extension_name: text on name element which must match exactly. | |||
** extension_url: href attribute on name element which must match exactly. | *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. | ||
** console_trace: If True console prints will display the search results as they are checked. | *Parameters: | ||
* Other notes: | **extension_name: text on name element which must match exactly. | ||
** Either extension_name or extension_url must be supplied. | **extension_url: href attribute on name element which must match exactly. | ||
** The method assumes that search results are currently displayed. | **console_trace: If True console prints will display the search results as they are checked. If False no console prints occur. | ||
** 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. | *Other notes: | ||
** If the extension is not found on a page and the page has no link to the Next page then (0,0) is returned. | **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 === | === Get data from an extension === |
Revision as of 00:15, 1 October 2010
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.