Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
05b1cce
dashboard
kongtiaowang May 4, 2016
e05d0a1
fda
kongtiaowang May 4, 2016
2f4ece0
dicom
nihao2011 May 5, 2016
87baaaf
dicom
nihao2011 May 5, 2016
15d0a96
ad
kongtiaowang May 6, 2016
c806966
fdsa
kongtiaowang May 9, 2016
454b3fb
document_repo
kongtiaowang May 12, 2016
6c9b817
d
kongtiaowang May 12, 2016
63ec391
doc repo
kongtiaowang May 18, 2016
5e81309
final review
kongtiaowang Jun 7, 2016
bf24f5d
add testing data
kongtiaowang Jun 8, 2016
45ecdd8
final
kongtiaowang Jun 9, 2016
7d78190
f
kongtiaowang Jun 9, 2016
5dd5e2d
add mri
kongtiaowang Jun 15, 2016
49264b4
mri data
kongtiaowang Jun 15, 2016
853cf07
add mri
kongtiaowang Jun 16, 2016
f3b3af2
add permission
kongtiaowang Jun 20, 2016
ab92fd3
fdas
kongtiaowang Jun 23, 2016
dff1413
todo
kongtiaowang Jun 29, 2016
0ca5e0c
d
kongtiaowang Jun 30, 2016
88d92c9
create_timepoint
kongtiaowang Jul 5, 2016
d7b4ae7
ct
kongtiaowang Jul 5, 2016
fad418a
wangshen_test
kongtiaowang Jul 5, 2016
1828867
crreate
kongtiaowang Jul 5, 2016
a5de5ba
examiner
kongtiaowang Jul 6, 2016
a19df87
fdsa
kongtiaowang Jul 12, 2016
f1781dd
dashboard
kongtiaowang Jul 13, 2016
2638db1
fdas
kongtiaowang Jul 14, 2016
8d18293
fas
kongtiaowang Jul 14, 2016
ab9e394
fda
kongtiaowang Jul 18, 2016
7ec7853
instrument_builder
kongtiaowang Jul 20, 2016
24b0b40
react
kongtiaowang Jul 20, 2016
484c375
react jsx
kongtiaowang Jul 20, 2016
abce2e3
add class name
kongtiaowang Jul 20, 2016
41be226
a
kongtiaowang Jul 20, 2016
915467c
reliabilityTest.php
kongtiaowang Jul 20, 2016
3f0a493
try catch finally
kongtiaowang Jul 21, 2016
2dbdb3b
help_editorTest.php
kongtiaowang Jul 21, 2016
32d3591
instrument_managerTest.php
kongtiaowang Jul 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 87 additions & 19 deletions modules/create_timepoint/test/create_timepointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @category Test
* @package Test
* @author Gregory Luneau <gregory.luneau@mcgill.ca>
* @author Wang Shen <wangshen.mcin@gmail.com>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @link https://github.com/aces/Loris
*/
Expand Down Expand Up @@ -70,33 +71,100 @@ function testCreateTimepointDoespageLoad()
*
* @return void
*/
function testCreateTimepointSelectSubproject()
function testCreateTimepoint()
{
$this->_createTimepoint('900000','Experimental','V1');
$bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
$this->assertContains("New time point successfully registered", $bodyText);

}
/**
* Tests that, create a timepoint and test the success link
*
*
* @return void
*/
function testCreateTimepointSuccessLink()
{
$this->_createTimepoint('900000','Experimental','V9');

$this->safeClick(WebDriverBy::LinkText("Click here to continue."));
sleep(3);
$bodyText = $this->webDriver->getPageSource();
$this->assertContains("V9", $bodyText);

}

/**
* Tests that, create a timepoint and input a error format visit label
* get Error message
*
* @return void
*/
function testCreateTimepointErrorVisitLabel()
{
$this->_createTimepoint('900000','Experimental','V9999');
$bodyText = $this->webDriver->getPageSource();
$this->assertContains("This visit label does not match the required structure.", $bodyText);

}

/**
* Create a timepoint with three parameters.
*
* @param string $canID ID of candidate
* @param string $subproject text of Subproject
* @param string $visitlabel
* @return void.
*/
private function _createTimepoint($canID, $subproject, $visitlabel)
{
$this->markTestIncomplete("Create Timepoint Page Test not implemented");

/*
$this->safeGet(
$this->url . "/create_timepoint/?candID=900000&identifier=900000"
$this->url . "/create_timepoint/?candID=" .$canID . "&identifier=" .$canID
);

$bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
$this->assertContains("Create Time Point", $bodyText);
$select = $this->safeFindElement(WebDriverBy::Name("subprojectID"));
$element = new WebDriverSelect($select);
$element->selectByVisibleText($subproject);

$subPS = $this->webDriver->findElement(WebDriverBy::Name("subprojectID"));
$subPS->sendKeys("subprojet 2\r");
$this->webDriver->findElement(WebDriverBy::Name("visitLabel"))->sendKeys($visitlabel);
$this->webDriver->findElement(WebDriverBy::Name("fire_away"))->click();

}

$vl = $this->webDriver->findElement(WebDriverBy::Name("visitlabel"));
$vl->sendKeys("V06");

$ctp = $this->webDriver->findElement(WebDriverBy::Name("fire_away"));
$ctp->click();
/**
* Tests that, create a timepoint and input a empty subproject
* get Error message
*
* @return void
*/
function testCreateTimepointErrorEmptySubproject()
{
$this->safeGet(
$this->url . "/create_timepoint/?candID=900000&identifier=900000"
);
$this->webDriver->findElement(WebDriverBy::Name("fire_away"))->click();
$bodyText = $this->webDriver->getPageSource();
$this->assertContains("A visit label is required for creating a timepoint.", $bodyText);

$visitlabel = $this->webDriver->findElement(
WebDriverBy::cssSelector(".col-sm-12~ .col-sm-12+ .col-sm-12 label")
)->getText();
$this->assertContains("Visit label", $visitlabel);
*/
}

/**
* Tests that timepoint loads with the permission
*
* @return void
*/
public function testCreateTimepointPermission()
{
$this->setupPermissions(array("data_entry"));
$this->safeGet($this->url . "/create_timepoint/?candID=900000&identifier=900000");
$bodyText = $this->webDriver->findElement(
WebDriverBy::cssSelector("body")
)->getText();

$this->assertNotContains("You do not have access to this page.", $bodyText);
$this->resetPermissions();
}
}
?>

6 changes: 3 additions & 3 deletions modules/dashboard/templates/form_dashboard.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<div class="panel-body">
<div class="list-group tasks">
{if $conflicts neq "" and $conflicts neq 0}
<a href="{$baseURL}/conflict_resolver/" class="list-group-item">
<a href="{$baseURL}/conflict_resolver/" class="list-group-item conflict_resolver">
<div class="row">
<div class="col-xs-8 text-left">
<div class="huge">{$conflicts}</div>
Expand All @@ -144,7 +144,7 @@
{/if}
{if $incomplete_forms neq "" and $incomplete_forms neq 0}
{if $incomplete_forms_site eq "Site: all"}
<a href="{$baseURL}/statistics/statistics_site/" class="list-group-item">
<a href="{$baseURL}/statistics/statistics_site/" class="list-group-item statistics">
{else}
<a href="{$baseURL}/statistics/statistics_site/?CenterID={$user_site}" class="list-group-item">
{/if}
Expand Down Expand Up @@ -175,7 +175,7 @@
</a>
{/if}
{if $violated_scans neq "" and $violated_scans neq 0}
<a href="{$baseURL}/mri_violations/" class="list-group-item">
<a href="{$baseURL}/mri_violations/" class="list-group-item mri_violations">
<div class="row">
<div class="col-xs-8 text-left">
<div class="huge">{$violated_scans}</div>
Expand Down
Loading