diff --git a/modules/behavioural_qc/test/behavioural_qcTest.php b/modules/behavioural_qc/test/behavioural_qcTest.php index 166202eafa2..a347300ea84 100644 --- a/modules/behavioural_qc/test/behavioural_qcTest.php +++ b/modules/behavioural_qc/test/behavioural_qcTest.php @@ -75,4 +75,57 @@ public function testPermissions(): void "Behavioural Quality Control" ); } + /** + * Tests that link to correct directions + * + * @return void + */ + public function testlinks(): void + { + $this->safeGet($this->url . "/behavioural_qc/"); + $bodyText = $this->safeFindElement( + WebDriverBy::cssSelector( + " #dynamictable >". + " tbody > tr:nth-child(1) > td:nth-child(2) > a" + ) + )->getAttribute('href'); + // check Instrument link + $this->assertStringContainsString( + "radiology_review/?candID=300001", + $bodyText + ); + $bodyText = $this->safeFindElement( + WebDriverBy::cssSelector( + " #dynamictable >". + " tbody > tr:nth-child(1) > td:nth-child(3) > a" + ) + )->getAttribute('href'); + // check Instrument link + $this->assertStringContainsString( + "300001", + $bodyText + ); + $bodyText = $this->safeFindElement( + WebDriverBy::cssSelector( + " #dynamictable >". + " tbody > tr:nth-child(1) > td:nth-child(4) > a" + ) + )->getAttribute('href'); + // check Instrument link + $this->assertStringContainsString( + "300001", + $bodyText + ); + $bodyText = $this->safeFindElement( + WebDriverBy::cssSelector( + " #dynamictable >". + " tbody > tr:nth-child(1) > td:nth-child(5) > a" + ) + )->getAttribute('href'); + // check Instrument link + $this->assertStringContainsString( + "instrument_list/?candID=300001", + $bodyText + ); + } }