NAME
Test::Mojo::Role::Debug - Test::Mojo role to make debugging test failures easier
SYNOPSIS
use Test::More;
use Test::Mojo::WithRoles 'Debug';
my $t = Test::Mojo::WithRoles->new('MyApp');
$t->get_ok('/')->status_is(200)
->d # Dump entire DOM
->d('#foo') # Dump a specific element
;
done_testing;
DESCRIPTION
When you chain up a bunch of tests and they fail, you really want an easy way to dump up your markup at a specific point in that chain and see what's what. This module comes to the rescue.
METHODS
You have all the methods provided by Test::Mojo, plus these:
d
$t->d; # print entire DOM
$t->d('#foo'); # print a specific element
Returns its invocant. Dumps the DOM of the current page to the screen. Takes an optional selector to be passed to "at" in Mojo::DOM, in which case, only the markup of that element will be dumped.
SEE ALSO
Test::Mojo ("or" in Test::Mojo in particular), Mojo::DOM
REPOSITORY
Fork this module on GitHub: https://github.com/zoffixznet/Test-Mojo-Role-Debug
BUGS
To report bugs or request features, please use https://github.com/zoffixznet/Test-Mojo-Role-Debug/issues
If you can't access GitHub, you can email your request to bug-test-mojo-role-debug at rt.cpan.org
AUTHOR
LICENSE
You can use and distribute this module under the same terms as Perl itself. See the LICENSE
file included in this distribution for complete details.