Bugzilla – Attachment 133667 Details for
Bug 29894
2FA: Add few validations, clear secret, send register notice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29894: Add Selenium tests for disable 2FA
Bug-29894-Add-Selenium-tests-for-disable-2FA.patch (text/plain), 2.17 KB, created by
Jonathan Druart
on 2022-04-22 10:30:50 UTC
(
hide
)
Description:
Bug 29894: Add Selenium tests for disable 2FA
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-04-22 10:30:50 UTC
Size:
2.17 KB
patch
obsolete
>From 4d8721fd18fced574a34cfe25df3dced2a20b6dc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 Apr 2022 12:24:17 +0200 >Subject: [PATCH] Bug 29894: Add Selenium tests for disable 2FA > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/selenium/authentication_2fa.t | 36 +++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/selenium/authentication_2fa.t b/t/db_dependent/selenium/authentication_2fa.t >index ebc0c7f991a..3efa66075de 100755 >--- a/t/db_dependent/selenium/authentication_2fa.t >+++ b/t/db_dependent/selenium/authentication_2fa.t >@@ -16,7 +16,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 2; >+use Test::More tests => 3; > > use C4::Context; > use Koha::AuthUtils; >@@ -148,6 +148,40 @@ SKIP: { > } > }; > >+ subtest "Disable" => sub { >+ plan tests => 4; >+ >+ my $mainpage = $s->base_url . q|mainpage.pl|; >+ $driver->get( $mainpage . q|?logout.x=1| ); >+ fill_login_form($s); >+ my $auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron } ); >+ my $code = $auth->code(); >+ $auth->clear; >+ $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]') >+ ->send_keys($code); >+ $driver->find_element('//input[@type="submit"]')->click; >+ >+ $driver->get( $s->base_url . q|members/two_factor_auth.pl| ); >+ >+ is( >+ $driver->find_element('//div[@class="two-factor-status"]')->get_text(), >+ 'Status: Enabled', >+ '2FA is enabled' >+ ); >+ >+ $driver->find_element('//form[@id="two-factor-auth"]//input[@type="submit"]')->click; >+ >+ is( >+ $driver->find_element('//div[@class="two-factor-status"]')->get_text(), >+ 'Status: Disabled', >+ '2FA has been disabled' >+ ); >+ >+ $patron = $patron->get_from_storage; >+ is( $patron->secret, undef, "Secret has been cleared" ); >+ is( $patron->auth_method(), 'password', 'auth_method has been reset to "password"' ); >+ }; >+ > $driver->quit(); > }; > >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29894
:
129538
|
129539
|
129669
|
129670
|
129689
|
129690
|
129691
|
129692
|
133286
|
133287
|
133288
|
133289
|
133562
|
133563
|
133564
|
133565
|
133566
|
133618
|
133661
|
133662
|
133663
|
133664
|
133665
|
133666
| 133667