示例#1
4
 public function testTestReadOnlyState()
 {
     // Test that LOVD is in the read-only state.
     // First, log out of any session that might exist at this time.
     $this->logout();
     // There should be no link to register yourself.
     // First, I had this findElements(), but Chrome doesn't like that at all, and times out.
     // Firefox anyway took quite some time, because of the timeout that we have set if elements are not found immediately (normally needed if pages load slowly).
     // $this->assertFalse((bool) count($this->driver->findElements(WebDriverBy::xpath('//a/b[text()="Register as submitter"]'))));
     // New attempt to test for absence of register link.
     $this->assertFalse(strpos($this->driver->findElement(WebDriverBy::xpath('//table[@class="logo"]//td[3]'))->getText(), 'Register as submitter'));
     $this->driver->get(ROOT_URL . '/src/login');
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/login$/', $this->driver->getCurrentURL()));
     // Verify warning exists. Finds any TD with this text.
     $this->driver->findElement(WebDriverBy::xpath('//td[text()="This installation is currently configured to be read-only. Only Managers and higher level users can log in."]'));
     // Attempt to log in, should fail in a specific way.
     $this->enterValue(WebDriverBy::name('username'), 'submitter');
     $this->enterValue(WebDriverBy::name('password'), 'test1234');
     $element = $this->driver->findElement(WebDriverBy::xpath('//input[@value="Log in"]'));
     $element->click();
     // Should return a proper error message.
     $this->assertEquals('This installation is currently configured to be read-only. Your user level is not sufficient to log in.', $this->driver->findElement(WebDriverBy::cssSelector('div[class=err]'))->getText());
     // Also curators should fail.
     $this->enterValue(WebDriverBy::name('username'), 'curator');
     $this->enterValue(WebDriverBy::name('password'), 'test1234');
     $element = $this->driver->findElement(WebDriverBy::xpath('//input[@value="Log in"]'));
     $element->click();
     // Should return a proper error message.
     $this->assertEquals('This installation is currently configured to be read-only. Your user level is not sufficient to log in.', $this->driver->findElement(WebDriverBy::cssSelector('div[class=err]'))->getText());
 }
 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 testAddScreeningToHealthyIndividual()
 {
     // wait for page redirect
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b")));
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/individual\\/00000001$/', $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\\/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();
     $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());
 }
 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 testCreateAnnouncementReadOnly()
 {
     // Create an announcement, that switches LOVD into the read-only state.
     // This test assumes you're logged in as manager or admin.
     $sAnnouncement = 'This is a test announcement. LOVD will be closed for registrations, and lower level users can not log in.';
     $this->driver->get(ROOT_URL . '/src/announcements?create');
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/announcements[\\s\\S]create$/', $this->driver->getCurrentURL()));
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="type"]/option[text()="Warning"]'));
     $option->click();
     $this->enterValue(WebDriverBy::name('announcement'), $sAnnouncement);
     $this->enterValue(WebDriverBy::name('start_date'), '');
     // No value, means active from now().
     $this->enterValue(WebDriverBy::name('end_date'), '');
     // No value, means active until '9999-12-31 23:59:59'.
     $this->check(WebDriverBy::name('lovd_read_only'));
     $this->enterValue(WebDriverBy::name('password'), 'test1234');
     $element = $this->driver->findElement(WebDriverBy::xpath('//input[@value="Create announcement"]'));
     $element->click();
     $this->driver->findElement(WebDriverBy::xpath('//td[text()="Successfully created the announcement!"]'));
     // Finds any TD with this text.
     // Also check if announcement is actually visible.
     $this->assertEquals($sAnnouncement, $this->driver->findElement(WebDriverBy::cssSelector('table[class=info]'))->getText());
     // Wait for redirect...
     $this->waitUntil(WebDriverExpectedCondition::titleContains('View announcement'));
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/announcements\\/\\d{5}$/', $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 testAddScreeningToCMTIndividual()
 {
     // Wait for redirect
     $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of"));
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/individual\\/00000001$/', $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\\/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"));
     $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 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());
 }
 function test1()
 {
     $user = new User();
     $user->setEmail("*****@*****.**");
     $user->setUsername("test");
     $user->setPassword("ouhosu");
     $this->em->persist($user);
     $tree = new Tree();
     $tree->setTitleAdmin('Tree');
     $tree->setPublicId('tree');
     $tree->setOwner($user);
     $this->em->persist($tree);
     $treeVersion = new TreeVersion();
     $treeVersion->setTree($tree);
     $treeVersion->setPublicId('version');
     $this->em->persist($treeVersion);
     $startNode = new Node();
     $startNode->setTreeVersion($treeVersion);
     $startNode->setTitle("START HERE");
     $startNode->setPublicId('start');
     $this->em->persist($startNode);
     $endNode = new Node();
     $endNode->setTreeVersion($treeVersion);
     $endNode->setTitle("END HERE");
     $endNode->setPublicId('end');
     $this->em->persist($endNode);
     $nodeOption = new NodeOption();
     $nodeOption->setTitle("LETS GO HERE");
     $nodeOption->setTreeVersion($treeVersion);
     $nodeOption->setNode($startNode);
     $nodeOption->setDestinationNode($endNode);
     $nodeOption->setPublicId('option');
     $this->em->persist($nodeOption);
     $treeVersionPublished = new TreeVersionPublished();
     $treeVersionPublished->setTreeVersion($treeVersion);
     $treeVersionPublished->setPublishedBy($user);
     $this->em->flush();
     $tvsn = new TreeVersionStartingNode();
     $tvsn->setNode($startNode);
     $tvsn->setTreeVersion($treeVersion);
     $this->em->persist($tvsn);
     $published = new TreeVersionPublished();
     $published->setTreeVersion($treeVersion);
     $this->em->persist($published);
     $this->em->flush();
     // ######################################################## LOAD PAGE
     $this->driver->get('http://localhost/app_dev.php/tree/tree/demo/cascade');
     $startLink = $this->driver->findElement(WebDriverBy::id('StartTreeLink'));
     $this->assertEquals('Start Tree!', $startLink->getText());
     // ######################################################## Start Tree
     $startLink->click();
     sleep($this->sleepOnActionWithNetwork);
     $nodeTitle = $this->driver->findElement(WebDriverBy::id('DemoHere'));
     $this->assertEquals(0, strpos($nodeTitle->getText(), 'START HERE'));
     // ######################################################## LOAD PAGE
     $this->driver->findElement(WebDriverBy::id('DemoHere'))->findElement(WebDriverBy::cssSelector('option[value="option"]'))->click();
     sleep($this->sleepOnActionNoNetwork);
     $nodeTitle = $this->driver->findElement(WebDriverBy::id('DemoHere'));
     $this->assertGreaterThan(0, strpos($nodeTitle->getText(), 'END HERE'));
 }
 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());
 }
示例#13
0
 private function getSelectOptionValues($select)
 {
     $select = new WebDriverSelect($this->webDriver->findElement(WebDriverBy::cssSelector($select)));
     $options = [];
     foreach ($select->getOptions() as $option) {
         $options[] = $option->getText();
     }
     return $options;
 }
 public function testFinishIndividualDiagnosedHealthy()
 {
     // wait for page 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("//tr[3]/td[2]/b"));
     $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 testMyTestCase()
 {
     $this->driver->get(ROOT_URL . "/src/submit/screening/0000000002");
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000002$/', $this->driver->getCurrentURL()));
     $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]/b"));
     $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()));
     $this->waitUntil(WebDriverExpectedCondition::titleContains("View individual"));
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000001$/', $this->driver->getCurrentURL()));
 }
 /**
  * Successful authentication test
  */
 public function testSuccessLogin()
 {
     $this->webDriver->get($this->authenticationPageUrl);
     $this->webDriver->findElement(WebDriverBy::id('login'))->sendKeys($this->login);
     $this->webDriver->findElement(WebDriverBy::id('password'))->sendKeys($this->password);
     $this->webDriver->findElement(WebDriverBy::cssSelector('button[type="submit"]'))->click();
     $this->webDriver->wait(5);
     $nameElement = $this->webDriver->findElement(WebDriverBy::xpath('/html/body/nav/div[1]/a/div/span[1]'));
     $this->assertEquals('Andrei Troskov', $nameElement->getText());
 }
示例#17
0
 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 testHumanReadableString()
 {
     $this->assertEquals("'string selector'", Locator::humanReadableString("string selector"));
     $this->assertEquals("css '.something'", Locator::humanReadableString(['css' => '.something']));
     $this->assertEquals("css selector '.something'", Locator::humanReadableString(WebDriverBy::cssSelector('.something')));
     try {
         Locator::humanReadableString(null);
         $this->fail("Expected exception when calling humanReadableString() with invalid selector");
     } catch (\InvalidArgumentException $e) {
     }
 }
示例#19
0
 public function testSearch()
 {
     $this->webDriver->get($this->url);
     $input = $this->webDriver->findElement(WebDriverBy::cssSelector('#lst-ib'));
     $input->sendKeys('yiiframework');
     $this->webDriver->getKeyboard()->pressKey(WebDriverKeys::ENTER);
     // waiting for google load ajax complete.
     sleep(2);
     $response = $this->webDriver->findElement(WebDriverBy::cssSelector('#ires div.srg div.g div.rc h3.r a'))->getText();
     sleep(3);
     $this->assertContains('Yii PHP Framework', $response);
 }
 public function testMyTestCase()
 {
     $this->driver->get(ROOT_URL . "/src/phenotypes?create&target=00000001");
     $this->enterValue(WebDriverBy::name("Phenotype/Additional"), "Phenotype Details");
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Phenotype/Inheritance"]/option[text()="Unknown"]'));
     $option->click();
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="Test Owner (#00006)"]'));
     $option->click();
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create phenotype information entry']"));
     $element->click();
     $this->assertEquals("Successfully created the phenotype entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
 }
示例#21
0
 public function testCreateDiseaseIVA()
 {
     $this->driver->get(ROOT_URL . "/src/diseases?create");
     $this->enterValue(WebDriverBy::name("symbol"), "IVA");
     $this->enterValue(WebDriverBy::name("name"), "isovaleric acidemia");
     $this->enterValue(WebDriverBy::name("id_omim"), "243500");
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[text()="IVD (isovaleryl-CoA dehydrogenase)"]'));
     $option->click();
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create disease information entry']"));
     $element->click();
     $this->assertEquals("Successfully created the disease information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
 }
 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()));
 }
示例#23
0
 public function testArtistsScreen()
 {
     $this->loginAndGoTo('artists');
     static::assertNotEmpty($this->els('#artistsWrapper .artists article.item'));
     $firstArtist = $this->el('#artistsWrapper .artists article.item:nth-child(1)');
     static::assertNotEmpty($firstArtist->findElement(WebDriverBy::cssSelector('.info .name'))->getText());
     static::assertContains('5 albums • 50 songs', $firstArtist->findElement(WebDriverBy::cssSelector('.meta'))->getText());
     // test the view modes
     $this->click('#artistsWrapper > h1.heading > span.view-modes > a.list');
     static::assertCount(1, $this->els('#artistsWrapper > div.artists.as-list'));
     $this->click('#artistsWrapper > h1.heading > span.view-modes > a.thumbnails');
     static::assertCount(1, $this->els('#artistsWrapper > div.artists.as-thumbnails'));
 }
示例#24
0
 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);
     }
 }
示例#25
0
 public function testSearch()
 {
     $this->webDriver->get($this->url);
     $form = $this->webDriver->findElement(WebDriverBy::cssSelector('form.js-site-search-form'));
     $input = $form->findElement(WebDriverBy::cssSelector('input[type=text].js-site-search-focus'));
     $input->sendKeys('yii 1.1');
     $form->submit();
     $link = $this->webDriver->findElement(WebDriverBy::cssSelector('ul.repo-list li.repo-list-item h3.repo-list-name a'));
     $link->click();
     $repositoryMeta = $this->webDriver->findElement(WebDriverBy::cssSelector('span.repository-meta-content'))->getText();
     sleep(3);
     $this->assertContains('Yii PHP Framework 1.1', $repositoryMeta);
 }
示例#26
0
 public function testGetArguments()
 {
     $by = WebDriverBy::cssSelector('.something');
     $step = $this->getStep([null, [$by]]);
     $this->assertEquals('"' . Locator::humanReadableString($by) . '"', $step->getArguments(true));
     $step = $this->getStep([null, [['just', 'array']]]);
     $this->assertEquals('"just","array"', $step->getArguments(true));
     $step = $this->getStep([null, [function () {
     }]]);
     $this->assertEquals('"lambda function"', $step->getArguments(true));
     $step = $this->getStep([null, [[$this, 'testGetArguments']]]);
     $this->assertEquals('"callable function"', $step->getArguments(true));
 }
示例#27
0
 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());
 }
示例#28
0
 public function testUninstallLOVDTest()
 {
     $this->logout();
     $this->login('admin', 'test1234');
     $this->driver->get(ROOT_URL . "/src/uninstall");
     $this->enterValue(WebDriverBy::name("password"), "test1234");
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Next >>']"));
     $element->click();
     $this->enterValue(WebDriverBy::name("password"), "test1234");
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Uninstall LOVD']"));
     $element->click();
     $this->assertEquals("LOVD successfully uninstalled!\nThank you for having used LOVD!", $this->driver->findElement(WebDriverBy::cssSelector("div[id=lovd__progress_message]"))->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 testConfirmVariantToCMTIndividual()
 {
     // 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[2]/td[2]"));
     $element->click();
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*Are you sure you are done with submitting the variants found with this screening[\\s\\S][\\s\\S]*$/', $this->getConfirmation()));
     $this->chooseOkOnNextConfirmation();
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/individual\\/00000001$/', $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\\/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()="Single Base Extension"]'));
     $option->click();
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="Single-Strand DNA Conformation polymorphism Analysis (SSCP)"]'));
     $option->click();
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="SSCA, fluorescent (SSCP)"]'));
     $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());
     // Wait for 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("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b"));
     $element->click();
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/0000000002[\\s\\S]confirmVariants$/', $this->driver->getCurrentURL()));
     $element = $this->driver->findElement(WebDriverBy::id("check_0000000001"));
     $element->click();
     $this->enterValue(WebDriverBy::xpath("//td/input[@type='password']"), "test1234");
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Save variant list']"));
     $element->click();
     $confirmElementSelector = WebDriverBy::xpath('//td[text()="Successfully confirmed the variant entry!"]');
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated($confirmElementSelector));
 }