View | Details | Raw Unified | Return to bug 28786
Collapse All | Expand All

(-)a/t/db_dependent/selenium/authentication_2fa.t (-5 / +3 lines)
Lines 85-91 SKIP: { Link Here
85
    };
85
    };
86
86
87
    subtest 'Login' => sub {
87
    subtest 'Login' => sub {
88
        plan tests => 19;
88
        plan tests => 18;
89
89
90
        my $mainpage = $s->base_url . q|mainpage.pl|;
90
        my $mainpage = $s->base_url . q|mainpage.pl|;
91
91
Lines 115-122 SKIP: { Link Here
115
            is( login_error($s), undef );
115
            is( login_error($s), undef );
116
            $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys('wrong_code');
116
            $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys('wrong_code');
117
            $driver->find_element('//input[@type="submit"]')->click;
117
            $driver->find_element('//input[@type="submit"]')->click;
118
            ok($driver->find_element('//div[@class="dialog error"][contains(text(), "Invalid two-factor code")]'));
118
            is( login_error($s), "Invalid two-factor code" );
119
            is( login_error($s), undef );
120
119
121
            $driver->get($mainpage);
120
            $driver->get($mainpage);
122
            like( $driver->get_title, qr(Two-factor authentication), 'Must still be on the second auth screen' );
121
            like( $driver->get_title, qr(Two-factor authentication), 'Must still be on the second auth screen' );
Lines 137-143 SKIP: { Link Here
137
            is( login_error($s), undef );
136
            is( login_error($s), undef );
138
            $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys('wrong_code');
137
            $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys('wrong_code');
139
            $driver->find_element('//input[@type="submit"]')->click;
138
            $driver->find_element('//input[@type="submit"]')->click;
140
            ok($driver->find_element('//div[@class="dialog error"][contains(text(), "Invalid two-factor code")]'));
139
            is( login_error($s), "Invalid two-factor code" );
141
140
142
            my $auth = Koha::Auth::TwoFactorAuth->new({patron => $patron});
141
            my $auth = Koha::Auth::TwoFactorAuth->new({patron => $patron});
143
            my $code = $auth->code();
142
            my $code = $auth->code();
144
- 

Return to bug 28786