From dfa2ce38ea8b86e210a88d12ad32aa49f85c020e Mon Sep 17 00:00:00 2001 From: Shen Date: Tue, 1 Oct 2024 11:43:51 -0400 Subject: [PATCH] [behavioural_qc] test (#9300) Add tests for behavioural qc module --- .../test/behavioural_qcTest.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) 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 + ); + } }