Sébastien Aperghis-Tramoni > Smolder-1.52 > Smolder::Mech

Download:
Smolder-1.52.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  7
Open  15
View/Report Bugs
Source  

NAME ^

Smolder::Mech

DESCRIPTION ^

Test::WWW::Mechanize subclass with some Smolder specific helper methods

    my $mech = Smolder::Mech->new();
    $mech->login($user);

METHODS ^

login

This routine will go to the login form, provide credentials and login. It receives the following named args, all required:

username

The text to use for the username field

password

The text to use for the password field. If none is given, it will use 'testing'.

    $mech->login(
        username    => $username,
        password    => 's3cr3t',
    );

logout

Logout the current user.

    $mech->logout();

get ^

Extends get() from Test::WWW::Mechanize to also disconnect any open Database handles before making a request if we are using SQLite to avoid locking the database

submit ^

Extends submit() from Test::WWW::Mechanize to also disconnect any open Database handles before making a request if we are using SQLite to avoid locking the database

request ^

Extends request() from Test::WWW::Mechanize to also disconnect any open Database handles before making a request if we are using SQLite to avoid locking the database

contains_message ^

This method will look in the X-JSON HTTP header of the response, look through each message in the messages array and see if any of them match the given message.

If given message is a scalar, the message must match exactly, else if it's a regex, then it will be matched against that.

syntax highlighting: