File: button_exists.t

package info (click to toggle)
libtest-www-mechanize-perl 1.52-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 372 kB
  • sloc: perl: 2,570; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!perl -T

use strict;
use warnings;

use Test::More tests => 6;

use Test::WWW::Mechanize ();
use URI::file ();

my $mech = Test::WWW::Mechanize->new();
isa_ok( $mech,'Test::WWW::Mechanize' );

my $uri = URI::file->new_abs( 't/html/form.html' )->as_string;
$mech->get_ok( $uri );

ok( $mech->button_exists( 'big_button' ), 'Found a button that is there' );
ok( !$mech->button_exists( 'little_button' ), 'Not found button that is not there' );

$mech->button_exists_ok( 'big_button', 'Found a button that is there' );
$mech->lacks_button_ok( 'little_button', 'Not found button that is not there' );

done_testing();

exit 0