Package trac :: Package tests :: Package functional :: Module tester :: Class FunctionalTester

Class FunctionalTester

source code

object --+
         |
        FunctionalTester

Provides a library of higher-level operations for interacting with a
test environment.

It makes assumptions such as knowing what ticket number is next, so
avoid doing things manually in a :class:`FunctionalTestCase` when you can.

Instance Methods
 
__init__(self, url)
Create a :class:`FunctionalTester` for the given Trac URL and...
source code
 
login(self, username)
Login as the given user
source code
 
logout(self)
Logout
source code
 
create_ticket(self, summary=None, info=None)
Create a new (random) ticket in the test environment.
source code
 
quickjump(self, search)
Do a quick search to jump to a page.
source code
 
go_to_url(self, url) source code
 
go_to_front(self)
Go to the Trac front page
source code
 
go_to_ticket(self, ticketid=None)
Surf to the page for the given ticket ID, or to the NewTicket page if ticketid is not specified or is None.
source code
 
go_to_wiki(self, name, version=None)
Surf to the wiki page.
source code
 
go_to_timeline(self)
Surf to the timeline page.
source code
 
go_to_view_tickets(self, href='report')
Surf to the View Tickets page.
source code
 
go_to_query(self)
Surf to the custom query page.
source code
 
go_to_admin(self, panel_label=None)
Surf to the webadmin page.
source code
 
go_to_roadmap(self)
Surf to the roadmap page.
source code
 
go_to_milestone(self, name)
Surf to the specified milestone page.
source code
 
go_to_report(self, id, args=None)
Surf to the specified report.
source code
 
go_to_preferences(self, panel_label=None)
Surf to the preferences page.
source code
 
add_comment(self, ticketid, comment=None)
Adds a comment to the given ticket ID, assumes ticket exists.
source code
 
attach_file_to_ticket(self, ticketid, data=None, filename=None, description=None, replace=False, content_type=None)
Attaches a file to the given ticket id, with random data if none is provided.
source code
 
clone_ticket(self, ticketid)
Create a clone of the given ticket id using the clone button.
source code
 
create_wiki_page(self, name=None, content=None, comment=None)
Creates a wiki page, with a random unique CamelCase name if none is provided, random content if none is provided and a random comment if none is provided.
source code
 
edit_wiki_page(self, name, content=None, comment=None)
Edits a wiki page, with random content is none is provided.
source code
 
attach_file_to_wiki(self, name, data=None, filename=None, description=None, replace=False, content_type=None)
Attaches a file to the given wiki page, with random content if none is provided.
source code
 
create_milestone(self, name=None, due=None)
Creates the specified milestone, with a random name if none is provided.
source code
 
attach_file_to_milestone(self, name, data=None, filename=None, description=None, replace=False, content_type=None)
Attaches a file to the given milestone, with random content if none is provided.
source code
 
create_component(self, name=None, owner=None, description=None)
Creates the specified component, with a random camel-cased name if none is provided.
source code
 
create_enum(self, kind, name=None)
Helper to create the specified enum (used for priority, severity, etc).
source code
 
create_priority(self, name=None)
Create a new priority enum
source code
 
create_resolution(self, name=None)
Create a new resolution enum
source code
 
create_severity(self, name=None)
Create a new severity enum
source code
 
create_type(self, name=None)
Create a new ticket type enum
source code
 
create_version(self, name=None, releasetime=None)
Create a new version.
source code
 
create_report(self, title, query, description)
Create a new report with the given title, query, and description
source code
 
ticket_set_milestone(self, ticketid, milestone)
Set the milestone on a given ticket.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, url)
(Constructor)

source code 
Create a :class:`FunctionalTester` for the given Trac URL and
Subversion URL

Overrides: object.__init__

create_ticket(self, summary=None, info=None)

source code 

Create a new (random) ticket in the test environment. Returns the new ticket number.

summary and description default to randomly-generated values.

Parameters:
  • summary - may optionally be set to the desired summary
  • info - may optionally be set to a dictionary of field value pairs for populating the ticket. info['summary'] overrides summary.

go_to_ticket(self, ticketid=None)

source code 
Surf to the page for the given ticket ID, or to the NewTicket page if ticketid is not specified or is None. If ticketid is specified, it assumes the ticket exists.

go_to_wiki(self, name, version=None)

source code 
Surf to the wiki page. By default this will be the latest version of the page.
Parameters:
  • name - name of the wiki page.
  • version - version of the wiki page.

go_to_view_tickets(self, href='report')

source code 
Surf to the View Tickets page. By default this will be the Reports page, but 'query' can be specified for the href argument to support non-default configurations.

go_to_admin(self, panel_label=None)

source code 
Surf to the webadmin page. Continue surfing to a specific admin page if panel_label is specified.

go_to_milestone(self, name)

source code 
Surf to the specified milestone page. Assumes milestone exists.

go_to_report(self, id, args=None)

source code 

Surf to the specified report.

Assumes the report exists. Report variables will be appended if specified.

Parameters:
  • id - id of the report
  • args - may optionally specify a dictionary of arguments to be encoded as a query string

go_to_preferences(self, panel_label=None)

source code 
Surf to the preferences page. Continue surfing to a specific preferences panel if panel_label is specified.

attach_file_to_ticket(self, ticketid, data=None, filename=None, description=None, replace=False, content_type=None)

source code 
Attaches a file to the given ticket id, with random data if none is provided. Assumes the ticket exists.

create_wiki_page(self, name=None, content=None, comment=None)

source code 
Creates a wiki page, with a random unique CamelCase name if none is provided, random content if none is provided and a random comment if none is provided. Returns the name of the wiki page.

edit_wiki_page(self, name, content=None, comment=None)

source code 
Edits a wiki page, with random content is none is provided. and a random comment if none is provided. Returns the content.

attach_file_to_wiki(self, name, data=None, filename=None, description=None, replace=False, content_type=None)

source code 
Attaches a file to the given wiki page, with random content if none is provided. Assumes the wiki page exists.

create_milestone(self, name=None, due=None)

source code 
Creates the specified milestone, with a random name if none is provided. Returns the name of the milestone.

attach_file_to_milestone(self, name, data=None, filename=None, description=None, replace=False, content_type=None)

source code 
Attaches a file to the given milestone, with random content if none is provided. Assumes the milestone exists.

create_component(self, name=None, owner=None, description=None)

source code 
Creates the specified component, with a random camel-cased name if none is provided. Returns the name.

create_enum(self, kind, name=None)

source code 
Helper to create the specified enum (used for priority, severity, etc). If no name is given, a unique random word is used. The name is returned.

create_version(self, name=None, releasetime=None)

source code 
Create a new version. The name defaults to a random camel-cased word if not provided.