Commit 02172daf authored by Ivo Fokkema's avatar Ivo Fokkema

Fixed one small mistake in a test, and reverted a lot of recent changes.

- Now that we know why the tests failed, some of my changes were apparently not necessary, and there's no reason to keep all that code in.
- Tests should complete without problems now.
parent 309037a6
......@@ -5,6 +5,7 @@ php:
# aliased to a recent 5.5.x version
- 5.5
# aliased to a recent 5.6.xversion
# This one is usually failing due to unexpected halting of the process (and Travis then killing the build).
- 5.6
# aliased to a recent 7.x version
- 7.0
......
......@@ -15,10 +15,6 @@ class AddPhenotypeInfoToHealthyIndividualTest extends LOVDSeleniumWebdriverBaseT
$element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b"));
$element->click();
$this->assertTrue((bool)preg_match('/^[\s\S]*\/src\/phenotypes[\s\S]create&target=00000001$/', $this->driver->getCurrentURL()));
// This page redirects once. To prevent problems, we'll wait until we get the form.
$this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath("//input[@value='Create phenotype information entry']")));
$this->enterValue(WebDriverBy::name("Phenotype/Age"), "35y");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]'));
$option->click();
......
......@@ -4,7 +4,7 @@ require_once 'LOVDSeleniumBaseTestCase.php';
use \Facebook\WebDriver\WebDriverBy;
use \Facebook\WebDriver\WebDriverExpectedCondition;
class CreateDiseaseIVATest extends LOVDSeleniumWebdriverBaseTestCase
class CreateDiseaseIVATest2 extends LOVDSeleniumWebdriverBaseTestCase
{
public function testCreateDiseaseIVA()
{
......
......@@ -47,9 +47,6 @@ class FalseInsertImportTest extends LOVDSeleniumWebdriverBaseTestCase
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
// Wait for the form to show up again. If this starts randomly failing like the hgnc_id check before, we'll build a proper waiting loop.
$this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::name('MAX_FILE_SIZE')));
$element = $this->driver->findElement(WebDriverBy::linkText("Show 6 warnings"));
$element->click();
......
......@@ -47,9 +47,6 @@ class FalseUpdatetImportTest extends LOVDSeleniumWebdriverBaseTestCase
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
// Wait for the form to show up again. If this starts randomly failing like the hgnc_id check before, we'll build a proper waiting loop.
$this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::name('MAX_FILE_SIZE')));
$element = $this->driver->findElement(WebDriverBy::linkText("Show 34 warnings"));
$element->click();
......
......@@ -3,13 +3,12 @@
*
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2015-06-05
* Modified : 2019-09-03
* For LOVD : 3.0-22
* Created : 2016
* Modified : 2016-07-13
* For LOVD : 3.0-17
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Copyright : 2016 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>
*
*
* This file is part of LOVD.
......@@ -44,17 +43,7 @@ class InsertImportTest extends LOVDSeleniumWebdriverBaseTestCase
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
// Wait 30 seconds until we see it's done.
for ($i = 0; $i < 30; $i ++) {
$sBody = $this->driver->findElement(WebDriverBy::tagName("body"))->getText();
$nDone = substr_count($sBody, '100%');
if ($nDone == 2 || ($nDone && strpos($sBody, 'Applying changes...') === false)) {
// Either it's done importing, or it's done checking but it didn't start importing (something is wrong).
break;
}
}
$this->assertEquals("Done importing!", $this->driver->findElement(WebDriverBy::id("lovd_sql_progress_message_done"))->getText());
}
}
......@@ -3,13 +3,12 @@
*
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2015-06-05
* Modified : 2019-09-03
* For LOVD : 3.0-22
* Created : 2016
* Modified : 2016-07-13
* For LOVD : 3.0-17
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Copyright : 2016 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>
*
*
* This file is part of LOVD.
......@@ -44,17 +43,7 @@ class SecondInsertImportTest extends LOVDSeleniumWebdriverBaseTestCase
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
// Wait 30 seconds until we see it's done.
for ($i = 0; $i < 30; $i ++) {
$sBody = $this->driver->findElement(WebDriverBy::tagName("body"))->getText();
$nDone = substr_count($sBody, '100%');
if ($nDone == 2 || ($nDone && strpos($sBody, 'Applying changes...') === false)) {
// Either it's done importing, or it's done checking but it didn't start importing (something is wrong).
break;
}
}
$this->assertEquals("Done importing!", $this->driver->findElement(WebDriverBy::id("lovd_sql_progress_message_done"))->getText());
}
}
......@@ -3,13 +3,12 @@
*
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2015-06-23
* Modified : 2019-09-03
* For LOVD : 3.0-22
* Created : 2016
* Modified : 2016-07-13
* For LOVD : 3.0-17
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Copyright : 2016 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>
*
*
* This file is part of LOVD.
......@@ -44,17 +43,7 @@ class UpdatetImportTest extends LOVDSeleniumWebdriverBaseTestCase
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
// Wait 30 seconds until we see it's done.
for ($i = 0; $i < 30; $i ++) {
$sBody = $this->driver->findElement(WebDriverBy::tagName("body"))->getText();
$nDone = substr_count($sBody, '100%');
if ($nDone == 2 || ($nDone && strpos($sBody, 'Applying changes...') === false)) {
// Either it's done importing, or it's done checking but it didn't start importing (something is wrong).
break;
}
}
$this->assertTrue((bool)preg_match('/^[\s\S]*The following sections are modified and updated in the database: Columns, Diseases, Individuals, Phenotypes, Screenings, Variants_On_Genome, Variants_On_Transcripts\.$/', $this->driver->findElement(WebDriverBy::id("lovd_sql_progress_message_done"))->getText()));
}
}
......@@ -4,12 +4,11 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2017-06-27
* Modified : 2019-09-03
* For LOVD : 3.0-22
* Modified : 2017-12-08
* For LOVD : 3.0-21
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Copyright : 2017 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>
*
*
* This file is part of LOVD.
......@@ -109,15 +108,6 @@ class SubmissionApiSuccessTest extends LOVDSeleniumWebdriverBaseTestCase
// Trigger automatic import of scheduled files.
$this->driver->get(ROOT_URL . '/src/import?autoupload_scheduled_file');
// Wait 30 seconds until we see it's done.
for ($i = 0; $i < 30; $i ++) {
$sBody = $this->driver->findElement(WebDriverBy::tagName("body"))->getText();
$nDone = substr_count($sBody, '100%');
if ($nDone == 2 || ($nDone && strpos($sBody, 'Applying changes...') === false)) {
// Either it's done importing, or it's done checking but it didn't start importing (something is wrong).
break;
}
}
$bodyText = $this->driver->findElement(WebDriverBy::tagName("body"))->getText();
$this->assertContains('Success!', $bodyText);
......
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