diff --git a/module/finc/tests/selenium/docker-compose.yaml b/module/finc/tests/selenium/docker-compose.yaml index cfd8a9ffc65b2f71a1323eca2e9b69de41fe418c..fc53c11bc8a1493fa0b661d68e941c2f2e1b7197 100755 --- a/module/finc/tests/selenium/docker-compose.yaml +++ b/module/finc/tests/selenium/docker-compose.yaml @@ -18,6 +18,8 @@ services: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + extra_hosts: + - "host.docker.internal:10.111.0.1" firefox: image: selenium/node-firefox depends_on: @@ -26,7 +28,8 @@ services: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 - + extra_hosts: + - "host.docker.internal:10.111.0.1" php: image: php:7.3-fpm working_dir: /usr/local/vufind diff --git a/module/finc/tests/selenium/tests/adlr/AdlrBase.php b/module/finc/tests/selenium/tests/adlr/AdlrBase.php index 0339ebee0fb38ca39c9aee0c3893aa783df3b9d6..76b7ad4248947eb4e7066f75efe63c73caf1de8a 100644 --- a/module/finc/tests/selenium/tests/adlr/AdlrBase.php +++ b/module/finc/tests/selenium/tests/adlr/AdlrBase.php @@ -1,18 +1,18 @@ <?php namespace Selenium\adlr; -use Facebook\WebDriver\WebDriverBy; -use Facebook\WebDriver\WebDriverExpectedCondition; use Lmc\Steward\ConfigProvider; use Lmc\Steward\Test\AbstractTestCase; class AdlrBase extends AbstractTestCase { public static $port = ''; + // public static $port = ':81'; /** @var string */ public static $host = 'https://staging.finc.info/vufind2/fid_adlr'; + // public static $baseUrl = 'http://host.docker.internal'; // public static $baseUrl = 'http://127.0.0.1'; // public static $baseUrl = 'http://localhost'; @@ -48,70 +48,6 @@ class AdlrBase extends AbstractTestCase } } - protected function runGetItTest($records = [], $rules = []): void - { - foreach ($records as $record) { - $this->log("object id of webdriver: " . spl_object_id($this->wd)); - $this->wd->get(self::$host . self::$port . $record); - $this->wd->takeScreenshot("logs/adlr/info{$record}" . ($this->user ? '-' . $this->user : '') . ".png"); - - foreach ($rules["desc"] ?? [] as $rule) { - if ($rule["waitForClass"]) { - $this->waitForClass($rule["waitForClass"], true); - } - if ($rule["waitForId"]) { - $this->waitForId($rule["waitForId"], true); - } - if ($rule["waitForLinkText"]) { - $this->waitForLinkText($rule["waitForLinkText"], true); - } - if ($rule["wait"]) { - try { - $this->wd->wait(5, 5000)->until( - WebDriverExpectedCondition::elementTextContains( - WebDriverBy::className($rule["wait"]), - $rule["text"] - ) - ); - } catch (\Facebook\WebDriver\Exception\NoSuchElementException $x) { - $this->log("Timeout for $record when fething {$rule["wait"]}."); - } - } - try { - $value = $this->findByCss($rule["path"])->getText(); - } catch (\Facebook\WebDriver\Exception\NoSuchElementException $x) { - $value = false; - } - switch ($rule["type"] ?? '') { - case 'text': - $this->assertEqualsIgnoringCase( - $rule["text"], - $value, - $rule["path"] . ($value === false ? " does not exists" : " is '" . $value . "' ") - . ", but should be '" . $rule["text"] . "'" - ); - break; - case 'contains': - $this->assertStringContainsStringIgnoringCase( - $rule["text"], - $value, - $record . ": " . - $rule["path"] . ($value === false ? " does not exists" : " is '" . $value . "' ") - . ", but should contain '" . $rule["text"] . "'" - ); - break; - case 'anti-exi': - $this->assertNotEqualsIgnoringCase( - $rule["text"], - $value, - $rule["path"] . " must not be equals to '" . $rule["text"] . "'" - ); - break; - } - } - } - } - #region helper methods protected function changeLanguage($lang = 'de') { @@ -135,5 +71,6 @@ class AdlrBase extends AbstractTestCase $this->changeLanguage(); parent::setUp(); } + #endregion } diff --git a/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php index 1f33b8ebf10a7ceededf37a3d106021aa594c139..db4ebc98c574bb9f38dd1a55f847ce0365ef810e 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit01DefaultTest.php @@ -3,53 +3,56 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-01 * @group adlr-getit-default */ class Getit01DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/finc-87-14159", - "/Record/finc-88-694", - "/Record/finc-99-1482", - "/Record/finc-101-aHR0cDovL3d3dy5maWxtbXVzaWsudW5pLWtpZWwuZGUvS0IxNC9LQjE0LVZvcndvcnQucGRm", - "/Record/finc-150-10500", - "/Record/finc-153-bWFuLWluLXRoZS1hdHRpYy0xOTUzLXJlc3RvcmVkLW1vdmllLTcyMHAtaGQ", - "/Record/finc-170-12835", - "/Record/191-eunhj", - "/Record/196-1213742994", - "/Record/26-80811", - "/Record/ai-28-d2580a888c2d405983dd08b4cbf24560", - "/Record/finc-30-61040", - "/Record/finc-39-comin118937881985num731329", - "/Record/ai-53-757382", - "/Record/finc-80-6678", - "/Record/84-on1079058527" + "finc-87-14159", + "finc-88-694", + "finc-99-1482", + "finc-101-aHR0cDovL3d3dy5maWxtbXVzaWsudW5pLWtpZWwuZGUvS0IxNC9LQjE0LVZvcndvcnQucGRm", + "finc-150-10500", + "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" ]; public const RULES = [ - "test_case_id" => "01", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT" - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE" - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => "Diese Ressource ist frei verfügbar." - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT" + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE" + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => "Diese Ressource ist frei verfügbar." ] ]; - public function testGetItDefault01() + /** + * @dataProvider provideRecords + */ + public function testGetItDefault01($record) : void { - $this->runGetItTest(self::RECORDS, self::RULES); + $this->runGetItRecord($record); } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit01ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit01ProfessorTest.php index bc4d95b2a895c5eb4fed9cfab9e1a2919ba4b18c..8917b4ef7059396e4a666202fb5ee68b1cb2857d 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit01ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit01ProfessorTest.php @@ -3,17 +3,15 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-01 * @group adlr-getit-professor */ class Getit01ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor01() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit01DefaultTest::RECORDS, Getit01DefaultTest::RULES); - } + public const RECORDS = Getit01DefaultTest::RECORDS; + public const RULES = Getit01DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit01StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit01StudentTest.php index 1687fe9abe6a17218ba4e9b15ffd86b6e4c81f15..9957af9a125de6d0c33634885d0a5437a080261c 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit01StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit01StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-01 * @group adlr-getit-student */ class Getit01StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent01() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit01DefaultTest::RECORDS, Getit01DefaultTest::RULES); - } + public const RECORDS = Getit01DefaultTest::RECORDS; + public const RULES = Getit01DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit02DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit02DefaultTest.php index 7b42486e44f7ac9e93cbc9615d033a35f9d1df1a..ec1ce701648e539ca9e269ae34c1d97aed4a505b 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit02DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit02DefaultTest.php @@ -3,54 +3,49 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-02 * @group adlr-getit-default */ class Getit02DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/ai-49-aHR0cDovL2R4LmRvaS5vcmcvMTAuMTA4MC8xMDMwNDMxMi4yMDIxLjE5ODMyNTQ", - "/Record/ai-49-aHR0cDovL2R4LmRvaS5vcmcvMTAuMTA4MC8xNzQzOTg4NC4yMDIxLjE5MjI0Mzc", - "/Record/ai-55-aHR0cHM6Ly93d3cuanN0b3Iub3JnL3N0YWJsZS8xMC4yOTc5L2JsYWNrY2FtZXJhLjEwLjIuMTk", - "/Record/ai-55-aHR0cHM6Ly93d3cuanN0b3Iub3JnL3N0YWJsZS80MDQwNjAyMQ", - "/Record/ai-68-OLC1936107031", - "/Record/ai-68-OLC1852389117" + "ai-49-aHR0cDovL2R4LmRvaS5vcmcvMTAuMTA4MC8xMDMwNDMxMi4yMDIxLjE5ODMyNTQ", + "ai-49-aHR0cDovL2R4LmRvaS5vcmcvMTAuMTA4MC8xNzQzOTg4NC4yMDIxLjE5MjI0Mzc", + "ai-55-aHR0cHM6Ly93d3cuanN0b3Iub3JnL3N0YWJsZS8xMC4yOTc5L2JsYWNrY2FtZXJhLjEwLjIuMTk", + "ai-55-aHR0cHM6Ly93d3cuanN0b3Iub3JnL3N0YWJsZS80MDQwNjAyMQ", + "ai-68-OLC1936107031", + "ai-68-OLC1852389117" ]; public const RULES = [ - "test_case_id" => "02", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", - "waitForClass" => "openUrlPrint" - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", + "waitForClass" => "openUrlPrint" + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", ] ]; - - public function testGetItDefault02() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit03DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit03DefaultTest.php index 2f2df900956f87a82dda38de459724d875763ddd..751f71bc1be1e969e783670565a9d23d553f917d 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit03DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit03DefaultTest.php @@ -3,50 +3,45 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-03 * @group adlr-getit-default */ class Getit03DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/51-9783864881091", - "/Record/51-9781443890199", - "/Record/51-9783631784259", + "51-9783864881091", + "51-9781443890199", + "51-9783631784259", ]; public const RULES = [ - "test_case_id" => "03", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Diese Neuerscheinung können Sie zur Leihe bestellen, wenn Sie angemeldet sind.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Diese Neuerscheinung können Sie zur Leihe bestellen, wenn Sie angemeldet sind.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", ] ]; - - public function testGetItDefault03() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit03ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit03ProfessorTest.php index f74cfc57b3911af3a29b88190d0ba65ce088997e..2fdcd9045c6cded61ee263b5010ad1f12e99cdaa 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit03ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit03ProfessorTest.php @@ -3,55 +3,43 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-03 * @group adlr-getit-professor */ class Getit03ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public const RECORDS = [ - "/Record/51-9783864881091", - "/Record/51-9781443890199", - "/Record/51-9783631784259", - ]; + public const RECORDS = Getit03DefaultTest::RECORDS; public const RULES = [ - "test_case_id" => "03L", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".full-order", - "text" => "KOSTENLOS BESTELLEN", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Bestellen Sie ein Leihexemplar dieser Neuerscheinung auf Kosten von adlr.link. Das Buch wird direkt an Sie geschickt.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Verfügbarkeit:", - ], + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".full-order", + "text" => "KOSTENLOS BESTELLEN", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Bestellen Sie ein Leihexemplar dieser Neuerscheinung auf Kosten von adlr.link. Das Buch wird direkt an Sie geschickt.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Verfügbarkeit:", ], ]; - - public function testGetItProfessor03() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit03StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit03StudentTest.php index 790395b527a800126ac1d8ebe7b73b76c22cefa9..97813042e0db143cd972fed12393f2720f697a45 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit03StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit03StudentTest.php @@ -2,17 +2,16 @@ namespace Selenium\adlr; /** + * @group adlr + * @group adlr-getit * @group adlr-getit-03 * @group adlr-getit-student */ class Getit03StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent03() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit03ProfessorTest::RECORDS, Getit03ProfessorTest::RULES); - } + public const RECORDS = Getit03DefaultTest::RECORDS; + public const RULES = Getit03ProfessorTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit04DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit04DefaultTest.php index cf2fa4454cbb525efc508d56f894a4e98ca2534d..c5ed865e0b57b6422a67bc7f2cc3fbcf65cfed6e 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit04DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit04DefaultTest.php @@ -3,47 +3,45 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-04 * @group adlr-getit-default */ class Getit04DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/76-EBC5939400", - "/Record/76-EBC6915648", - "/Record/76-EBC6138849", + "76-EBC5939400", + "76-EBC6915648", + "76-EBC6138849", ]; public const RULES = [ - "test_case_id" => "04", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - ["type" => "anti-exi", "path" => "#get-it-button"], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Sie müssen angemeldet sein, um Zugang zu diesem Titel zu erhalten.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + [ + "type" => "anti-exi", + "path" => "#get-it-button", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Sie müssen angemeldet sein, um Zugang zu diesem Titel zu erhalten.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", + ], ]; - - public function testGetItDefault04() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit04ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit04ProfessorTest.php index f4afe9a83a060c35013a75e8e315bea41fd51130..5992c12a4e44accc26d7f90d5ad7f74f41e08a35 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit04ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit04ProfessorTest.php @@ -3,45 +3,33 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-04 * @group adlr-getit-professor */ class Getit04ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public const RECORDS = [ - "/Record/76-EBC5939400", - "/Record/76-EBC6915648", - "/Record/76-EBC6138849", - ]; + public const RECORDS = Getit04DefaultTest::RECORDS; public const RULES = [ - "test_case_id" => "04L", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => - "Dieses E-Book ist für Sie über eine adlr.link-Lizenz freigeschaltet.", - ], + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => + "Dieses E-Book ist für Sie über eine adlr.link-Lizenz freigeschaltet.", ], ]; - - public function testGetItProfessor04() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit04StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit04StudentTest.php index 0585fd201a1e377b1190324b03eea866be0b6c9d..3099dec37781283a7cefd7c7007d95497b69e65a 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit04StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit04StudentTest.php @@ -2,17 +2,16 @@ namespace Selenium\adlr; /** + * @group adlr + * @group adlr-getit * @group adlr-getit-04 * @group adlr-getit-student */ class Getit04StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent04() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit04ProfessorTest::RECORDS, Getit04ProfessorTest::RULES); - } + public const RECORDS = Getit04DefaultTest::RECORDS; + public const RULES = Getit04ProfessorTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit05DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit05DefaultTest.php index 4a69655b647213c75fff4e869c3504f5ad699e42..5545a21c6997997915cabac4c9a5834307c91ffb 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit05DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit05DefaultTest.php @@ -3,45 +3,40 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-05 * @group adlr-getit-default */ class Getit05DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/finc-78-39818", - "/Record/finc-78-18524", - "/Record/finc-78-19486", + "finc-78-39818", + "finc-78-18524", + "finc-78-19486", ]; public const RULES = [ - "test_case_id" => "05", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Dieser Titel ist in der IZI-Datenbank des Internationalen Zentralinstituts für das Jugend- und Bildungsfernsehen nachgewiesen.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Zugang zum Volltext erhalten Sie nur bei einigen Titeln dieser Quelle über den obigen Link.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Dieser Titel ist in der IZI-Datenbank des Internationalen Zentralinstituts für das Jugend- und Bildungsfernsehen nachgewiesen.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Zugang zum Volltext erhalten Sie nur bei einigen Titeln dieser Quelle über den obigen Link.", + ], ]; - - public function testGetItDefault05() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit05ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit05ProfessorTest.php index 5fdc9779ee5bdb7f2aa8497d2beb28d6a202e145..ee8a2ffeead69d4a8eb5702f0138b0bb85f05349 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit05ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit05ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-05 * @group adlr-getit-professor */ class Getit05ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor05() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit05DefaultTest::RECORDS, Getit05DefaultTest::RULES); - } + public const RECORDS = Getit05DefaultTest::RECORDS; + public const RULES = Getit05DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit05StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit05StudentTest.php index ba117f509a44acafa48fb00fe1551fff4b8ac031..b827b66b268fd717b5fc618e7c22aa0b659ce480 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit05StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit05StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-05 * @group adlr-getit-student */ class Getit05StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent05() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit05DefaultTest::RECORDS, Getit05DefaultTest::RULES); - } + public const RECORDS = Getit05DefaultTest::RECORDS; + public const RULES = Getit05DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit06DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit06DefaultTest.php index 8705037ce7a2c917f09dfb92f850426ee051b387..e5fdad9508a7b4d90a2ab89769087dc3bbd7b7a7 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit06DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit06DefaultTest.php @@ -3,46 +3,41 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-06 * @group adlr-getit-default */ class Getit06DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/finc-103-b2FpOmNkbTE1NzU5LmNvbnRlbnRkbS5vY2xjLm9yZzpwMTU3NTljb2xsOS8xMTgwNA", - "/Record/finc-103-b2FpOmNkbTE1NzU5LmNvbnRlbnRkbS5vY2xjLm9yZzpwMTU3NTljb2xsNy8xMDg", - "/Record/finc-103-b2FpOmNkbTE1NzU5LmNvbnRlbnRkbS5vY2xjLm9yZzpwMTU3NTljb2xsOS8xMTkyNw", + "finc-103-b2FpOmNkbTE1NzU5LmNvbnRlbnRkbS5vY2xjLm9yZzpwMTU3NTljb2xsOS8xMTgwNA", + "finc-103-b2FpOmNkbTE1NzU5LmNvbnRlbnRkbS5vY2xjLm9yZzpwMTU3NTljb2xsNy8xMDg", + "finc-103-b2FpOmNkbTE1NzU5LmNvbnRlbnRkbS5vY2xjLm9yZzpwMTU3NTljb2xsOS8xMTkyNw", ]; public const RULES = [ - "test_case_id" => "06", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Diese Ressource ist frei verfügbar.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Dieser Titel ist im Bestand der Margaret Herrick Library, Academy of Motion Picture Arts and Sciences, und wird mit freundlicher Genehmigung hier angezeigt.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Diese Ressource ist frei verfügbar.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Dieser Titel ist im Bestand der Margaret Herrick Library, Academy of Motion Picture Arts and Sciences, und wird mit freundlicher Genehmigung hier angezeigt.", + ], ]; - - public function testGetItDefault06() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit06ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit06ProfessorTest.php index 60b80b6a3e2925b851529785a382280de9c8a048..42dac7d7a76a11c37d0347202a47974bed1de3ef 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit06ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit06ProfessorTest.php @@ -1,24 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-06 * @group adlr-getit-professor */ class Getit06ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - /** - * @group adlr - */ - public function testGetItProfessor06() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit06DefaultTest::RECORDS, Getit06DefaultTest::RULES); - } + public const RECORDS = Getit06DefaultTest::RECORDS; + public const RULES = Getit06DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit06StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit06StudentTest.php index 3d6bdfb563c65c1715af43ed868fa8c557bd4224..973966506773ebd05febf67c329fdb9e45cc6bab 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit06StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit06StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-06 * @group adlr-getit-student */ class Getit06StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent06() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit06DefaultTest::RECORDS, Getit06DefaultTest::RULES); - } + public const RECORDS = Getit06DefaultTest::RECORDS; + public const RULES = Getit06DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit07DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit07DefaultTest.php index 122e5531121f3da81f16195940e0398e98ebae54..561bc4d88c57b9a64ff2f49934f0d6ec3c6f5396 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit07DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit07DefaultTest.php @@ -3,46 +3,41 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-07 * @group adlr-getit-default */ class Getit07DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/dswarm-126-ZnR1bml2a2Fuc2FzOm9haTprdXNjaG9sYXJ3b3Jrcy5rdS5lZHU6MTgwOC8zMTgwNg", - "/Record/dswarm-126-ZnR1bmlhYXJodXNwdWJsOm9haTpwdXJlLmF0aXJhLmRrOnB1YmxpY2F0aW9ucy8wYzQ4NTgzNi0zOWU3LTRmNjMtOGViMi0wYmZjMDE1ZjJkMmQ" + "dswarm-126-ZnR1bml2a2Fuc2FzOm9haTprdXNjaG9sYXJ3b3Jrcy5rdS5lZHU6MTgwOC8zMTgwNg", + "dswarm-126-ZnR1bmlhYXJodXNwdWJsOm9haTpwdXJlLmF0aXJhLmRrOnB1YmxpY2F0aW9ucy8wYzQ4NTgzNi0zOWU3LTRmNjMtOGViMi0wYmZjMDE1ZjJkMmQ" ]; public const RULES = [ - "test_case_id" => "07", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Dieser Titel stammt aus der Bielefeld Academic Search Engine.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Einige Dokumente aus dieser Quelle sind möglicherweise nicht als Volltext zugänglich.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Dieser Titel stammt aus der Bielefeld Academic Search Engine.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Einige Dokumente aus dieser Quelle sind möglicherweise nicht als Volltext zugänglich.", + ], ]; - - public function testGetItDefault07() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit07ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit07ProfessorTest.php index 825a0cce51a461d5defe3af395f19ca9b1017113..de884977b0ec383476dabc0d0bbf752b4e115c48 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit07ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit07ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-07 * @group adlr-getit-professor */ class Getit07ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor07() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit07DefaultTest::RECORDS, Getit07DefaultTest::RULES); - } + public const RECORDS = Getit07DefaultTest::RECORDS; + public const RULES = Getit07DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit07StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit07StudentTest.php index a32f05c11aa17d8c77368aa27237c775f18fa8e5..db41c4de49796546553aa48d65dbe89defbeed73 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit07StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit07StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-07 * @group adlr-getit-student */ class Getit07StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent07() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit07DefaultTest::RECORDS, Getit07DefaultTest::RULES); - } + public const RECORDS = Getit07DefaultTest::RECORDS; + public const RULES = Getit07DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php index 51190d5b050a7ba88c0091fb46d5158bf7d23fae..9758e7e31a0cfb15d742787ebf7e91872603ad4d 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit08DefaultTest.php @@ -3,46 +3,41 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-08 * @group adlr-getit-default */ class Getit08DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/finc-169-QVJEQVJEIEtsYXNzaVdpbGxpYW1zIMK3IEhhcnJ5IFBvdGVyIMK3IE5pYyBSYWluZSDCtyBXRFIwMDowNToxMDYxMTY0NjkzMDI1Nw", - "/Record/finc-169-WkRGS3VsdHVyemVpdE1pbG8gUmF1IMO8YmVyICJEYXMgTnMgTmV1ZSBFdmFuZ2VsaXVtIiAtMDA6MDU6NTkxMDMxNTk5NDk5MjAw" + "finc-169-QVJEQVJEIEtsYXNzaVdpbGxpYW1zIMK3IEhhcnJ5IFBvdGVyIMK3IE5pYyBSYWluZSDCtyBXRFIwMDowNToxMDYxMTY0NjkzMDI1Nw", + "finc-169-WkRGS3VsdHVyemVpdE1pbG8gUmF1IMO8YmVyICJEYXMgTnMgTmV1ZSBFdmFuZ2VsaXVtIiAtMDA6MDU6NTkxMDMxNTk5NDk5MjAw" ]; public const RULES = [ - "test_case_id" => "08", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Aus Deutschland freier Zugang zu oder Download von Mediathek-Videos möglich.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Der Zugang kann aus rechtlichen Gründen nach Ablauf eines bestimmten Zeitraums oder aus anderen Ländern gesperrt sein.", - ], + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Aus Deutschland freier Zugang zu oder Download von Mediathek-Videos möglich.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Der Zugang kann aus rechtlichen Gründen nach Ablauf eines bestimmten Zeitraums oder aus anderen Ländern gesperrt sein.", ], ]; - - public function testGetItDefault08() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit08ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit08ProfessorTest.php index 63472008367896c8adc810375f9ee384ced17edc..658fd17782f3fe50520323fc94a70bbe75be6429 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit08ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit08ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-08 * @group adlr-getit-professor */ class Getit08ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor08() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit08DefaultTest::RECORDS, Getit08DefaultTest::RULES); - } + public const RECORDS = Getit08DefaultTest::RECORDS; + public const RULES = Getit08DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit08StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit08StudentTest.php index 6ca4a330a2e18de00be993b2a2e3bd9dc2e73f74..2af0af9a998a13f1941ffa17e31c0a53d9fcc022 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit08StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit08StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-08 * @group adlr-getit-student */ class Getit08StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent08() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit08DefaultTest::RECORDS, Getit08DefaultTest::RULES); - } + public const RECORDS = Getit08DefaultTest::RECORDS; + public const RULES = Getit08DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit09DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit09DefaultTest.php index 1a6a6d866c43725b42bf636df86501e710448492..2820c6edcae512d74751f9eabedd1e673685748b 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit09DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit09DefaultTest.php @@ -3,39 +3,34 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-09 * @group adlr-getit-default */ class Getit09DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1049705947", - "/Record/0-1042440905" + "0-1049705947", + "0-1042440905" ]; public const RULES = [ - "test_case_id" => "09", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => "Diese Ressource ist frei verfügbar.", - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => "Diese Ressource ist frei verfügbar.", ] ]; - - public function testGetItDefault09() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit09ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit09ProfessorTest.php index 203acde53c7cd169c47cbc6630ab4d37dcac7c25..e912269ed4ed9964ed15da4af5f94b56faffe9f7 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit09ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit09ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-09 * @group adlr-getit-professor */ class Getit09ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor09() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit09DefaultTest::RECORDS, Getit09DefaultTest::RULES); - } + public const RECORDS = Getit09DefaultTest::RECORDS; + public const RULES = Getit09DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit09StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit09StudentTest.php index 7c718d10f8b87e658b92979d76d5788780bb2d91..e75b7bb6df95855e4464627716a87944d31b45c3 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit09StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit09StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-09 * @group adlr-getit-student */ class Getit09StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent09() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit09DefaultTest::RECORDS, Getit09DefaultTest::RULES); - } + public const RECORDS = Getit09DefaultTest::RECORDS; + public const RULES = Getit09DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit10DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit10DefaultTest.php index a30d4b548c59ca71aaf32b0cecfd8f5649fe1f61..c5be0c04eeaaf44d6c4e340fce51d5ceec383a85 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit10DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit10DefaultTest.php @@ -3,46 +3,44 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-10 * @group adlr-getit-default */ class Getit10DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1039949797", - "/Record/0-1656224038" + "0-1039949797", + "0-1656224038" ]; public const RULES = [ - "test_case_id" => "10", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - ["type" => "anti-exi", "path" => "#get-it-button"], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Sie müssen angemeldet sein, um Zugang zu diesem Titel zu erhalten.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + [ + "type" => "anti-exi", + "path" => "#get-it-button", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Sie müssen angemeldet sein, um Zugang zu diesem Titel zu erhalten.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", + ], ]; - - public function testGetItDefault10() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit10ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit10ProfessorTest.php index 236b847a72803bdc20970cfa9931af76e7a4ba87..9e6bf0829d47d72a36883bb64d431c66a0c35c4b 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit10ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit10ProfessorTest.php @@ -1,43 +1,34 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-10 * @group adlr-getit-professor */ class Getit10ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; + public const RECORDS = Getit10DefaultTest::RECORDS; public const RULES = [ - "test_case_id" => "10", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => - "Dieses E-Book ist für Sie über eine adlr.link-Lizenz freigeschaltet.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => + "Dieses E-Book ist für Sie über eine adlr.link-Lizenz freigeschaltet.", + ], ]; - - public function testGetItProfessor10() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit10DefaultTest::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit10StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit10StudentTest.php index d03afd49c3b2a3ae6b46d491f6b25f31dacf75bd..7b7d987c5fb31b8222c0f1e509701ac1e0479f1c 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit10StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit10StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-10 * @group adlr-getit-student */ class Getit10StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent10() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit10DefaultTest::RECORDS, Getit10ProfessorTest::RULES); - } + public const RECORDS = Getit10DefaultTest::RECORDS; + public const RULES = Getit10ProfessorTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php index e4a677d4af46caddebdc8ba20e0fca3105b6b991..4d2da6d5a55f83663a692753f440a992d9b630de 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit11DefaultTest.php @@ -3,47 +3,42 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-11 * @group adlr-getit-default */ class Getit11DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/127-HF000229647", // ok, if logged in - "/Record/finc-148-000766970", // ok, if logged in - "/Record/finc-109-KM000085902", // error: mehrbändiges Werk - "/Record/0-1678979260", // error: Links zur Ressource - "/Record/0-1668331306", // error: derzeit leider keine Infos - "/Record/0-1667284800", // error: derzeit leider keine Infos - "/Record/finc-117-BV040630682", // error: mehrbändiges Werk - "/Record/finc-142-08034201", // error: mehrbändiges Werk - "/Record/finc-119-321520181" // error: mehrbändiges Werk + "127-HF000229647", // ok, if logged in + "finc-148-000766970", // ok, if logged in + "finc-109-KM000085902", // error: mehrbändiges Werk + "0-1678979260", // error: Links zur Ressource + "0-1668331306", // error: derzeit leider keine Infos + "0-1667284800", // error: derzeit leider keine Infos + "finc-117-BV040630682", // error: mehrbändiges Werk + "finc-142-08034201", // error: mehrbändiges Werk + "finc-119-321520181" // error: mehrbändiges Werk ]; public const RULES = [ - "test_case_id" => "11", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => - 'Dieser Titel ist ein mehrbändiges Werk. Einzeltitel sind unter "Zugehörige Bände" aufgeführt.', - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => + 'Dieser Titel ist ein mehrbändiges Werk. Einzeltitel sind unter "Zugehörige Bände" aufgeführt.', + ], ]; - - public function testGetItDefault11() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit11ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit11ProfessorTest.php index 6041ec068385cfe1e3576e6bce32912fc02ce800..df8546f23e0571a3b3ec2c7a2414c94842c0b43b 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit11ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit11ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-11 * @group adlr-getit-professor */ class Getit11ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor11() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit11DefaultTest::RECORDS, Getit11DefaultTest::RULES); - } + public const RECORDS = Getit11DefaultTest::RECORDS; + public const RULES = Getit11DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit11StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit11StudentTest.php index 9e33fcba65150f15f23b629b3d6ae02687c8da21..2340f4e2400bcf8e61a143d5ba04c8543e32f84c 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit11StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit11StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-11 * @group adlr-getit-student */ class Getit11StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent11() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit11DefaultTest::RECORDS, Getit11DefaultTest::RULES); - } + public const RECORDS = Getit11DefaultTest::RECORDS; + public const RULES = Getit11DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php index 11d301ce5ae5a254e78d11584bc9fc3e03fa66fd..3133170f4daaaba023d26d2656c6981fa5a9ac52 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit12DefaultTest.php @@ -3,55 +3,50 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-12 * @group adlr-getit-default */ class Getit12DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1603202374", - "/Record/0-1067543112", - "/Record/0-1027717349", + "0-1603202374", + "0-1067543112", + "0-1027717349", ]; public const RULES = [ - "test_case_id" => "12", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - [ - "type" => "anti-exi", - "path" => ".full-order", - "text" => "KOSTENLOS BESTELLEN", - ], - [ - "type" => "anti-exi", - "path" => ".part-order", - "text" => "TEILKOPIE BESORGEN", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + [ + "type" => "anti-exi", + "path" => ".full-order", + "text" => "KOSTENLOS BESTELLEN", + ], + [ + "type" => "anti-exi", + "path" => ".part-order", + "text" => "TEILKOPIE BESORGEN", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", + ], ]; - - public function testGetItDefault12() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php index 774780f357469624091884817e5f4eb32edc02bf..3faf38356d5f608bcbe43790c68b8671a4dd6918 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit12ProfessorTest.php @@ -1,49 +1,40 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-12 * @group adlr-getit-professor */ class Getit12ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; + public const RECORDS = Getit12DefaultTest::RECORDS; public const RULES = [ - "test_case_id" => "12", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => ".full-order", - "text" => "KOSTENLOS BESTELLEN", - ], - [ - "type" => "text", - "path" => ".part-order", - "text" => "TEILKOPIE BESORGEN", - ], - /* should there be infos? - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - "waitForId" => "get-it-button" - ], - */ - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => ".full-order", + "text" => "KOSTENLOS BESTELLEN", + ], + [ + "type" => "text", + "path" => ".part-order", + "text" => "TEILKOPIE BESORGEN", + ], + /* should there be infos? + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + "waitForId" => "get-it-button" + ], + */ ]; - - public function testGetItProfessor12() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit12DefaultTest::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit12StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit12StudentTest.php index 42c4a30712294a2ae0edfa795e7f0700992a6211..a17d52ac0c7505db07fec7092b116ecc2bd3309d 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit12StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit12StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-12 * @group adlr-getit-student */ class Getit12StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent12() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit12DefaultTest::RECORDS, Getit12ProfessorTest::RULES); - } + public const RECORDS = Getit12DefaultTest::RECORDS; + public const RULES = Getit12ProfessorTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php index 8b1970813dd6a826331e713a1e888fb39a97ac09..c856ba38296b2a47918bdd660d0038d93af17af4 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit13DefaultTest.php @@ -3,61 +3,56 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-13 * @group adlr-getit-default */ class Getit13DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/finc-109-KM000089451", - "/Record/finc-117-BV043403677", - "/Record/finc-119-365350478", - "/Record/127-HF000221927", - "/Record/finc-148-000759109", + "finc-109-KM000089451", + "finc-117-BV043403677", + "finc-119-365350478", + "127-HF000221927", + "finc-148-000759109", /* https://projekte.ub.uni-leipzig.de/issues/22013#note-26 */ - /*"/Record/finc-142-11205879",*/ - /*"/Record/finc-151-000055718",*/ - "/Record/0-1667395157" // error: "GET IT" instead of "Nicht angemeldet" + /*"finc-142-11205879",*/ + /*"finc-151-000055718",*/ + "0-1667395157" // error: "GET IT" instead of "Nicht angemeldet" ]; public const RULES = [ - "test_case_id" => "13", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - [ - "type" => "anti-exi", - "path" => ".part-order", - "text" => "TEILKOPIE BESORGEN", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + [ + "type" => "anti-exi", + "path" => ".part-order", + "text" => "TEILKOPIE BESORGEN", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", + ], ]; - - public function testGetItDefault13() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php index 5f81fedb964b7ee1d6abf5b1fc1c2ed0dca0bcc7..ef6c8c4aba5667c4cd557c17bd96c42e75d9c6da 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit13ProfessorTest.php @@ -1,45 +1,36 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-13 * @group adlr-getit-professor */ class Getit13ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; + public const RECORDS = Getit13DefaultTest::RECORDS; public const RULES = [ - "test_case_id" => "13L", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => ".part-order", - "text" => "TEILKOPIE BESORGEN", - ], - /* see https://projekte.ub.uni-leipzig.de/issues/22013#note-26 */ - /* - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ], - */ - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => ".part-order", + "text" => "TEILKOPIE BESORGEN", + ], + /* see https://projekte.ub.uni-leipzig.de/issues/22013#note-26 */ + /* + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ], + */ ]; - - public function testGetItProfessor13() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit13DefaultTest::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit13StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit13StudentTest.php index de34801c87ceaf61d6f46a2c745e17c2c3704eba..942e13789d4e81b3b79587a088ff3a8a838294c0 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit13StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit13StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-13 * @group adlr-getit-student */ class Getit13StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent13() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit13DefaultTest::RECORDS, Getit13ProfessorTest::RULES); - } + public const RECORDS = Getit13DefaultTest::RECORDS; + public const RULES = Getit13ProfessorTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php index 6beb75904ab0e0403e2bac0bb2398d22c682f122..045d47f9dcad88c10f83af22177e3a3b1ef401b0 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit14DefaultTest.php @@ -3,61 +3,56 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-14 * @group adlr-getit-default */ class Getit14DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1670477886", - "/Record/0-1041254903", - "/Record/finc-109-KM000088077", - "/Record/finc-119-369836529", - "/Record/finc-119-321710606", - "/Record/finc-119-310607205", - "/Record/127-HF000223270", - "/Record/finc-142-08035064", - "/Record/finc-151-000055678", - "/Record/finc-148-000632095", // error: mehrbändiges Werk statt 'weitere informationen sehen sie..' - "/Record/finc-117-BV045542005", // error: 'GET IT' statt 'NICHT ANGEMELDET' - "/Record/finc-119-36435657X", // error: mehrbändiges Werk statt 'weitere informationen sehen sie..' + "0-1670477886", + "0-1041254903", + "finc-109-KM000088077", + "finc-119-369836529", + "finc-119-321710606", + "finc-119-310607205", + "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..' ]; public const RULES = [ - "test_case_id" => "14", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "NICHT ANGEMELDET", - ], - /* https://projekte.ub.uni-leipzig.de/issues/22013#note-26 - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "INFOS ZUR RESSOURCE", - ],*/ - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Noch keinen Account?", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Jetzt registrieren", - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "NICHT ANGEMELDET", + ], + /* https://projekte.ub.uni-leipzig.de/issues/22013#note-26 + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ],*/ + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Noch keinen Account?", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Jetzt registrieren", ] ]; - - public function testGetItDefault14() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit14ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit14ProfessorTest.php index 53667dc1e4880f1ead78695101160066f855d1cb..1b667ccb6decffd71bda60faf644376e10db7b15 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit14ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit14ProfessorTest.php @@ -1,44 +1,35 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-14 * @group adlr-getit-professor */ class Getit14ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; + public const RECORDS = Getit14DefaultTest::RECORDS; public const RULES = [ - "test_case_id" => "14L", - "desc" => [ - [ - "type" => "text", - "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" => "contains", - "path" => ".getitbox-notices", - "text" => - "Einige Medientypen (wie z. B. Manuskripte, Schallplatten, CDs, Videos) können von der Fernleihe ausgeschlossen sein.", - ], - ] + [ + "type" => "text", + "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" => "contains", + "path" => ".getitbox-notices", + "text" => + "Einige Medientypen (wie z. B. Manuskripte, Schallplatten, CDs, Videos) können von der Fernleihe ausgeschlossen sein.", + ], ]; - - public function testGetItProfessor14() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit14DefaultTest::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit14StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit14StudentTest.php index 537da44746c4119730761bf54b6a19ef5fc08714..252fa956c69ace798aee036dc08601b456f1207c 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit14StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit14StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-14 * @group adlr-getit-student */ class Getit14StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent14() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit14DefaultTest::RECORDS, Getit14ProfessorTest::RULES); - } + public const RECORDS = Getit14DefaultTest::RECORDS; + public const RULES = Getit14ProfessorTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php index 3f80918e20a1a0449e25c58d09556eda2f091348..f8b766b3d29308d68f6690ea7a664a4d9364ab32 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit15DefaultTest.php @@ -3,56 +3,51 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-15 * @group adlr-getit-default */ class Getit15DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1649918879", - "/Record/0-1668116529", - "/Record/finc-119-326140743", - "/Record/finc-119-320535185", - "/Record/finc-119-218381344", - "/Record/127-HF000220674", - "/Record/127-HF000224330", - "/Record/finc-142-10903814", - "/Record/finc-142-10891532", - "/Record/finc-151-000046616", - "/Record/finc-117-BV022883157", + "0-1649918879", + "0-1668116529", + "finc-119-326140743", + "finc-119-320535185", + "finc-119-218381344", + "127-HF000220674", + "127-HF000224330", + "finc-142-10903814", + "finc-142-10891532", + "finc-151-000046616", + "finc-117-BV022883157", ]; public const RULES = [ - "test_case_id" => "15", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - // https://projekte.ub.uni-leipzig.de/issues/22013#note-26 + [ + "type" => "text", + "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" => "contains", - "path" => ".getitbox-notices", - "text" => "Für diesen Titel können wir derzeit leider keine weiteren Informationen zur Verfügbarkeit bereitstellen.", - "wait" => "getitbox-notices" - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => "Ob der Titel per Fernleihe bestellbar ist, kann Ihnen Ihre Heimatbibliothek mitteilen.", - "wait" => "getitbox-notices" - ], - ] + "type" => "text", + "path" => "#get-it-button", + "text" => "INFOS ZUR RESSOURCE", + ],*/ + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Für diesen Titel können wir derzeit leider keine weiteren Informationen zur Verfügbarkeit bereitstellen.", + "wait" => "getitbox-notices" + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => "Ob der Titel per Fernleihe bestellbar ist, kann Ihnen Ihre Heimatbibliothek mitteilen.", + "wait" => "getitbox-notices" + ], ]; - - public function testGetItDefault15() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit15ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit15ProfessorTest.php index ef1c12e40baf4c38e152eac4efed92b1fb1920ea..c6e76be07e0456933a528465564d03092821e7a0 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit15ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit15ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-15 * @group adlr-getit-professor */ class Getit15ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor15() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit15DefaultTest::RECORDS, Getit15DefaultTest::RULES); - } + public const RECORDS = Getit15DefaultTest::RECORDS; + public const RULES = Getit15DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit15StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit15StudentTest.php index 85d7cdfc6cba9b587f48be572685609b99973e23..383bd9ba9096bf27bc892d016745e4a06f99fb6a 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit15StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit15StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-15 * @group adlr-getit-student */ class Getit15StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent15() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit15DefaultTest::RECORDS, Getit15DefaultTest::RULES); - } + public const RECORDS = Getit15DefaultTest::RECORDS; + public const RULES = Getit15DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit16DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit16DefaultTest.php index cf5f2877909e483396c73335d43894398619df61..300a46f6edc16c0297cf338d144580c037dea37b 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit16DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit16DefaultTest.php @@ -3,45 +3,40 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-16 * @group adlr-getit-default */ class Getit16DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1678956775", - "/Record/0-1678647268", - "/Record/0-1678675431", - "/Record/finc-117-BV045203253", - "/Record/finc-117-BV044707116", - "/Record/finc-119-339980966", - "/Record/finc-119-356913473", - "/Record/finc-119-22918670X", + "0-1678956775", + "0-1678647268", + "0-1678675431", + "finc-117-BV045203253", + "finc-117-BV044707116", + "finc-119-339980966", + "finc-119-356913473", + "finc-119-22918670X", ]; public const RULES = [ - "test_case_id" => "16", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => "Diese Ressource ist frei verfügbar.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => "Diese Ressource ist frei verfügbar.", + ], ]; - - public function testGetItDefault16() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit16ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit16ProfessorTest.php index 721e8759f53c5677b3b4f4d1e254cd2e75a96956..fe5f02b478e0d5164f588aa91da667bb0df6d9e7 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit16ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit16ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-16 * @group adlr-getit-professor */ class Getit16ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor16() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit16DefaultTest::RECORDS, Getit16DefaultTest::RULES); - } + public const RECORDS = Getit16DefaultTest::RECORDS; + public const RULES = Getit16DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit16StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit16StudentTest.php index 8d74356e6b1ac064ef61d64b1becb49dcd089f76..f7429425168a7e6b82c48a1ab50122fc5d812143 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit16StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit16StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-16 * @group adlr-getit-student */ class Getit16StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent16() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit16DefaultTest::RECORDS, Getit16DefaultTest::RULES); - } + public const RECORDS = Getit16DefaultTest::RECORDS; + public const RULES = Getit16DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit17DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit17DefaultTest.php index e6e6e97923e815fdf4628bf36ed55c992b8bc722..a9a03a321a348e034fe0268c63a65a5f9ef682c9 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit17DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit17DefaultTest.php @@ -3,52 +3,47 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-17 * @group adlr-getit-default */ class Getit17DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1679317865", - "/Record/0-1678682802", - "/Record/finc-117-BV044276094", - "/Record/finc-117-BV045304712", - "/Record/finc-119-371587344", - "/Record/finc-119-377835137", - "/Record/127-HF000224597", - "/Record/127-HF000219912", + "0-1679317865", + "0-1678682802", + "finc-117-BV044276094", + "finc-117-BV045304712", + "finc-119-371587344", + "finc-119-377835137", + "127-HF000224597", + "127-HF000219912", ]; public const RULES = [ - "test_case_id" => "17", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Dieses E-Book ist nur mit einer Lizenz Ihrer Heimatbibliothek nutzbar. Wenn es als bei Ihrer Bibliothek vorhanden angezeigt wird, dann sollte der direkte Zugang über den obigen Link möglich sein.", - ], - [ - "type" => "contains", - "path" => ".getitbox-notices", - "text" => - "Teilkopien sind bei E-Books nicht möglich. Wenn Sie eine Teilkopie benötigen, suchen Sie bitte in unserem Portal nach der Printausgabe dieses Werkes.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Dieses E-Book ist nur mit einer Lizenz Ihrer Heimatbibliothek nutzbar. Wenn es als bei Ihrer Bibliothek vorhanden angezeigt wird, dann sollte der direkte Zugang über den obigen Link möglich sein.", + ], + [ + "type" => "contains", + "path" => ".getitbox-notices", + "text" => + "Teilkopien sind bei E-Books nicht möglich. Wenn Sie eine Teilkopie benötigen, suchen Sie bitte in unserem Portal nach der Printausgabe dieses Werkes.", + ], ]; - - public function testGetItDefault17() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit17ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit17ProfessorTest.php index 8a0166bc83949107ad6f6fcd1812f72e3a193aac..932b3cef36a36f14c430222a271100f97c84c21f 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit17ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit17ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-17 * @group adlr-getit-professor */ class Getit17ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor17() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit17DefaultTest::RECORDS, Getit17DefaultTest::RULES); - } + public const RECORDS = Getit17DefaultTest::RECORDS; + public const RULES = Getit17DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit17StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit17StudentTest.php index 14af504527ce9bfa60a72d0bff62b500d845e899..13c4cd10262e14e4c0689ad5b1bee41fb59007e3 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit17StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit17StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-17 * @group adlr-getit-student */ class Getit17StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent17() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit17DefaultTest::RECORDS, Getit17DefaultTest::RULES); - } + public const RECORDS = Getit17DefaultTest::RECORDS; + public const RULES = Getit17DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php index 3e615e1946b3044a426d9e1355ed3981d89e7814..6797c05f6e100fa7028f0cf82efe943cf381b5c1 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit18DefaultTest.php @@ -3,46 +3,41 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-18 * @group adlr-getit-default */ class Getit18DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-1666903302", - "/Record/0-1588294307", - "/Record/0-1040676065", - "/Record/0-1667282492", - "/Record/0-1667362062", - "/Record/finc-117-BV022365028", - "/Record/finc-119-334239729", - "/Record/127-HF000224884", - "/Record/127-HF000224896", + "0-1666903302", + "0-1588294307", + "0-1040676065", + "0-1667282492", + "0-1667362062", + "finc-117-BV022365028", + "finc-119-334239729", + "127-HF000224884", + "127-HF000224896", ]; public const RULES = [ - "test_case_id" => "18", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], /* [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ],*/ - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => "Online-Ressourcen können Lizenzen erfordern oder kostenpflichtig sein.", - ], - ] + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ],*/ + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => "Online-Ressourcen können Lizenzen erfordern oder kostenpflichtig sein.", + ], ]; - - public function testGetItDefault18() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit18ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit18ProfessorTest.php index 2273c31646014355985cf832b5104f4ed39499ae..26669da1a69f54092cee1a26451d8dfd8de1ef66 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit18ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit18ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-18 * @group adlr-getit-professor */ class Getit18ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor18() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit18DefaultTest::RECORDS, Getit18DefaultTest::RULES); - } + public const RECORDS = Getit18DefaultTest::RECORDS; + public const RULES = Getit18DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit18StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit18StudentTest.php index 3391a54b8fb571828ae48d41d6ef07721c91f69a..4d91f2e341e4ece75c9458d6a651bbbe5b37e0bb 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit18StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit18StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-18 * @group adlr-getit-student */ class Getit18StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent18() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit18DefaultTest::RECORDS, Getit18DefaultTest::RULES); - } + public const RECORDS = Getit18DefaultTest::RECORDS; + public const RULES = Getit18DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit19DefaultTest.php b/module/finc/tests/selenium/tests/adlr/Getit19DefaultTest.php index 78f549ee0c514753dce48c27e41d2ea02f99cb5c..5b9aaa1b3bc36877715afc0465070632150dd42a 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit19DefaultTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit19DefaultTest.php @@ -3,39 +3,34 @@ namespace Selenium\adlr; /** * @group adlr + * @group adlr-getit * @group adlr-getit-19 * @group adlr-getit-default */ class Getit19DefaultTest extends AdlrBase { + use GetitTestBaseTrait; + public const RECORDS = [ - "/Record/0-478507879" + "0-478507879" ]; public const RULES = [ - "test_case_id" => "19", - "desc" => [ - [ - "type" => "text", - "path" => ".getitbox-getit > h4", - "text" => "GET IT", - ], - [ - "type" => "text", - "path" => "#get-it-button", - "text" => "LINKS ZUR RESSOURCE", - ], - [ - "type" => "text", - "path" => ".getitbox-notices", - "text" => - "Online-Ressourcen können Lizenzen erfordern oder kostenpflichtig sein.", - ], - ] + [ + "type" => "text", + "path" => ".getitbox-getit > h4", + "text" => "GET IT", + ], + [ + "type" => "text", + "path" => "#get-it-button", + "text" => "LINKS ZUR RESSOURCE", + ], + [ + "type" => "text", + "path" => ".getitbox-notices", + "text" => + "Online-Ressourcen können Lizenzen erfordern oder kostenpflichtig sein.", + ], ]; - - public function testGetItDefault19() - { - $this->runGetItTest(self::RECORDS, self::RULES); - } } diff --git a/module/finc/tests/selenium/tests/adlr/Getit19ProfessorTest.php b/module/finc/tests/selenium/tests/adlr/Getit19ProfessorTest.php index 95b447e8875f0234d8d0725b5ac49dc4e11dba01..f22436d7f581c877f0e59527f17ed86198714736 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit19ProfessorTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit19ProfessorTest.php @@ -1,21 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** * @group adlr + * @group adlr-getit * @group adlr-getit-19 * @group adlr-getit-professor */ class Getit19ProfessorTest extends AdlrLoginBase { use ProfessorTrait; + use GetitTestBaseTrait; - public function testGetItProfessor19() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit19DefaultTest::RECORDS, Getit19DefaultTest::RULES); - } + public const RECORDS = Getit19DefaultTest::RECORDS; + public const RULES = Getit19DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php b/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php index 168df226ca3f2751784f5574f74ac71aea7f1e01..e6827c15ba0905a428c2cbdcba881727c165bd17 100755 --- a/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php +++ b/module/finc/tests/selenium/tests/adlr/Getit19StudentTest.php @@ -1,20 +1,17 @@ <?php namespace Selenium\adlr; -use Lmc\Steward\Test\AbstractTestCase; - /** + * @group adlr + * @group adlr-getit * @group adlr-getit-19 * @group adlr-getit-professor */ class Getit19StudentTest extends AdlrLoginBase { use StudentTrait; + use GetitTestBaseTrait; - public function testGetItStudent19() - { - $this->logout(); - $this->assertTrue($this->login("{$this->getUserName()}@adlr.link", $this->getPassword())); - $this->runGetItTest(Getit19DefaultTest::RECORDS, Getit19DefaultTest::RULES); - } + public const RECORDS = Getit19DefaultTest::RECORDS; + public const RULES = Getit19DefaultTest::RULES; } diff --git a/module/finc/tests/selenium/tests/adlr/GetitTestBaseTrait.php b/module/finc/tests/selenium/tests/adlr/GetitTestBaseTrait.php new file mode 100755 index 0000000000000000000000000000000000000000..05cbdf5969b1f0f9e91dcb606a592eaabee46ade --- /dev/null +++ b/module/finc/tests/selenium/tests/adlr/GetitTestBaseTrait.php @@ -0,0 +1,111 @@ +<?php +namespace Selenium\adlr; + +use Facebook\WebDriver\WebDriverBy; +use Facebook\WebDriver\WebDriverExpectedCondition; + +trait GetitTestBaseTrait +{ + /* + * open record url and test each rule set + */ + public function runGetItRecord($record): void + { + $this->log("object id of webdriver: " . spl_object_id($this->wd)); + $this->wd->get(self::$host . self::$port . '/Record/' . $record); + $this->wd->takeScreenshot("logs/adlr/info{$record}" . ($this->user ? '-' . $this->user : '') . ".png"); + + foreach (self::RULES ?? [] as $rule) { + if ($rule["waitForClass"]) { + $this->waitForClass($rule["waitForClass"], true); + } + if ($rule["waitForId"]) { + $this->waitForId($rule["waitForId"], true); + } + if ($rule["waitForLinkText"]) { + $this->waitForLinkText($rule["waitForLinkText"], true); + } + if ($rule["wait"]) { + try { + $this->wd->wait(5, 5000)->until( + WebDriverExpectedCondition::elementTextContains( + WebDriverBy::className($rule["wait"]), + $rule["text"] + ) + ); + } catch (\Facebook\WebDriver\Exception\NoSuchElementException $x) { + $this->log("Timeout for $record when fething {$rule["wait"]}."); + } + } + try { + $value = $this->findByCss($rule["path"])->getText(); + } catch (\Facebook\WebDriver\Exception\NoSuchElementException $x) { + $value = false; + } + switch ($rule["type"] ?? '') { + case 'text': + $this->assertEqualsIgnoringCase( + $rule["text"], + $value, + $rule["path"] . ($value === false ? " does not exists" : " is '" . $value . "' ") + . ", but should be '" . $rule["text"] . "'" + ); + break; + case 'contains': + $this->assertStringContainsStringIgnoringCase( + $rule["text"], + $value, + $record . ": " . + $rule["path"] . ($value === false ? " does not exists" : " is '" . $value . "' ") + . ", but should contain '" . $rule["text"] . "'" + ); + break; + case 'anti-exi': + $this->assertNotEqualsIgnoringCase( + $rule["text"], + $value, + $rule["path"] . " must not be equals to '" . $rule["text"] . "'" + ); + break; + } + } + } + + /* + * prepare records to fit in data provider array foramt + * test function iteself needs to be annotated by: @dataProvider provideRecords + * + * php unit test data provider: + * https://blog.martinhujer.cz/how-to-use-data-providers-in-phpunit/ + */ + public function provideRecords() + { + $data = []; + foreach (self::RECORDS as $record) { + $data[$record] = [$record]; + } + return $data; + /* $data will looks like: + * [ + * 'finc-87-14159' => ["finc-87-14159"], + * '0-1027717349' => ["0-1027717349"] + * ] + */ + } + + /** + * @dataProvider provideRecords + */ + public function testRecord($record) : void + { + $this->runGetItRecord($record); + } + + protected function setUp(): void + { + AdlrBase::setUp(); + if (method_exists($this, 'login')) { + $this->login("{$this->getUserName()}@adlr.link", $this->getPassword()); + } + } +} diff --git a/module/finc/tests/selenium/tests/adlr/Login.php b/module/finc/tests/selenium/tests/adlr/Login.php index 327aef76e556ba35a6aef1f9f813923c04b471fd..6a7a6a9342783e4029ebb427a0bbe33cf428d8dd 100644 --- a/module/finc/tests/selenium/tests/adlr/Login.php +++ b/module/finc/tests/selenium/tests/adlr/Login.php @@ -1,7 +1,9 @@ <?php namespace Selenium\adlr; + interface Login { public function getUserName(); + public function getPassword(); -} \ No newline at end of file +}