public function testAddSummaryVariantOnlyDescribedOnGenomicLevel() { // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000003$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("tab_submit")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Please reconsider to submit individual data as well, as it makes the data you submit much more valuable![\\s\\S]*$/', $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Paternal (confirmed)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="chromosome"]/option[text()="15"]')); $option->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/DNA"), "g.40702976G>T"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "11/10000"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); }
public function testPostFinishAddPhenotypeInfoToIVAIndividual() { $element = $this->driver->findElement(WebDriverBy::id("tab_individuals")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/IVD$/', $this->driver->getCurrentURL())); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#00000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='00000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add phenotype information to individual")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes[\\s\\S]create&target=00000002$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("Phenotype/Additional"), "Additional phenotype information"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Phenotype/Inheritance"]/option[text()="Familial"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create phenotype information entry']")); $element->click(); $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); // Wait for page redirect. $this->waitUntil(WebDriverExpectedCondition::titleContains("View phenotype")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes\\/0000000003$/', $this->driver->getCurrentURL())); }
public function testAddVariantLocatedWithinGeneToCMTIndividual() { // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000001$/', $this->driver->getCurrentURL())); $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\\/variants[\\s\\S]create&target=0000000001$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath('//b[contains(., "A variant that is located within a gene")]')); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("GJB1")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Transcript&geneid=GJB1&target=0000000001$/', $this->driver->getCurrentURL())); $this->uncheck(WebDriverBy::name("ignore_00000001")); $this->enterValue(WebDriverBy::name("00000001_VariantOnTranscript/Exon"), "2"); $this->enterValue(WebDriverBy::name("00000001_VariantOnTranscript/DNA"), "c.34G>T"); $element = $this->driver->findElement(WebDriverBy::cssSelector("button.mapVariant")); $element->click(); // Wait until RNA description field is filled after AJAX request. $firstRNAInputSelector = '(//input[contains(@name, "VariantOnTranscript/RNA")])[1]'; $this->waitUntil(function ($driver) use($firstRNAInputSelector) { $firstRNAInput = $driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); return !empty($firstRNAValue); }); // Check RNA description for first transcript. $firstRNAInput = $this->driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); $this->assertTrue((bool) preg_match('/^r\\.\\([\\s\\S]\\)$/', $firstRNAValue)); // Check protein description for first transcript. $firstProteinInputSelector = '(//input[contains(@name, "VariantOnTranscript/Protein")])[1]'; $firstProteinInput = $this->driver->findElement(WebDriverBy::xpath($firstProteinInputSelector)); $firstProteinValue = $firstProteinInput->getAttribute('value'); $this->assertEquals("p.(Gly12Cys)", $firstProteinValue); $GenomicDNAChange = $this->driver->findElement(WebDriverBy::name('VariantOnGenome/DNA')); $this->assertEquals("g.70443591G>T", $GenomicDNAChange->getAttribute('value')); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000001_effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000001_effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Maternal (confirmed)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "0.003"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->assertEquals("Successfully created the variant entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testWithoutMagium() { // This test is based off of my own test environment and so everything up until the Twitter authentication will // not work. So ignore the first part. $webDriver = RemoteWebDriver::create('http://*****:*****@data-strategy="twitter"]')); $webDriver->wait()->until(ExpectedCondition::visibilityOf($element)); $element->click(); // Start from here $configurationProvider = new StandardConfigurationProvider(new ConfigurationReader(), new ClassConfigurationReader(), new EnvironmentConfigurationReader()); $collector = new DefaultPropertyCollector(); $action = new AuthenticateTwitter($webDriver, new \Magium\Twitter\Themes\Twitter($configurationProvider, $collector), new Twitter($configurationProvider, $collector)); $action->execute(); $webDriver->quit(); }
public function testCreateIndividualDiagnosedWithCMT() { $element = $this->driver->findElement(WebDriverBy::id("tab_submit")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL())); $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\\/individuals[\\s\\S]create$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("Individual/Lab_ID"), "12345CMT"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("Individual/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("Individual/Remarks"), "No Remarks"); $this->enterValue(WebDriverBy::name("Individual/Remarks_Non_Public"), "Still no remarks"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_diseases[]"]/option[text()="CMT (Charcot Marie Tooth Disease)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create individual information entry']")); $element->click(); $this->assertEquals("Successfully created the individual information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testPostFinishAddPhenotypeInfoToCMTIndividual() { // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000003$/', $this->driver->getCurrentURL())); // Move mouse to Individuals tab and click 'view all individuals' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_individuals")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allIndividualsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all individuals')); $allIndividualsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::cssSelector("td.ordered")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000001$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add phenotype information to individual")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes[\\s\\S]create&target=00000001$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("Phenotype/Additional"), "Additional phenotype information"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Phenotype/Inheritance"]/option[text()="Familial"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create phenotype information entry']")); $element->click(); $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("View phenotype")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes\\/0000000002$/', $this->driver->getCurrentURL())); }
public function testAddVariantOnlyDescribedOnGenomicLevelToIVAIndividual() { // wait for page redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000002$/', $this->driver->getCurrentURL())); $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\\/variants[\\s\\S]create&target=0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//table[2]/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome&target=0000000002$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Paternal (confirmed)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="chromosome"]/option[text()="15"]')); $option->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/DNA"), "g.40702876G>T"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "11/10000"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->assertEquals("Successfully created the variant entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testAddVariantLocatedWithinGeneToHealthyIndividual() { // wait for page redirect $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b"))); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000001$/', $this->driver->getCurrentURL())); $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\\/variants[\\s\\S]create&target=0000000001$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath('//b[contains(., "A variant that is located within a gene")]')); // $element = $this->driver->findElement(WebDriverBy::xpath("//table[2]/tbody/tr/td[2]/b")); $element->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//tr[@id='IVD']/td[2]")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Transcript&geneid=IVD&target=0000000001$/', $this->driver->getCurrentURL())); $this->uncheck(WebDriverBy::name("ignore_00000001")); $this->enterValue(WebDriverBy::name("00000001_VariantOnTranscript/Exon"), "2"); $this->enterValue(WebDriverBy::name("00000001_VariantOnTranscript/DNA"), "c.456T>G"); $element = $this->driver->findElement(WebDriverBy::cssSelector("button.mapVariant")); $element->click(); // Wait until RNA description field is filled after AJAX request. $firstRNAInputSelector = '(//input[contains(@name, "VariantOnTranscript/RNA")])[1]'; $this->waitUntil(function ($driver) use($firstRNAInputSelector) { $firstRNAInput = $driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); return !empty($firstRNAValue); }); // Check RNA description. $firstRNAInput = $this->driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); $this->assertTrue((bool) preg_match('/^r\\.\\([\\s\\S]\\)$/', $firstRNAValue)); // Check protein description. $firstProteinInputSelector = '(//input[contains(@name, "VariantOnTranscript/Protein")])[1]'; $firstProteinInput = $this->driver->findElement(WebDriverBy::xpath($firstProteinInputSelector)); $firstProteinValue = $firstProteinInput->getAttribute('value'); $this->assertRegExp('/^p\\.\\(Tyr152[\\s\\S]*\\)$/', $firstProteinValue); $GenomicDNAChange = $this->driver->findElement(WebDriverBy::name('VariantOnGenome/DNA')); $this->assertEquals("g.40702987T>G", $GenomicDNAChange->getAttribute('value')); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000001_effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000001_effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Paternal (confirmed)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "0.05"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->assertEquals("Successfully created the variant entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testMakeUserCurator() { $this->driver->get(ROOT_URL . "/src/genes/IVD?authorize"); $element = $this->driver->findElement(WebDriverBy::linkText("Test Curator")); $element->click(); $this->enterValue(WebDriverBy::xpath("//td/input[@type='password']"), "test1234"); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Save curator list']")); $element->click(); $this->assertEquals("Successfully updated the curator list!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testCreateGenderColumn() { $this->driver->get(ROOT_URL . "/src/columns/Individual/Gender"); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Columns")); $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(); }
public function testPostFinishAddVariantOnlyDescribedOnGenomicLevelToCMT() { $this->logout(); $this->login('collaborator', 'test1234'); $this->driver->get(ROOT_URL . "/src/"); // Move mouse to Screenings tab and click 'view all screenings' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_screenings")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allVariantsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all screenings')); $allVariantsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings$/', $this->driver->getCurrentURL())); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#0000000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='0000000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Screenings")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add variant to screening")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&target=0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//table[2]/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome&target=0000000002$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Maternal (confirmed)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="chromosome"]/option[text()="X"]')); $option->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/DNA"), "g.40702876G>T"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "11/10000"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); for ($second = 0;; $second++) { if ($second >= 60) { $this->fail("timeout"); } try { if ($this->isElementPresent(WebDriverBy::cssSelector("table[class=info]"))) { break; } } catch (Exception $e) { } sleep(1); } $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); }
public function find(RemoteWebDriver $webDriver) { switch ($this->type) { case self::ID: return $webDriver->findElement(WebDriverBy::id($this->value)); case self::CSS_SELECTOR: return $webDriver->findElement(WebDriverBy::cssSelector($this->value)); case self::LINK_TEXT: return $webDriver->findElement(WebDriverBy::linkText($this->value)); default: throw new \LogicException('Invalid element search type: ' . $this->type); } }
public function testMakeUserCollaboratorGJB() { $this->driver->get(ROOT_URL . "/src/genes/GJB1?authorize"); // $this->selectWindow("null"); $element = $this->driver->findElement(WebDriverBy::linkText("Test Collaborator")); $element->click(); // $this->uncheck("xpath=(//input[@name='allow_edit[]'])[2]"); $this->uncheck(WebDriverBy::xpath("(//input[@name='allow_edit[]'])[2]")); $this->enterValue(WebDriverBy::xpath("//td/input[@type='password']"), "test1234"); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Save curator list']")); $element->click(); $this->assertEquals("Successfully updated the curator list!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testAddSummaryVariantVCFFile() { // Mouse hover over Submit tab, to make 'submit new data' link visible. $tabElement = $this->driver->findElement(WebDriverBy::xpath("//img[@id='tab_submit']")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $element = $this->driver->findElement(WebDriverBy::linkText("Submit new data")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Please reconsider to submit individual data as well, as it makes the data you submit much more valuable![\\s\\S]*$/', $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b")); $element->click(); $this->driver->get(ROOT_URL . "/src/variants/upload?create&type=VCF"); $this->enterValue(WebDriverBy::name("variant_file"), ROOT_PATH . "../tests/test_data_files/ShortVCFfilev1.vcf"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="hg_build"]/option[text()="hg19"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="dbSNP_column"]/option[text()="VariantOnGenome/Reference"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genotype_field"]/option[text()="Use Phred-scaled genotype likelihoods (PL)"]')); $option->click(); $this->check(WebDriverBy::name("allow_mapping")); $this->check(WebDriverBy::name("allow_create_genes")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Upload VCF file']")); $element->click(); $this->assertEquals("25 variants were imported, 1 variant could not be imported.", $this->driver->findElement(WebDriverBy::id("lovd__progress_message"))->getText()); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $element->click(); $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); for ($second = 0;; $second++) { if ($second >= 600) { $this->fail("timeout"); } $this->driver->get(ROOT_URL . "/src/ajax/map_variants.php"); if (strcmp("0 99 There are no variants to map in the database", $this->driver->findElement(WebDriverBy::tagName("body"))->getText())) { break; } $this->assertNotContains("of 25 variants", $this->driver->findElement(WebDriverBy::tagName("body"))->getText()); sleep(1); } }
public function testAddSummaryVariantSeattleseqFile() { // Mouse hover over Submit tab, to make 'submit new data' link visible. $tabElement = $this->driver->findElement(WebDriverBy::xpath("//img[@id='tab_submit']")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $element = $this->driver->findElement(WebDriverBy::linkText("Submit new data")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Please reconsider to submit individual data as well, as it makes the data you submit much more valuable![\\s\\S]*$/', $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create&type=SeattleSeq$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("variant_file"), ROOT_PATH . "../tests/test_data_files/ShortSeattleSeqAnnotation138v1.txt"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="hg_build"]/option[text()="hg19"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="dbSNP_column"]/option[text()="VariantOnGenome/Reference"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="autocreate"]/option[text()="Create genes and transcripts"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Upload SeattleSeq file']")); $this->clickNoTimeout($element); for ($second = 0;; $second++) { if ($second >= 300) { $this->fail("timeout"); } try { if ($this->isElementPresent(WebDriverBy::xpath("//input[@value='Continue »']"))) { break; } } catch (Exception $e) { } sleep(1); } $this->assertContains("138 variants were imported, 1 variant could not be imported.", $this->driver->findElement(WebDriverBy::id("lovd__progress_message"))->getText()); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $element->click(); $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); }
public function testAddVariantLocatedWithinGeneToIVAIndividual() { $this->driver->get(ROOT_URL . "/src/variants?create&reference=Transcript&geneid=IVD&target=0000000001"); $this->uncheck(WebDriverBy::name("ignore_00000001")); $this->enterValue(WebDriverBy::name("00000001_VariantOnTranscript/Exon"), "2"); $this->enterValue(WebDriverBy::name("00000001_VariantOnTranscript/DNA"), "c.345G>T"); $element = $this->driver->findElement(WebDriverBy::cssSelector("button.mapVariant")); $element->click(); // Wait until RNA description field is filled after AJAX request. $firstRNAInputSelector = '(//input[contains(@name, "VariantOnTranscript/RNA")])[1]'; $this->waitUntil(function ($driver) use($firstRNAInputSelector) { $firstRNAInput = $driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); return !empty($firstRNAValue); }); // Check RNA description for first transcript. $firstRNAInput = $this->driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); $this->assertTrue((bool) preg_match('/^r\\.\\([\\s\\S]\\)$/', $firstRNAValue)); // Check protein description for first transcript. $firstProteinInputSelector = '(//input[contains(@name, "VariantOnTranscript/Protein")])[1]'; $firstProteinInput = $this->driver->findElement(WebDriverBy::xpath($firstProteinInputSelector)); $firstProteinValue = $firstProteinInput->getAttribute('value'); $this->assertEquals("p.(Met115Ile)", $firstProteinValue); $GenomicDNAChange = $this->driver->findElement(WebDriverBy::name('VariantOnGenome/DNA')); $this->assertEquals("g.40702876G>T", $GenomicDNAChange->getAttribute('value')); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000001_effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000001_effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Paternal (confirmed)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "0.05"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="Test Owner (#00006)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->assertEquals("Successfully created the variant entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testCreateIndividualDiagnosedWithCMT() { $element = $this->driver->findElement(WebDriverBy::id("tab_submit")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals[\\s\\S]create$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("Individual/Lab_ID"), "12345CMT"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); $this->enterValue(WebDriverBy::name("Individual/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("Individual/Remarks"), "No Remarks"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_diseases[]"]/option[text()="CMT (Charcot Marie Tooth Disease)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create individual information entry']")); $element->click(); $this->assertEquals("Successfully created the individual information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testPostFinishAddVariantOnlyDescribedOnGenomicLevelToIVAIndividual() { $this->driver->get(ROOT_URL . "/src/screenings/IVD"); $element = $this->driver->findElement(WebDriverBy::id("tab_screenings")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/IVD$/', $this->driver->getCurrentURL())); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#0000000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='0000000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Screenings")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add variant to screening")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&target=0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//table[2]/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome&target=0000000002$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Paternal (confirmed)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="chromosome"]/option[text()="15"]')); $option->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/DNA"), "g.40702876G>T"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "11/10000"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Effect unknown"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText())); // wait for page redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000333$/', $this->driver->getCurrentURL())); }
public function testCurateSubmittedData() { $element = $this->driver->findElement(WebDriverBy::id("tab_variants")); $element->click(); // Move mouse to Variants tab and click 'view all genomic variants' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_variants")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allVariantsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all genomic variants')); $allVariantsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::linkText("0000000001")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000001$/', $this->driver->getCurrentURL())); $this->assertEquals("Pending", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Variants")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Publish (curate) variant entry")); $element->click(); $this->assertEquals("Public", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); $element = $this->driver->findElement(WebDriverBy::linkText("00000001")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000001$/', $this->driver->getCurrentURL())); $this->assertEquals("Pending", $this->driver->findElement(WebDriverBy::xpath("//tr[8]/td"))->getText()); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Publish (curate) individual entry")); $element->click(); $this->assertEquals("Public", $this->driver->findElement(WebDriverBy::xpath("//tr[8]/td"))->getText()); // Move mouse to Variants tab and click 'view all genomic variants' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_variants")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allVariantsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all genomic variants')); $allVariantsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::linkText("0000000002")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000002$/', $this->driver->getCurrentURL())); $this->assertEquals("Pending", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Variants")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Publish (curate) variant entry")); $element->click(); $this->assertEquals("Public", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); }
public function testDeleteGeneIVD() { $this->driver->get(ROOT_URL . "/src/phenotypes/0000000003"); $element = $this->driver->findElement(WebDriverBy::id("tab_genes")); $element->click(); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Genes")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Delete gene entry")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/genes\\/IVD[\\s\\S]delete$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("password"), "test1234"); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Delete gene information entry']")); $element->click(); $this->assertEquals("You are about to delete 1 transcript(s) and related information on 3 variant(s) on those transcripts. Please fill in your password one more time to confirm the removal of gene IVD.", $this->driver->findElement(WebDriverBy::xpath("//*/table[@class='info'][2]"))->getText()); $this->enterValue(WebDriverBy::name("password"), "test1234"); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Delete gene information entry']")); $element->click(); $this->assertEquals("Successfully deleted the gene information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); // Wait for page redirect. $this->waitUntil(WebDriverExpectedCondition::titleContains("View all genes")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/genes$/', $this->driver->getCurrentURL())); }
public function testCreateIndividualDiagnosedWithIVA() { $this->driver->get(ROOT_URL . "/src/submit"); $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\\/individuals[\\s\\S]create$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("Individual/Lab_ID"), "12345IVA"); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); $this->enterValue(WebDriverBy::name("Individual/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("Individual/Remarks"), "No Remarks"); $this->enterValue(WebDriverBy::name("Individual/Remarks_Non_Public"), "Still no remarks"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_diseases[]"]/option[text()="IVA (isovaleric acidemia)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="Test Owner (#00006)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create individual information entry']")); $element->click(); $this->assertEquals("Successfully created the individual information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testPostFinishAddScreeningToCMTIndividual() { // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000006$/', $this->driver->getCurrentURL())); // Move mouse to Screenings tab and click 'view all screenings' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_individuals")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allIndividualsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all individuals')); $allIndividualsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::cssSelector("td.ordered")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000001$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add screening to individual")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings[\\s\\S]create&target=00000001$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Template[]"]/option[text()="RNA (cDNA)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Template[]"]/option[text()="Protein"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="array for Comparative Genomic Hybridisation"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="array for resequencing"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="array for SNP typing"]')); $option->click(); // $this->addSelection(WebDriverBy::name("genes[]"), "value=GJB1"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[@value="GJB1"]')); $option->click(); $this->check(WebDriverBy::name("variants_found")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create screening information entry']")); $element->click(); $this->assertEquals("Successfully created the screening entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
public function testCreateGeneGJB() { // Mouse hover over genes tab, to make 'create a new gene entry' link visible. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_genes")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $element = $this->driver->findElement(WebDriverBy::linkText("Create a new gene entry")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/genes[\\s\\S]create$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("hgnc_id"), "GJB1"); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $element->click(); // $this->addSelection(WebDriverBy::name("active_transcripts[]"), "value=NM_001097642.2"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_transcripts[]"]/option[@value="NM_001097642.2"]')); $option->click(); $this->check(WebDriverBy::name("show_hgmd")); $this->check(WebDriverBy::name("show_genecards")); $this->check(WebDriverBy::name("show_genetests")); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create gene information entry']")); $element->click(); $this->assertEquals("Successfully created the gene information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); $this->waitUntil(WebDriverExpectedCondition::titleContains("View GJB1 gene")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/genes\\/GJB1$/', $this->driver->getCurrentURL())); }
public function testPostFinishAddScreeningToIVAIndividual() { $element = $this->driver->findElement(WebDriverBy::id("tab_individuals")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/IVD$/', $this->driver->getCurrentURL())); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#00000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='00000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add screening to individual")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings[\\s\\S]create&target=00000002$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Template[]"]/option[text()="RNA (cDNA)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Template[]"]/option[text()="Protein"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="array for Comparative Genomic Hybridisation"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="array for resequencing"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="array for SNP typing"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[text()="IVD (isovaleryl-CoA dehydrogenase)"]')); $option->click(); $this->check(WebDriverBy::name("variants_found")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create screening information entry']")); $element->click(); $this->assertEquals("Successfully created the screening entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); // wait for page redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000004$/', $this->driver->getCurrentURL())); }
/** * @param array $by * @return WebDriverBy */ protected function getStrictLocator(array $by) { $type = key($by); $locator = $by[$type]; switch ($type) { case 'id': return WebDriverBy::id($locator); case 'name': return WebDriverBy::name($locator); case 'css': return WebDriverBy::cssSelector($locator); case 'xpath': return WebDriverBy::xpath($locator); case 'link': return WebDriverBy::linkText($locator); case 'class': return WebDriverBy::className($locator); default: throw new MalformedLocatorException("{$by} => {$locator}", "Strict locator can be either xpath, css, id, link, class, name: "); } }
/** * Returns an element by the given link text. * If nothing is found, an empty array will be returned. * * @param string $linkText Link text of expected element. * @param int $attempts Attempts until the method will fail and return false. * * @return WebDriverElement[]|array */ public function getArrayByLinkText($linkText, $attempts = 2) { if ($this->isFailed()) { return []; } $by = WebDriverBy::linkText($linkText); return $this->getArrayBy($by, $attempts); }
public function testWebDriverByLocators() { $this->module->amOnPage('/login'); $this->module->seeElement(WebDriverBy::id('submit-label')); $this->module->seeElement(WebDriverBy::name('password')); $this->module->seeElement(WebDriverBy::className('optional')); $this->module->seeElement(WebDriverBy::cssSelector('form.global_form_box')); $this->module->seeElement(WebDriverBy::xpath(\Codeception\Util\Locator::tabIndex(4))); $this->module->fillField(WebDriverBy::name('password'), '123456'); $this->module->amOnPage('/form/select'); $this->module->selectOption(WebDriverBy::name('age'), 'child'); $this->module->amOnPage('/form/checkbox'); $this->module->checkOption(WebDriverBy::name('terms')); $this->module->amOnPage('/'); $this->module->seeElement(WebDriverBy::linkText('Test')); $this->module->click(WebDriverBy::linkText('Test')); $this->module->seeCurrentUrlEquals('/form/hidden'); }
public function testAddSummaryVariantLocatedWithinGene() { $element = $this->driver->findElement(WebDriverBy::id("tab_submit")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Please reconsider to submit individual data as well, as it makes the data you submit much more valuable![\\s\\S]*$/', $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b")); $element->click(); $element = $this->driver->findElement(WebDriverBy::cssSelector("#ARSD > td.ordered")); $element->click(); $this->assertContains("src/variants?create&reference=Transcript&geneid=ARSD", $this->driver->getCurrentURL()); for ($second = 0;; $second++) { if ($second >= 60) { $this->fail("timeout"); } try { if ($this->isElementPresent(WebDriverBy::name("ignore_00000002"))) { break; } } catch (Exception $e) { } sleep(1); } $this->uncheck(WebDriverBy::name("ignore_00000003")); $this->enterValue(WebDriverBy::name("00000002_VariantOnTranscript/Exon"), "3"); $this->enterValue(WebDriverBy::name("00000002_VariantOnTranscript/DNA"), "c.62T>A"); $element = $this->driver->findElement(WebDriverBy::cssSelector("button.mapVariant")); $element->click(); // Wait until the first two RNA-change input fields contain data. $firstRNAInputSelector = '(//input[contains(@name, "VariantOnTranscript/RNA")])[1]'; $secondRNAInputSelector = '(//input[contains(@name, "VariantOnTranscript/RNA")])[2]'; $this->waitUntil(function ($driver) use($firstRNAInputSelector, $secondRNAInputSelector) { $firstRNAInput = $driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); $secondRNAInput = $driver->findElement(WebDriverBy::xpath($secondRNAInputSelector)); $secondRNAValue = $secondRNAInput->getAttribute('value'); return !empty($firstRNAValue) && !empty($secondRNAValue); }); // Check RNA description for first transcript. $firstRNAInput = $this->driver->findElement(WebDriverBy::xpath($firstRNAInputSelector)); $firstRNAValue = $firstRNAInput->getAttribute('value'); $this->assertTrue((bool) preg_match('/^r\\.\\([\\s\\S]\\)$/', $firstRNAValue)); // Check protein description for first transcript. $firstProteinInputSelector = '(//input[contains(@name, "VariantOnTranscript/Protein")])[1]'; $firstProteinInput = $this->driver->findElement(WebDriverBy::xpath($firstProteinInputSelector)); $firstProteinValue = $firstProteinInput->getAttribute('value'); $this->assertEquals("p.(Leu21Gln)", $firstProteinValue); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000002_effect_reported"]/option[text()="Probably affects function"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000002_effect_concluded"]/option[text()="Probably does not affect function"]')); $option->click(); $this->enterValue(WebDriverBy::name("00000003_VariantOnTranscript/Exon"), "3"); $this->enterValue(WebDriverBy::name("00000004_VariantOnTranscript/Exon"), "3"); $this->enterValue(WebDriverBy::name("00000005_VariantOnTranscript/Exon"), "3"); // Check DNA description for first transcript. $firstDNAInputSelector = '(//input[contains(@name, "VariantOnTranscript/DNA")])[1]'; $firstDNAInput = $this->driver->findElement(WebDriverBy::xpath($firstDNAInputSelector)); $firstDNAValue = $firstDNAInput->getAttribute('value'); $this->assertEquals("c.62T>A", $firstDNAValue); // Check RNA description for second transcript. $secondRNAInput = $this->driver->findElement(WebDriverBy::xpath($secondRNAInputSelector)); $secondRNAValue = $secondRNAInput->getAttribute('value'); $this->assertTrue((bool) preg_match('/^r\\.\\([\\s\\S]\\)$/', $secondRNAValue)); // Check protein description for second transcript. $secondProteinInputSelector = '(//input[contains(@name, "VariantOnTranscript/Protein")])[2]'; $secondProteinInput = $this->driver->findElement(WebDriverBy::xpath($secondProteinInputSelector)); $secondProteinValue = $secondProteinInput->getAttribute('value'); $this->assertEquals("p.(Leu21Gln)", $secondProteinValue); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000003_effect_reported"]/option[text()="Probably affects function"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="00000003_effect_concluded"]/option[text()="Probably does not affect function"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Maternal (confirmed)"]')); $option->click(); $GenomicDNAChange = $this->driver->findElement(WebDriverBy::name('VariantOnGenome/DNA')); $this->assertEquals("g.2843789A>T", $GenomicDNAChange->getAttribute('value')); $element = $this->driver->findElement(WebDriverBy::linkText("PubMed")); $element->click(); // Move mouse to let browser hide tooltip of pubmed link (needed for chrome) $this->driver->getMouse()->mouseMove(null, 200, 200); $this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "55/18000"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Affects function"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Affects function"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']")); $element->click(); $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::cssSelector("table[class=info]"))); $this->assertContains("Successfully processed your submission and sent an email notification to the relevant curator", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); }
/** * Client expects that an element is selected by the given link text. * Returns true when the element is selected and false otherwise. * Retry the process two times or until the attempts argument count * is reached when a stale element reference exception is thrown. * Recommended usage in web driver waits. * * @param string $linkText Link text of expected element. * @param int $attempts (Optional) Attempts until the method will fail and return false. * * @return bool */ public function expectsToBeSelectedByLinkText($linkText, $attempts = 2) { if ($this->isFailed()) { return false; } $by = WebDriverBy::linkText($linkText); return $this->expectsToBeSelected($by, $attempts); }
public function testFalseUpdatetImport() { $this->driver->get(ROOT_URL . "/src/import"); $this->enterValue(WebDriverBy::name("import"), ROOT_PATH . "../tests/test_data_files/FalseUpdateImport.txt"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="mode"]/option[text()="Update existing data (in beta)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::name("simulate")); $element->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Show 33 warnings")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 8\\): Will not update column Individual\\/Age_of_death, too many fields are different from the database \\(col_order, width, standard, head_column, description_form, description_legend_short, description_legend_full, mysql_type, form_type, select_options, preg_pattern\\)\\. There is a maximum of 1 difference to prevent accidental updates\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 8\\): Can[\\s\\S]t update hgvs for column entry Individual\\/Age_of_death: Not allowed to change the HGVS standard status of any column\\. Value is currently "0" and value in the import file is "1"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 8\\): Incorrect value for field [\\s\\S]col_order[\\s\\S], which needs to be numeric, between 0 and 255\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 8\\): Incorrect value for field [\\s\\S]standard[\\s\\S], which should be 0 or 1\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 8\\): Select option #3 "yes\\(\\)[\\s\\S]* = Consanguineous parents" not understood\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 8\\): The [\\s\\S]Regular expression pattern[\\s\\S] field does not seem to contain valid PHP Perl compatible regexp syntax\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Columns, line 9\\): ID "Individual\\/Age_of_death" already defined at line 8\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Genes, line 14\\): Can[\\s\\S]t update chromosome for gene entry IVD: Not allowed to change the chromosome\\. Value is currently "15" and value in the import file is "151"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Genes, line 14\\): Can[\\s\\S]t update name for gene entry IVD: Not allowed to change the gene name\\. Value is currently "isovaleryl-CoA dehydrogenase" and value in the import file is "isovaleryl-CoA dehydrogenase1"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Genes, line 15\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Transcripts, line 20\\): Can[\\s\\S]t update id_ncbi for transcript entry 00001: Not allowed to change the NCBI ID\\. Value is currently "NM_002225\\.3" and value in the import file is "NM_999999\\.3"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Transcripts, line 20\\): Transcript "00001" does not match the same gene and\\/or the same NCBI ID as in the database\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Transcripts, line 21\\): ID "00001" already defined at line 20\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Diseases, line 27\\): Will not update disease 00000, too many fields are different from the database \\(symbol, name, id_omim\\)\\. There is a maximum of 1 difference to prevent accidental updates\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Diseases, line 27\\): Another disease already exists with this OMIM ID[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Diseases, line 27\\): Another disease already exists with the same name![\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Diseases, line 28\\): Will not update disease 00002, too many fields are different from the database \\(symbol, name, id_omim\\)\\. There is a maximum of 1 difference to prevent accidental updates\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Diseases, line 28\\): Another disease already exists with the same name![\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Genes_To_Diseases, line 34\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 39\\): Individual "00000022" does not exist in the database and is not defined \\(properly\\) in this import file\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 40\\): Will not update individual 00000002, too many fields are different from the database \\(panelid, panel_size\\)\\. There is a maximum of 1 difference to prevent accidental updates\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 40\\): The [\\s\\S]Panel ID[\\s\\S] can not link to itself; this field is used to indicate to which panel this individual belongs\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 40\\): Panel size of Individual "00000002" must be lower than the panel size of Individual "00000002"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 41\\): Will not update individual 00000003, too many fields are different from the database \\(fatherid, motherid, panelid\\)\\. There is a maximum of 1 difference to prevent accidental updates\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 41\\): Panel ID "00000001" refers to an individual, not a panel \\(group of individuals\\)\\. If you want to configure that individual as a panel, set its [\\s\\S]Panel size[\\s\\S] field to a value higher than 1\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 41\\): The [\\s\\S]fatherid[\\s\\S] can not link to itself; this field is used to indicate which individual in the database is the parent of the given individual\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 41\\): The fatherid "00000003" you entered does not refer to a male individual\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 41\\): Individual "00000022" does not exist in the database and is not defined \\(properly\\) in this import file\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 42\\): The motherid "00000002" refers to an panel \\(group of individuals\\), not an individual\\. If you want to configure that panel as an individual, set its [\\s\\S]Panel size[\\s\\S] field to value 1\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals, line 43\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Individuals_To_Diseases, line 49\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Phenotypes, line 54\\): Can[\\s\\S]t update diseaseid for phenotype entry 0000000001: Not allowed to change the disease\\. Value is currently "00001" and value in the import file is "00004"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Phenotypes, line 54\\): Can[\\s\\S]t update individualid for phenotype entry 0000000001: Not allowed to change the individual\\. Value is currently "00000001" and value in the import file is "00000022"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Phenotypes, line 54\\): Disease "00004" does not exist in the database and is not defined in this import file\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Phenotypes, line 54\\): Individual "00000022" does not exist in the database and is not defined in this import file\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Phenotypes, line 55\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Screenings, line 60\\): Can[\\s\\S]t update individualid for screening entry 0000000001: Not allowed to change the individual\\. Value is currently "00000001" and value in the import file is "00000022"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Screenings, line 60\\): Individual "00000022" does not exist in the database and is not defined in this import file\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Screenings, line 61\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Screenings_To_Genes, line 67\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Variants_On_Genome, line 72\\): Can[\\s\\S]t update position_g_start for variant entry 0000000001: Not allowed to change the genomic start position\\. Value is currently "40702876" and value in the import file is "abc"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Variants_On_Genome, line 72\\): The field \'position_g_start\' must contain a positive integer, "abc" does not match\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Variants_On_Genome, line 73\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Variants_On_Transcripts, line 78\\): Can[\\s\\S]t update position_c_start for variant entry 0000000001: Not allowed to change the start position\\. Value is currently "345" and value in the import file is "abc"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Variants_On_Transcripts, line 78\\): The field \'position_c_start\' must contain an integer, "abc" does not match\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Variants_On_Transcripts, line 80\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Error \\(Screenings_To_Variants, line 86\\): This line refers to a non-existing entry\\. When the import mode is set to update, no new inserts can be done\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Columns, line 8\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-02 15:42:07"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Columns, line 8\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00000"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Columns, line 8\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-02 15:42:07"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Columns, line 9\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-12 15:33:25"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Genes, line 14\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-02 15:42:21"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Genes, line 14\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Genes, line 14\\): Updated date field is set by LOVD\\. Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-02 15:42:48"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Transcripts, line 20\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-02 15:42:21"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Transcripts, line 20\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Transcripts, line 20\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-02 15:42:21"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Transcripts, line 21\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-12 15:33:40"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 26\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-02 15:42:23"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 26\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 26\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-02 15:42:23"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 27\\): Created by field is set by LOVD Value is currently "00000" and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 27\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-02 15:42:23"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 28\\): Created date field is set by LOVD Value is currently "[\\s\\S]*" and the value in the import file is "2015-06-03 10:29:37"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 28\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Diseases, line 28\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-02 15:42:23"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning: It is currently not possible to do an update on section Genes_To_Diseases via an import[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Individuals, line 39\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Individuals, line 39\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-03 11:30:26"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning: It is currently not possible to do an update on section Individuals_To_Diseases via an import[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Phenotypes, line 54\\): Created date field is set by LOVD Value is currently "2015-06-03 11:30:56" and the value in the import file is "2015-06-02 15:42:32"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Phenotypes, line 54\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Phenotypes, line 54\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-02 15:42:32"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Screenings, line 60\\): Created date field is set by LOVD Value is currently "2015-06-03 11:31:03" and the value in the import file is "2015-06-02 15:42:37"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Screenings, line 60\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Screenings, line 60\\): Edited date field is set by LOVD Value is currently empty and the value in the import file is "2015-06-02 15:42:37"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning: It is currently not possible to do an update on section Screenings_To_Genes via an import[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Variants_On_Genome, line 72\\): Created date field is set by LOVD Value is currently "2015-06-03 11:31:16" and the value in the import file is "2015-06-02 15:42:48"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning \\(Variants_On_Genome, line 72\\): Edited by field is set by LOVD Value is currently empty and the value in the import file is "00001"\\.[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Warning: It is currently not possible to do an update on section Screenings_To_Variants via an import[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::tagName("body"))->getText())); }