6 RT::Config->Set(AllowLoginPasswordAutoComplete => 1);
8 my ( $baseurl, $m ) = RT::Test->started_ok;
10 my $ticket = RT::Test->create_ticket(
11 Subject => 'ticket_foo',
15 my ( $user, $pass ) = ( 'root', 'password' );
20 $m->title_is('Login');
21 is( $m->uri, $baseurl, "right url" );
22 $m->content_lacks('autocomplete="off"');
31 $m->content_contains( "Your username or password is incorrect",
32 'login error message' );
33 $m->warning_like( qr/FAILED LOGIN for root/,
34 "got failed login warning" );
44 $m->title_is( 'RT at a glance', 'logged in' );
46 $m->follow_link_ok( { text => 'Logout' }, 'follow logout' );
47 $m->title_is( 'Logout', 'logout' );
53 $m->get( $baseurl . '/Ticket/Display.html?id=1' );
54 $m->title_is('Login');
62 like( $m->uri, qr{/Ticket/Display\.html}, 'normal ticket page' );
63 $m->follow_link_ok( { text => 'Logout' }, 'follow logout' );
66 diag "mobile login with not mobile client";
68 $m->get( $baseurl . '/m' );
69 is( $m->uri, $baseurl . '/m', "right url" );
70 $m->content_contains( "/m/index.html?NotMobile=1", 'mobile login' );
79 $m->content_contains( "Your username or password is incorrect",
80 'login error message' );
81 $m->warning_like( qr/FAILED LOGIN for root/,
82 "got failed login warning" );
91 like( $m->uri, qr{\Q$baseurl/m\E}, "mobile url" );
92 $m->follow_link_ok( { text => 'Logout' }, 'follow logout' );
93 $m->content_contains( "/m/index.html?NotMobile=1",
94 'back to mobile login page' );
95 $m->content_lacks( 'Logout', 'really logout' );
99 diag "mobile normal login";
102 # default browser in android 2.3.6
104 "Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus One Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
108 is( $m->uri, $baseurl, "right url" );
109 $m->content_contains( "/m/index.html?NotMobile=1", 'mobile login' );
117 is( $m->uri, $baseurl . '/m/', "mobile url" );
118 $m->follow_link_ok( { text => 'Logout' }, 'follow logout' );
119 $m->content_contains( "/m/index.html?NotMobile=1", 'back to mobile login page' );
120 $m->content_lacks( 'Logout', 'really logout' );
123 diag "mobile tangent login";
125 $m->get( $baseurl . '/Ticket/Display.html?id=1' );
126 $m->content_contains( "/m/index.html?NotMobile=1", 'mobile login' );
134 like( $m->uri, qr{/m/ticket/show}, 'mobile ticket page' );