Brownie::DSL - provides DSL-Style interface to use browser session
use Brownie::DSL; # external server Brownie->driver('Mechanize'); Brownie->app_host('http://app.example.com:5000'); # PSGI app Brownie->driver('Mechanize'); Brownie->app(sub { ...(PSGI app)... }); # psgi file Brownie->driver('Mechanize'); Brownie->app('app.psgi'); visit('/'); is title, 'Some Title'; fill_in('User Name' => 'brownie'); fill_in('Email Address' => 'brownie@example.com'); click_button('Login'); like source, qr/Welcome (.+)/; fill_in(q => 'Brownie'); lick_link_or_button('Search'); like title, qr/Search result of Brownie/i; done_testing;
driver: loadable driver name or config
driver
app_host: external target application
app_host
app: PSGI application
app
page
Shortcut to accessing the current session.
visit($url)
current_url
current_path
title
source
screenshot($filename)
click_link($locator)
click_button($locator)
click_on($locator)
fill_in($locator, $value)
choose($locator)
check($locator)
uncheck($locator)
select($locator)
unselect($locator)
attach_file($locator, $filename)
execute_script($javascript)
evaluate_script($javascript)
find($locator)
all($locator)
NAKAGAWA Masaki <masaki@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Brownie::Session
To install Brownie, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Brownie
CPAN shell
perl -MCPAN -e shell install Brownie
For more information on module installation, please visit the detailed CPAN module installation guide.