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 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 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 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 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());
 }
示例#8
0
 /**
  * Получить токен для полного доступа
  * @param $url string
  * @param $recursion bool
  */
 public function getToken($url, $recursion = true)
 {
     $this->driver->get($url);
     $this->driver->findElement(WebDriverBy::name('email'))->sendKeys($this->login);
     $this->driver->findElement(WebDriverBy::name('pass'))->sendKeys($this->password);
     $this->driver->findElement(WebDriverBy::id('install_allow'))->click();
     sleep(3);
     while ($this->driver->findElements(WebDriverBy::xpath('//input[@name=\'captcha_key\']'))) {
         $this->captcha();
         $this->driver->findElement(WebDriverBy::name('pass'))->sendKeys($this->password);
         $this->driver->findElement(WebDriverBy::id('install_allow'))->click();
         sleep(3);
     }
     $this->driver->wait(60, 1000)->until(WebDriverExpectedCondition::titleContains('VK | Request Access'));
     $this->driver->findElement(WebDriverBy::id('install_allow'))->click();
     $this->driver->wait(60, 1000)->until(WebDriverExpectedCondition::titleContains('OAuth Blank'));
     $urlCurrent = $this->driver->getCurrentURL();
     $parseUrl = parse_url($urlCurrent);
     if (!isset($parseUrl['fragment']) && $recursion == true) {
         return $this->getToken($url, false);
     }
     $query = $parseUrl['fragment'];
     parse_str($query, $data);
     return $data;
 }
 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 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 nextAction()
 {
     $this->webdriver->wait()->until(ExpectedCondition::elementExists($this->theme->getShippingMethodContinueButtonXpath(), WebDriver::BY_XPATH));
     $this->webdriver->wait()->until(ExpectedCondition::visibilityOf($this->webdriver->byXpath($this->theme->getShippingMethodContinueButtonXpath())));
     $this->webdriver->byXpath($this->theme->getShippingMethodContinueButtonXpath())->click();
     $this->webdriver->wait()->until(WebDriverExpectedCondition::not(WebDriverExpectedCondition::visibilityOf($this->webdriver->byXpath($this->theme->getShippingMethodContinueCompletedXpath()))));
     return true;
 }
示例#12
0
 public function testAccessSharingSubmitter()
 {
     $aUserRecords = CreateUsersSubmitterTest::userRecords();
     if (count($aUserRecords) < 2) {
         $this->fail('Cannot run test because CreateUsersSubmitterTest::userRecords() returned
                      too few records.');
     }
     // Example record: array('Test Submitter1', '*****@*****.**', 'testsubmitter1',
     //                       'testsubmitter1')
     list($sSubName1, $sSubEmail1, $sSubUsername1, $sSubPass1) = $aUserRecords[0];
     list($sSubName2, $sSubEmail2, $sSubUsername2, $sSubPass2) = $aUserRecords[1];
     $this->logout();
     $this->login($sSubUsername1, $sSubPass1);
     // Create individual as first submitter.
     $this->driver->get(ROOT_URL . "/src/individuals?create");
     $this->enterValue(WebDriverBy::name("Individual/Lab_ID"), "dummy");
     $createButton = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create individual information entry']"));
     $createButton->click();
     $this->waitUntil(WebDriverExpectedCondition::titleContains('Submission of'));
     $header = $this->driver->findElement(WebDriverBy::xpath('//h2[@class="LOVD"]'));
     $sIndividualID = substr($header->getText(), -8);
     $this->logout();
     $this->login($sSubUsername2, $sSubPass2);
     // Try (unsuccessfully) to access individual.
     $this->driver->get(ROOT_URL . '/src/individuals/' . $sIndividualID);
     $infoBox = $this->driver->findElement(WebDriverBy::xpath('//table[@class="info"]/tbody/tr/td[@valign="middle"]'));
     $this->assertEquals($infoBox->getText(), 'No such ID!');
     $this->logout();
     $this->login($sSubUsername1, $sSubPass1);
     // Open access sharing page
     $yourAccountLink = $this->driver->findElement(WebDriverBy::xpath('//a/b[text()="Your account"]'));
     $yourAccountLink->click();
     $sMenuSelector = '//img[@id="viewentryOptionsButton_Users"]';
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath($sMenuSelector)));
     $optionsMenu = $this->driver->findElement(WebDriverBy::xpath($sMenuSelector));
     $optionsMenu->click();
     $sMenuItemSelector = '//a[text()="Share access to your entries with other users"]';
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath($sMenuItemSelector)));
     $shareAccessItem = $this->driver->findElement(WebDriverBy::xpath($sMenuItemSelector));
     $shareAccessItem->click();
     // Share access with other submitter.
     $sUserSelector = '//a[text()="' . $sSubName2 . '"]';
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath($sUserSelector)));
     $userRow = $this->driver->findElement(WebDriverBy::xpath($sUserSelector));
     $userRow->click();
     $this->enterValue(WebDriverBy::xpath('//td/input[@type="password"]'), $sSubPass1);
     $saveButton = $this->driver->findElement(WebDriverBy::xpath('//input[@value="Save access permissions"]'));
     $saveButton->click();
     $this->logout();
     $this->login($sSubUsername2, $sSubPass2);
     // Try (successfully) to access individual.
     $this->driver->get(ROOT_URL . '/src/individuals/' . $sIndividualID);
     $header = $this->driver->findElement(WebDriverBy::xpath('//h2[@class="LOVD"]'));
     $this->assertEquals($header->getText(), 'View individual #' . $sIndividualID);
     $nonpubFieldHead = $this->driver->findElement(WebDriverBy::xpath('//table[@class="data"]/tbody/tr[4]/th'));
     $this->assertEquals($nonpubFieldHead->getText(), 'Remarks (non public)');
 }
 public function nextAction()
 {
     if ($this->bypassNextStep) {
         return true;
     }
     $this->testCase->byXpath($this->theme->getShippingContinueButtonXpath())->click();
     $this->webdriver->wait()->until(WebDriverExpectedCondition::not(WebDriverExpectedCondition::visibilityOf($this->webdriver->byXpath($this->theme->getShippingContinueCompletedXpath()))));
     return true;
 }
 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()));
 }
示例#15
0
 public function nextAction()
 {
     $this->webdriver->byXpath($this->theme->getPaymentMethodContinueButtonXpath())->click();
     try {
         $this->webdriver->wait()->until(WebDriverExpectedCondition::not(WebDriverExpectedCondition::visibilityOf($this->webdriver->byXpath($this->theme->getPaymentMethodContinueCompleteXpath()))));
     } catch (StaleElementReferenceException $e) {
         // it is possible that the page rendered with unexpected timing which may lead to a harmless StaleElementReferenceException
     }
     return true;
 }
 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()));
 }
示例#17
0
 public function login()
 {
     $this->driver->get('https://web.skype.com');
     $this->driver->wait()->until(function () {
         return WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id('username'));
     });
     $this->driver->findElement(WebDriverBy::id('username'))->sendKeys($this->username);
     $this->driver->findElement(WebDriverBy::id('password'))->sendKeys($this->password);
     $this->driver->findElement(WebDriverBy::cssSelector('form'))->submit();
     $this->waitForSelector('[name=query]');
     sleep(15);
     return true;
 }
示例#18
0
 public function testProfileScreen()
 {
     $this->loginAndWait()->click('a.view-profile');
     $this->see('#profileWrapper')->typeIn('#profileWrapper input[name="name"]', 'Mr Bar')->typeIn('#profileWrapper input[name="email"]', '*****@*****.**')->enter()->see('.sweet-alert')->press(WebDriverKeys::ESCAPE)->notSee('.sweet-alert');
     $avatar = $this->el('a.view-profile img');
     // Expect the Gravatar to be updated
     static::assertEquals('https://www.gravatar.com/avatar/36df72b4484fed183fad058f30b55d21?s=256', $avatar->getAttribute('src'));
     // Check "Confirm Closing" and validate its functionality
     $this->click('#profileWrapper input[name="confirmClosing"]');
     $this->refresh()->waitUntil(WebDriverExpectedCondition::alertIsPresent());
     $this->driver->switchTo()->alert()->dismiss();
     // Reverse all changes for other tests to not be affected
     $this->typeIn('#profileWrapper input[name="name"]', 'Koel Admin')->typeIn('#profileWrapper input[name="email"]', '*****@*****.**')->enter()->see('.sweet-alert')->press(WebDriverKeys::ESCAPE)->notSee('.sweet-alert')->click('#profileWrapper input[name="confirmClosing"]');
 }
 public function testAddVCFFileToIVAIndividual()
 {
     // wait for page redirect
     $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of"));
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000003$/', $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=0000000003$/', $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&target=0000000003$/', $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\\/upload[\\s\\S]create&type=VCF&target=0000000003$/', $this->driver->getCurrentURL()));
     $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();
     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);
     }
     // Test whether a variant was parsed correctly via mutalyzer.
     $this->driver->get(ROOT_URL . '/src/genes/ARSD');
     $element = $this->driver->findElement(WebDriverBy::xpath('//tr[@class="data"]/td[text()="X"]'));
     $element->click();
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath('//td[text()="p.(Gln318His)"]')));
 }
 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));
 }
 public function testAddPhenotypeInfoToCMTIndividual()
 {
     // 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/td[2]/b"));
     $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->assertEquals("Successfully created the phenotype entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
 }
 public function testAddSummaryVariantSeatlleseqFile()
 {
     // Wait for redirect
     $this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant"));
     $this->assertContains("/src/variants/0000000167", $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();
     $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]"));
     $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 testAddSummaryVariantVCFFile()
 {
     // Wait for redirect
     $this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant"));
     $element = $this->driver->findElement(WebDriverBy::id("tab_submit"));
     $element->click();
     $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("//tr[3]/td[2]"));
     $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]"));
     $element->click();
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create&type=VCF$/', $this->driver->getCurrentURL()));
     $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);
     }
 }
示例#24
0
 public function testCreateDiseaseCMT()
 {
     $this->driver->get(ROOT_URL . "/src/diseases?create");
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/diseases[\\s\\S]create$/', $this->driver->getCurrentURL()));
     $this->enterValue(WebDriverBy::name("symbol"), "CMT");
     $this->enterValue(WebDriverBy::name("name"), "Charcot Marie Tooth Disease");
     $this->enterValue(WebDriverBy::name("id_omim"), "302800");
     //        $this->addSelection(WebDriverBy::name("genes[]"), "value=GJB1");
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[@value="GJB1"]'));
     $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());
     // Wait for redirect
     $this->waitUntil(WebDriverExpectedCondition::titleContains("View disease"));
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/diseases\\/00001$/', $this->driver->getCurrentURL()));
 }
 public function testAddPhenotypeInfoToHealthyIndividual()
 {
     // 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\\/individual\\/00000001$/', $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\\/phenotypes[\\s\\S]create&target=00000001$/', $this->driver->getCurrentURL()));
     //        $this->selectWindow("null");
     $this->enterValue(WebDriverBy::name("Phenotype/Age"), "35y");
     $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->assertEquals("Successfully created the phenotype entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
 }
示例#26
0
 public function login()
 {
     $this->open->open('http://www.gmail.com/');
     $this->testCase->assertElementExists('Email');
     $this->testCase->assertElementExists('next');
     $element = $this->webdriver->byId('Email');
     $element->sendKeys($this->accountInformation->getEmailAddress());
     $element = $this->webdriver->byId('next');
     $element->click();
     $this->webdriver->wait()->until(WebDriverExpectedCondition::elementToBeClickable(WebDriverBy::id('Passwd')));
     $this->testCase->assertElementExists('Passwd');
     $this->testCase->assertElementExists('signIn');
     $element = $this->webdriver->byId('Passwd');
     $element->sendKeys($this->accountInformation->getPassword());
     $element = $this->webdriver->byId('signIn');
     $element->click();
     $this->webdriver->wait()->until(WebDriverExpectedCondition::titleContains('Inbox'));
 }
 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 testAddSeattleseqFileToHealthyIndividual()
 {
     // wait for page redirect
     $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of screening"));
     $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]"));
     $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("//tr[3]/td[2]"));
     $element->click();
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create&target=0000000001$/', $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&target=0000000001$/', $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->assertEquals("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();
 }
示例#29
0
 public function testCreateGeneIVD()
 {
     $this->driver->get(ROOT_URL . "/src/genes?create");
     $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::name("hgnc_id")));
     $this->enterValue(WebDriverBy::name("hgnc_id"), "IVD");
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']"));
     $element->click();
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_transcripts[]"]/option[text()="transcript variant 1 (NM_002225.3)"]'));
     $option->click();
     $element = $this->driver->findElement(WebDriverBy::name("show_hgmd"));
     $element->click();
     $element = $this->driver->findElement(WebDriverBy::name("show_genecards"));
     $element->click();
     $element = $this->driver->findElement(WebDriverBy::name("show_genetests"));
     $element->click();
     $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());
 }
 /**
  * Включаем доступ сторонним программам
  * @throws Exception
  * @throws \Facebook\WebDriver\Exception\NoSuchElementException
  * @throws \Facebook\WebDriver\Exception\TimeOutException
  * @throws null
  */
 public function accessThirdPartyPrograms()
 {
     $this->driver->get('https://mail.rambler.ru/');
     if (strpos($this->driver->getTitle(), 'Входящие') === false) {
         $this->driver->findElement(WebDriverBy::name('login'))->sendKeys($this->email);
         $this->driver->findElement(WebDriverBy::id('form_password'))->sendKeys($this->password);
         $this->driver->findElement(WebDriverBy::cssSelector('button.form-button.form-button_submit'))->click();
         $this->driver->wait(60, 1000)->until(WebDriverExpectedCondition::titleContains('Входящие'));
     }
     $this->driver->get('https://mail.rambler.ru/#/settings/clients/');
     sleep(1);
     if (!$this->driver->findElement(WebDriverBy::cssSelector('fieldset.settingsFieldset.settingsFieldsetExternal > label > input.uiCheckbox'))->isSelected()) {
         do {
             $this->driver->findElement(WebDriverBy::cssSelector('fieldset.settingsFieldset.settingsFieldsetExternal > label > input.uiCheckbox'))->click();
             sleep(1);
             $this->captcha();
             $this->driver->navigate()->refresh();
             sleep(1);
         } while (!$this->driver->findElement(WebDriverBy::cssSelector('fieldset.settingsFieldset.settingsFieldsetExternal > label > input.uiCheckbox'))->isSelected());
     }
 }