Bug 28787: Comment selenium test that will fail if no SMTP server is defined
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 8 Jul 2022 07:08:40 +0000 (09:08 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 9 Aug 2022 16:38:45 +0000 (13:38 -0300)
This is a deadlock I think. Any ideas how we could continue to test that
in any conditions?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Sponsored-by: Rijksmuseum, Netherlands
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/selenium/authentication_2fa.t

index d00cdfd..7c995d4 100755 (executable)
@@ -150,7 +150,7 @@ SKIP: {
     };
 
     subtest "Send OTP code" => sub {
-        plan tests => 4;
+        plan tests => 3;
 
         # Make sure the send won't fail because of invalid email addresses
         $patron->library->set(
@@ -186,17 +186,19 @@ SKIP: {
             'Email not sent will display an error'
         );
 
-        $patron->email('test@example.org');
-        $patron->store;
-        $driver->find_element('//a[@id="send_otp"]')->click;
-        $s->wait_for_ajax;
-        my $message =
-          $driver->find_element('//div[@id="email_success"]')->get_text;
-        is(
-            $message,
-            "The code has been sent by email, please check your inbox.",
-            'The email must have been sent correctly'
-        );
+        # This test will only pass if an SMTP server is defined
+        # It cannot be mocked from selenium tests
+        #$patron->email('test@example.org');
+        #$patron->store;
+        #$driver->find_element('//a[@id="send_otp"]')->click;
+        #$s->wait_for_ajax;
+        #my $message =
+        #  $driver->find_element('//div[@id="email_success"]')->get_text;
+        #is(
+        #    $message,
+        #    "The code has been sent by email, please check your inbox.",
+        #    'The email must have been sent correctly'
+        #);
     };
 
     subtest "Disable" => sub {