Commit 46f3bd10 authored by Ivo Fokkema's avatar Ivo Fokkema

More fixes in the tests.

- Removed duplication in tests; there were three login tests that all did the same.
- Removed duplication in tests; there were two IVA disease creation tests, and one created an additional disease. This is confusing and useless duplication of code; split these features.
- When enabling the Individual/Gender column, the test wasn't checking if that was successful.
- Fixed wrong variable name in install_LOVD.php script.
- The screenshot uploader now also will dump the last lines of Apache's error log, which should contain PHP errors. This may confirm my theory that the tests are failing because PHP warnings due to a WIP commit have turned into fatal errors (perhaps because of xdebug that I can't seem to turn off?).
parent d3d58b0c
<?php
require_once 'LOVDSeleniumBaseTestCase.php';
use \Facebook\WebDriver\WebDriverBy;
use \Facebook\WebDriver\WebDriverExpectedCondition;
class LoginAsAdminTest extends LOVDSeleniumWebdriverBaseTestCase
{
public function testLoginAsAdmin()
{
$this->logout();
$this->login('admin', 'test1234');
}
}
......@@ -8,25 +8,15 @@ class CreateDiseaseIVATest extends LOVDSeleniumWebdriverBaseTestCase
{
public function testCreateDiseaseIVA()
{
$this->driver->get(ROOT_URL . "/src/diseases?create");
$this->enterValue(WebDriverBy::name("symbol"), "IVA");
$this->enterValue(WebDriverBy::name("name"), "isovaleric acidemia");
$this->enterValue(WebDriverBy::name("id_omim"), "243500");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[text()="IVD (isovaleryl-CoA dehydrogenase)"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create disease information entry']"));
$element->click();
$this->assertEquals("Successfully created the disease information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
$this->driver->get(ROOT_URL . "/src/diseases?create");
$this->enterValue(WebDriverBy::name("symbol"), "IVA2");
$this->enterValue(WebDriverBy::name("name"), "isovaleric acidemia TWEE");
$this->enterValue(WebDriverBy::name("name"), "isovaleric acidemia 2");
$this->enterValue(WebDriverBy::name("id_omim"), "243522");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[text()="IVD (isovaleryl-CoA dehydrogenase)"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create disease information entry']"));
$element->click();
$this->assertEquals("Successfully created the disease information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
}
}
......@@ -13,10 +13,12 @@ class CreateGenderColumnTest extends LOVDSeleniumWebdriverBaseTestCase
$element->click();
$element = $this->driver->findElement(WebDriverBy::linkText("Enable column"));
$element->click();
$this->enterValue(WebDriverBy::name("password"), "test1234");
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Add/enable custom data column Individual/Gender']"));
$element->click();
$bodyText = $this->driver->findElement(WebDriverBy::tagName("body"))->getText();
$this->assertContains('Successfully added column "Gender"!', $bodyText);
}
}
......@@ -79,7 +79,7 @@
<file>collaborator_tests/add_summary_variant_only_described_on_genomic_level.php</file>
<file>collaborator_tests/add_summary_variant_seatlleseq_file.php</file>
<file>collaborator_tests/add_summary_variant_vcf_file.php</file>
<file>collaborator_tests/login_as_admin.php</file>
<file>shared_tests/login_as_admin.php</file>
<file>collaborator_tests/curate_submitted_data.php</file>
<file>collaborator_tests/post_finish_add_variant_only_described_on_genomic_level_to_CMT_individual.php</file>
<file>collaborator_tests/post_finish_add_variant_located_within_gene_to_CMT_individual.php</file>
......@@ -157,6 +157,7 @@
<file>shared_tests/login_as_admin.php</file>
<file>shared_tests/create_gene_IVD.php</file>
<file>import_tests/create_gender_column.php</file>
<file>shared_tests/create_disease_IVA.php</file>
<file>import_tests/create_disease_IVA.php</file>
<file>import_tests/insert_import.php</file>
<file>import_tests/false_insert_import.php</file>
......@@ -185,7 +186,7 @@
<file>submitter_tests/add_summary_variant_only_described_on_genomic_level.php</file>
<file>submitter_tests/add_summary_variant_seatlleseq_file.php</file>
<file>submitter_tests/add_summary_variant_vcf_file.php</file>
<file>submitter_tests/login_as_admin.php</file>
<file>shared_tests/login_as_admin.php</file>
<file>submitter_tests/curate_submitted_data.php</file>
<file>submitter_tests/post_finish_add_variant_only_described_on_genomic_level_to_CMT_individual.php</file>
<file>submitter_tests/post_finish_add_variant_located_within_gene_to_CMT_individual.php</file>
......
......@@ -4,10 +4,10 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2016-05-30
* Modified : 2016-10-17
* For LOVD : 3.0-18
* Modified : 2019-09-04
* For LOVD : 3.0-22
*
* Copyright : 2016 Leiden University Medical Center; http://www.LUMC.nl/
* Copyright : 2016-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Programmers : M. Kroon <m.kroon@lumc.nl>
* Ivo F.A.C. Fokkema <I.F.A.C.Fokkema@LUMC.nl>
*
......@@ -93,8 +93,8 @@ class InstallLOVDTest extends LOVDSeleniumWebdriverBaseTestCase
// Another form
$this->enterValue(WebDriverBy::name("institute"), "Leiden University Medical Center");
$this->enterValue(WebDriverBy::name("email_address"), "noreply@LOVD.nl");
$countryOption = $this->driver->findElement(WebDriverBy::xpath('//select[@name="refseq_build"]/option[text()="hg19 / GRCh37"]'));
$countryOption->click();
$selectOption = $this->driver->findElement(WebDriverBy::xpath('//select[@name="refseq_build"]/option[text()="hg19 / GRCh37"]'));
$selectOption->click();
$sendstatsButton = $this->driver->findElement(WebDriverBy::name("send_stats"));
$sendstatsButton->click();
$includeButton = $this->driver->findElement(WebDriverBy::name("include_in_listing"));
......
<?php
require_once 'LOVDSeleniumBaseTestCase.php';
use \Facebook\WebDriver\WebDriverBy;
use \Facebook\WebDriver\WebDriverExpectedCondition;
class LoginAsAdminTest extends LOVDSeleniumWebdriverBaseTestCase
{
public function testLoginAsAdmin()
{
$this->logout();
$this->login('admin', 'test1234');
}
}
......@@ -3,6 +3,17 @@
# Base test directory (where this script is located).
GLOB="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Dump the tail of Apache's error log, if there are error screenshots.
if [ `ls -1 ${GLOB}/test_results/error_screenshots/ | wc -l` -gt 0 ];
then
# There are error screenshots. Also check for errors in the logs.
tail -n 50 /var/log/apache2/error.log;
fi # We could put an else and nicely die with exit 0, but the code below doesn't error anymore when there are no files.
# Loop through screenshot files (oldest to newest).
for file in `ls -1 -t -r ${GLOB}/test_results/error_screenshots/ | grep -F .png`; do
echo "Uploading file: ${file}";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment