当前位置: 首页>>代码示例>>PHP>>正文


PHP WebDriverBy::name方法代码示例

本文整理汇总了PHP中Facebook\WebDriver\WebDriverBy::name方法的典型用法代码示例。如果您正苦于以下问题:PHP WebDriverBy::name方法的具体用法?PHP WebDriverBy::name怎么用?PHP WebDriverBy::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facebook\WebDriver\WebDriverBy的用法示例。


在下文中一共展示了WebDriverBy::name方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAddSummaryVariantOnlyDescribedOnGenomicLevel

 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()));
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:33,代码来源:add_summary_variant_only_described_on_genomic_level.php

示例2: testAddScreeningToHealthyIndividual

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:27,代码来源:add_screening_to_healthy_individual.php

示例3: testTestReadOnlyState

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:30,代码来源:test_read_only_state.php

示例4: testPostFinishAddPhenotypeInfoToIVAIndividual

 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()));
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:28,代码来源:post_finish_add_phenotype_info_to_IVA_individual.php

示例5: testAddVariantLocatedWithinGeneToCMTIndividual

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:60,代码来源:add_variant_located_within_gene_to_CMT_individual.php

示例6: testCreateAnnouncementReadOnly

 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()));
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:26,代码来源:create_announcement_readonly.php

示例7: testCheckCustomLinks

 public function testCheckCustomLinks()
 {
     // This test checks some basic functionality of the custom links. It
     // doesn't require authorization, just checks some VLs if the links are
     // rendered correctly.
     // Load the common variant overview.
     $this->driver->get(ROOT_URL . '/src/variants');
     // Find a custom link, and move the mouse over it.
     $oCustomLink = $this->driver->findElement(WebDriverBy::xpath('//table[@class="data"]/tbody/tr/td/span[text()="dbSNP"]'));
     $this->driver->getMouse()->mouseMove($oCustomLink->getCoordinates());
     // Now find the tooltip that should have shown.
     $sToolTipLinkText = $this->driver->findElement(WebDriverBy::xpath('//div[@id="tooltip"]/a'))->getText();
     $this->assertTrue(strpos($sToolTipLinkText, 'http') === 0 && strpos($sToolTipLinkText, 'SNP'));
     // This test data does not have many links, try and find a PubMed link.
     // Load the in_gene view.
     $this->driver->get(ROOT_URL . '/src/variants/in_gene');
     // Filter on Reference, so we can find this link on the first page.
     $sSelector = WebDriverBy::name('search_VariantOnGenome/Reference');
     $this->enterValue($sSelector, 'Fokkema');
     $oElement = $this->driver->findElement($sSelector);
     // Use json_decode to send enter key to browser.
     $oElement->sendKeys(json_decode('"\\uE007"'));
     // FIXME: It would be good if we can test for the VL to renew. Now just waiting a second.
     sleep(1);
     // Find a custom link, and move the mouse over it.
     $oCustomLink = $this->driver->findElement(WebDriverBy::xpath('//table[@class="data"]/tbody/tr/td/span[text()="Fokkema et al (2011)"]'));
     $this->driver->getMouse()->mouseMove($oCustomLink->getCoordinates());
     // Now find the tooltip that should have shown.
     $sToolTipLinkText = $this->driver->findElement(WebDriverBy::xpath('//div[@id="tooltip"]/a'))->getText();
     $this->assertTrue(strpos($sToolTipLinkText, 'http') === 0 && strpos($sToolTipLinkText, 'pubmed'));
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:31,代码来源:check_custom_links.php

示例8: testCreateIndividualDiagnosedWithCMT

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:26,代码来源:create_individual_diagnosed_with_CMT.php

示例9: testAddScreeningToCMTIndividual

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:26,代码来源:add_screening_to_CMT_individual.php

示例10: getToken

 /**
  * Получить токен для полного доступа
  * @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;
 }
开发者ID:jumper423,项目名称:yii2-webdriver,代码行数:30,代码来源:VkWebDriver.php

示例11: testAddVariantOnlyDescribedOnGenomicLevelToIVAIndividual

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:34,代码来源:add_variant_only_described_on_genomic_level_to_IVA_individual.php

示例12: testPostFinishAddPhenotypeInfoToCMTIndividual

 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()));
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:29,代码来源:post_finish_add_phenotype_info_to_CMT_individual.php

示例13: testAddVariantLocatedWithinGeneToHealthyIndividual

 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());
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:59,代码来源:add_variant_located_within_gene_to_healthy_individual.php

示例14: testAccessSharingSubmitter

 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', 'example1@example.com', '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)');
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:57,代码来源:access_sharing_submitter.php

示例15: testUpdatetImport

 public function testUpdatetImport()
 {
     $this->driver->get(ROOT_URL . "/src/import");
     $this->enterValue(WebDriverBy::name("import"), ROOT_PATH . "../tests/test_data_files/UpdateImport.txt");
     $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="mode"]/option[text()="Update existing data (in beta)"]'));
     $option->click();
     $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
     $element->click();
     $this->assertTrue((bool) preg_match('/^[\\s\\S]*The following sections are modified and updated in the database: Columns, Diseases, Individuals, Phenotypes, Screenings, Variants_On_Genome, Variants_On_Transcripts\\.$/', $this->driver->findElement(WebDriverBy::id("lovd_sql_progress_message_done"))->getText()));
 }
开发者ID:LOVDnl,项目名称:LOVD3,代码行数:10,代码来源:update_import.php


注:本文中的Facebook\WebDriver\WebDriverBy::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。