Class | UnstickyCookieHTTPCaller | HTTPCaller subclass that do not carry cookies across requests. |
Class | LaunchpadWebServiceCaller | A class for making calls to Launchpad web services. |
Function | extract_url_parameter | Extract parameter and its value from a URL. |
Class | DuplicateIdError | Raised by find_tag_by_id if more than one element has the given id. |
Function | find_tag_by_id | Find and return the tag with the given ID |
Function | first_tag_by_class | Find and return the first tag matching the given class(es) |
Function | find_tags_by_class | Find and return one or more tags matching the given class(es) |
Function | find_portlet | Find and return the portlet with the given title. Sequences of |
Function | find_main_content | Return the main content of the page, excluding any portlets. |
Function | get_feedback_messages | Find and return the feedback messages of the page. |
Function | print_feedback_messages | Print out the feedback messages. |
Function | print_table | Given a <table> print the content of each row. |
Function | get_radio_button_text_for_field | Find the input called field.name, and return an iterable of strings. |
Function | print_radio_button_field | Find the input called field.name, and print a friendly representation. |
Function | strip_label | Strip surrounding whitespace and non-breaking spaces. |
Function | extract_link_from_tag | Return a link from <a> tag , optionally considered relative to base . |
Function | extract_text | Return the text stripped of all tags. |
Function | parse_relationship_section | Parser package relationship section. |
Function | print_action_links | Print action menu urls. |
Function | print_navigation_links | Print navigation menu urls. |
Function | print_portlet_links | Print portlet urls. |
Function | print_submit_buttons | Print the submit button values found in the main content. |
Function | print_comments | Print the comments on a BugTask index page. |
Function | print_batch_header | Print the batch navigator header. |
Function | print_self_link_of_entries | Print the self_link attribute of each entry in the given JSON body. |
Function | print_ppa_packages | Undocumented |
Function | print_location | Print the hierarchy, application tabs, and main heading of the page. |
Function | print_location_apps | Print the application tabs' text and URL. |
Function | print_tag_with_id | A simple helper to print the extracted text of the tag. |
Function | print_errors | Print all the errors on the page. |
Function | setupBrowser | Create a testbrowser object for use in pagetests. |
Function | setupBrowserForUser | Setup a browser grabbing details from a user. |
Function | setupBrowserFreshLogin | Create a test browser with a recently logged in user. |
Function | safe_canonical_url | Generate a bytestring URL for an object |
Function | webservice_for_person | Return a valid LaunchpadWebServiceCaller for the person. |
Function | setupDTCBrowser | Testbrowser configured for Distribution Translations Coordinators. |
Function | setupRosettaExpertBrowser | Testbrowser configured for Rosetta Experts. |
Function | permissive_security_policy | Context manager to run code with a permissive security policy. |
Function | setUpGlobs | Undocumented |
Function | PageTestSuite | Create a suite of page tests for files found in storydir. |
Use this if your test needs to inspect a parameter value embedded in a URL, but doesn't really care what the rest of the URL looks like or how the parameters are ordered.
Given a <table> print the content of each row. The table is printed using `sep` as the separator. :param columns a list of the column numbers (zero-based) to be included in the output. If None all columns are printed. :param skip_rows a list of row numbers (zero-based) to be skipped. If None no rows are skipped. :param sep the separator to be used between output items.
The resulting output will look something like: ['(*) A checked option', '( ) An unchecked option']
The resulting output will look something like: (*) A checked option ( ) An unchecked option
tag
, optionally considered relative to base
.
A tag
should contain a 'href' attribute, and base
will commonly
be extracted from browser.url.
All runs of tabs and spaces are replaced by a single space and runs of newlines are replaced by a single newline. Leading and trailing white spaces are stripped.
See package-relationship-pages.txt and related.
Print portlet urls. This function expects the browser.content as well as the h2 name of the portlet. base is optional. It will locate the portlet and print out the links. It will report if the portlet cannot be found and will also report if there are no links to be found. Unlike the other functions on this page, this looks for "a" instead of "li". Example usage: -------------- >>> print_portlet_links(admin_browser.contents,'Milestone milestone3 for Ubuntu details') Ubuntu: /ubuntu Warty: /ubuntu/warty --------------
Use this to check that the buttons on a page match your expectations.
The hierarchy shows your position in the Launchpad structure: for example, Ubuntu > 8.04. The application tabs represent the major facets of an object: for example, Overview, Bugs, and Translations. The main heading is the first <h1> element in the page.
Parameters | auth | HTTP authentication string. None for the anonymous user, or a string of the form 'Basic email:password' for an authenticated user. |
Returns | A Browser object. |
Parameters | user | The user to use. |
The request is not shared by the browser, so we create a session of the test request and set a cookie to reference the session in the test browser.
Use this method to create a way to test the webservice that doesn't depend on sample data.
Ubuntu is the configured distribution.
This is just enough to run code such as BaseMailer
that normally
expects to be called only from environments that use a permissive
security policy, such as jobs or scripts.
Each file is added as a separate DocFileTest.
Parameters | storydir | the directory containing the page tests. |
package | the package to resolve storydir relative to. Defaults to the caller's package. |