From 1d5c884d4b5a324b3d2416e65ecd9ee716595154 Mon Sep 17 00:00:00 2001
From: Alexander Purr <purr@ub.uni-leipzig.de>
Date: Tue, 4 Apr 2023 14:50:00 +0200
Subject: [PATCH] refs #23605 [finc] adlr tests

* reorder records by record-ID
* replace / remove records if not existent
* uncomment INFOS ZUR RESSOURCE rule on several testCases (11,12,13,14,15,18) - see refs 22013-26
** rule is optional
** prevents from failing if other rules are correct
* see getitbox-matrix doc-file too
* remove function on TC1 & rename group on TC19
---
 .../tests/adlr/Getit01DefaultTest.php         | 28 ++++++++-----------
 .../tests/adlr/Getit08DefaultTest.php         |  2 +-
 .../tests/adlr/Getit11DefaultTest.php         |  5 ++--
 .../tests/adlr/Getit12DefaultTest.php         |  6 ++++
 .../tests/adlr/Getit12ProfessorTest.php       |  7 ++---
 .../tests/adlr/Getit13DefaultTest.php         | 14 +++++-----
 .../tests/adlr/Getit13ProfessorTest.php       | 10 +++----
 .../tests/adlr/Getit14DefaultTest.php         | 10 +++----
 .../tests/adlr/Getit15DefaultTest.php         |  4 +--
 .../tests/adlr/Getit18DefaultTest.php         |  3 +-
 .../tests/adlr/Getit19StudentTest.php         |  2 +-
 11 files changed, 45 insertions(+), 46 deletions(-)

diff --git a/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php
index db4ebc98c57..a9a06922b0c 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php
@@ -12,7 +12,16 @@ class Getit01DefaultTest extends AdlrBase
     use GetitTestBaseTrait;
 
     public const RECORDS = [
-        "finc-87-14159",
+        "13-1225555779",
+        "22-14-qucosa2-744504",
+        "26-80811",
+        "ai-28-d2580a888c2d405983dd08b4cbf24560",
+        "finc-30-61040",
+        "finc-39-comin118937881985num731329",
+        "ai-53-757382",
+        "finc-80-6678",
+        "84-on1079058527",
+        "87-10127",
         "finc-88-694",
         "finc-99-1482",
         "finc-101-aHR0cDovL3d3dy5maWxtbXVzaWsudW5pLWtpZWwuZGUvS0IxNC9LQjE0LVZvcndvcnQucGRm",
@@ -20,14 +29,7 @@ class Getit01DefaultTest extends AdlrBase
         "finc-153-bWFuLWluLXRoZS1hdHRpYy0xOTUzLXJlc3RvcmVkLW1vdmllLTcyMHAtaGQ",
         "finc-170-12835",
         "191-eunhj",
-        "196-1213742994",
-        "26-80811",
-        "ai-28-d2580a888c2d405983dd08b4cbf24560",
-        "finc-30-61040",
-        "finc-39-comin118937881985num731329",
-        "ai-53-757382",
-        "finc-80-6678",
-        "84-on1079058527"
+        "196-1213742994"
     ];
 
     public const RULES = [
@@ -47,12 +49,4 @@ class Getit01DefaultTest extends AdlrBase
             "text" => "Diese Ressource ist frei verfügbar."
         ]
     ];
-
-    /**
-     * @dataProvider provideRecords
-     */
-    public function testGetItDefault01($record) : void
-    {
-        $this->runGetItRecord($record);
-    }
 }
diff --git a/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php
index 9758e7e31a0..58526d49c03 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php
@@ -13,7 +13,7 @@ class Getit08DefaultTest extends AdlrBase
 
     public const RECORDS = [
         "finc-169-QVJEQVJEIEtsYXNzaVdpbGxpYW1zIMK3IEhhcnJ5IFBvdGVyIMK3IE5pYyBSYWluZSDCtyBXRFIwMDowNToxMDYxMTY0NjkzMDI1Nw",
-        "finc-169-WkRGS3VsdHVyemVpdE1pbG8gUmF1IMO8YmVyICJEYXMgTnMgTmV1ZSBFdmFuZ2VsaXVtIiAtMDA6MDU6NTkxMDMxNTk5NDk5MjAw"
+        "finc-169-WkRGS3VsdHVyemVpdE1pbG8gUmF1IMO8YmVyICJEYXMgTnMgTmV1ZSBFdmFuZ2VsaXVtIiAtMDA6MDU6NTkxMDMxNTk5NDk5MjAw",
     ];
 
     public const RULES = [
diff --git a/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php
index 4d2da6d5a55..dad6cbbd27b 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php
@@ -29,11 +29,12 @@ class Getit11DefaultTest extends AdlrBase
             "path" => ".getitbox-getit > h4",
             "text" => "GET IT",
         ],
-        [
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
             "text" => "INFOS ZUR RESSOURCE",
-        ],
+        ],*/
         [
             "type" => "text",
             "path" => ".getitbox-notices",
diff --git a/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php
index 3133170f4da..2f9b5e7b7da 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php
@@ -48,5 +48,11 @@ class Getit12DefaultTest extends AdlrBase
             "path" => ".getitbox-notices",
             "text" => "Jetzt registrieren",
         ],
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
+            "type" => "text",
+            "path" => "#get-it-button",
+            "text" => "INFOS ZUR RESSOURCE",
+        ],*/
     ];
 }
diff --git a/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php
index 3faf38356d5..ba75dceb649 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php
@@ -29,12 +29,11 @@ class Getit12ProfessorTest extends AdlrLoginBase
             "path" => ".part-order",
             "text" => "TEILKOPIE BESORGEN",
         ],
-        /* should there be infos?
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
             "text" => "INFOS ZUR RESSOURCE",
-            "waitForId" => "get-it-button"
-        ],
-        */
+        ],*/
     ];
 }
diff --git a/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php
index c856ba38296..4369674d7f2 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php
@@ -12,15 +12,14 @@ class Getit13DefaultTest extends AdlrBase
     use GetitTestBaseTrait;
 
     public const RECORDS = [
+        "0-1667395157",              // error: "GET IT" instead of "Nicht angemeldet"
         "finc-109-KM000089451",
         "finc-117-BV043403677",
         "finc-119-365350478",
         "127-HF000221927",
+        "finc-142-11205879",    // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
         "finc-148-000759109",
-        /*  https://projekte.ub.uni-leipzig.de/issues/22013#note-26 */
-        /*"finc-142-11205879",*/
-        /*"finc-151-000055718",*/
-        "0-1667395157" // error: "GET IT" instead of "Nicht angemeldet"
+        "finc-151-000055718",   // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
     ];
 
     public const RULES = [
@@ -34,11 +33,12 @@ class Getit13DefaultTest extends AdlrBase
             "path" => ".part-order",
             "text" => "TEILKOPIE BESORGEN",
         ],
-        [
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
-            "text" => "INFOS ZUR RESSOURCE",
-        ],
+            "text" => "LINKS ZUR RESSOURCE",
+        ],*/
         [
             "type" => "contains",
             "path" => ".getitbox-notices",
diff --git a/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php
index ef6c8c4aba5..54daa0ccc00 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php
@@ -24,13 +24,11 @@ class Getit13ProfessorTest extends AdlrLoginBase
             "path" => ".part-order",
             "text" => "TEILKOPIE BESORGEN",
         ],
-        /* see https://projekte.ub.uni-leipzig.de/issues/22013#note-26 */
-        /*
-        [
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
-            "text" => "INFOS ZUR RESSOURCE",
-        ],
-        */
+            "text" => "LINKS ZUR RESSOURCE",
+        ],*/
     ];
 }
diff --git a/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php
index 045d47f9dca..fdddf4569d5 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php
@@ -15,15 +15,15 @@ class Getit14DefaultTest extends AdlrBase
         "0-1670477886",
         "0-1041254903",
         "finc-109-KM000088077",
+        "finc-117-BV045542005", // error: 'GET IT' statt 'NICHT ANGEMELDET'
         "finc-119-369836529",
         "finc-119-321710606",
         "finc-119-310607205",
+        "finc-119-36435657X", // error: mehrbändiges Werk statt 'weitere informationen sehen sie..'
         "127-HF000223270",
         "finc-142-08035064",
-        "finc-151-000055678",
         "finc-148-000632095", // error: mehrbändiges Werk statt 'weitere informationen sehen sie..'
-        "finc-117-BV045542005", // error: 'GET IT' statt 'NICHT ANGEMELDET'
-        "finc-119-36435657X", // error: mehrbändiges Werk statt 'weitere informationen sehen sie..'
+        "finc-151-000055678",
     ];
 
     public const RULES = [
@@ -32,8 +32,8 @@ class Getit14DefaultTest extends AdlrBase
             "path" => ".getitbox-getit > h4",
             "text" => "NICHT ANGEMELDET",
         ],
-        /* https://projekte.ub.uni-leipzig.de/issues/22013#note-26
-        [
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
             "text" => "INFOS ZUR RESSOURCE",
diff --git a/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php
index f8b766b3d29..1b7fee5cc5f 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php
@@ -31,8 +31,8 @@ class Getit15DefaultTest extends AdlrBase
             "path" => ".getitbox-getit > h4",
             "text" => "GET IT",
         ],
-        //  https://projekte.ub.uni-leipzig.de/issues/22013#note-26
-/*            [
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
             "text" => "INFOS ZUR RESSOURCE",
diff --git a/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php
index 6797c05f6e1..d864328d64b 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php
@@ -29,7 +29,8 @@ class Getit18DefaultTest extends AdlrBase
             "path" => ".getitbox-getit > h4",
             "text" => "GET IT",
         ],
-/*            [
+        // https://projekte.ub.uni-leipzig.de/issues/22013#note-26
+        /*[
             "type" => "text",
             "path" => "#get-it-button",
             "text" => "LINKS ZUR RESSOURCE",
diff --git a/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php
index e6827c15ba0..70d6bc58435 100755
--- a/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php
+++ b/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php
@@ -5,7 +5,7 @@ namespace Selenium\adlr;
  * @group adlr
  * @group adlr-getit
  * @group adlr-getit-19
- * @group adlr-getit-professor
+ * @group adlr-getit-student
  */
 class Getit19StudentTest extends AdlrLoginBase
 {
-- 
GitLab