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


PHP WebDriverBy::Name方法代码示例

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


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

示例1: testUserAccountsEditUserDoespageLoad

 /**
  * Tests that, when loading the User accounts module > edit_user submodule, some
  * text appears in the body.
  *
  * @return void
  */
 function testUserAccountsEditUserDoespageLoad()
 {
     $this->webDriver->get($this->url . "?test_name=user_accounts&subtest=edit_user");
     $bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
     $this->assertContains("Edit User", $bodyText);
     $this->assertEquals("password", $this->webDriver->findElement(WebDriverBy::Name("Password_md5"))->getAttribute("type"));
     $this->assertEquals("checkbox", $this->webDriver->findElement(WebDriverBy::Name("NA_Password"))->getAttribute("type"));
     $this->assertEquals("password", $this->webDriver->findElement(WebDriverBy::Name("__Confirm"))->getAttribute("type"));
 }
开发者ID:frankbiospective,项目名称:Loris,代码行数:15,代码来源:user_accountsTest.php

示例2: testLoginSuccess

 function testLoginSuccess()
 {
     $this->webDriver->get($this->url . '/main.php?logout=true');
     $username = $this->webDriver->findElement(WebDriverBy::Name("username"));
     $this->assertEquals('', $username->getAttribute("value"));
     $password = $this->webDriver->findElement(WebDriverBy::Name("password"));
     $this->assertEquals('', $password->getAttribute("value"));
     $login = $this->webDriver->findElement(WebDriverBy::Name("login"));
     $this->assertEquals('submit', $login->getAttribute("type"));
     $this->assertEquals('Login', $login->getAttribute("value"));
     $username->sendKeys("UnitTester");
     $password->sendKeys("4test4");
     $login->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
     $this->assertContains("Welcome", $bodyText);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:16,代码来源:Login_Test.php

示例3: testNewProfileLoadsWithoutEDC

 /**
  * Tests that with useEDC turned off, edc related fields do not appear
  * on the page.
  *
  * @return none
  */
 function testNewProfileLoadsWithoutEDC()
 {
     $this->setUpConfigSetting("useEDC", "false");
     $this->webDriver->get($this->url . "?test_name=new_profile");
     try {
         $edc1 = $this->webDriver->findElement(WebDriverBy::Name("edc1"));
     } catch (NoSuchElementException $e) {
         $edc1 = null;
     }
     $this->assertNull($edc1);
     try {
         $edc2 = $this->webDriver->findElement(WebDriverBy::Name("edc2"));
     } catch (NoSuchElementException $e) {
         $edc2 = null;
     }
     $this->assertNull($edc2);
     $this->restoreConfigSetting("useEDC");
 }
开发者ID:frankbiospective,项目名称:Loris,代码行数:24,代码来源:new_profileTest.php

示例4: testDataDictSearchKeywordFilters

 function testDataDictSearchKeywordFilters()
 {
     $this->webDriver->get($this->url . "/datadict/");
     $this->webDriver->wait(120, 1000)->until(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::Name("keyword")));
     $searchKey = $this->webDriver->findElements(WebDriverBy::Name("keyword"));
     switch (count($searchKey)) {
         case 1:
             break;
         case 0:
             $this->fail("Could not find search keyword field");
             return;
         default:
             $this->fail("Too many search keyword fields.");
             return;
     }
     $searchKey[0]->sendKeys("NotRealMAGICNUMBER335");
     $searchButton = $this->webDriver->findElement(WebDriverBy::Name("filter"));
     $searchButton->click();
     $this->markTestSkipped("Data Dict test not yet updated for React");
     /*
     		try {
        while (true) {
            $oldBody->isDisplayed();
             }
     		} catch(Exception $e) {
     			$this->webDriver->executescript("document.documentElement.outerHTML");
     
     		}
     */
     $rows = $this->webDriver->findElements(WebDriverBy::cssSelector("table tbody tr"));
     $this->assertTrue(count($rows) == 1, "Incorrect number of rows returned when filtering for keyword on datadict" . print_r($rows, true));
     $cols = $this->webDriver->findElements(WebDriverBy::cssSelector("table tbody tr td"));
     // Rownumber
     $this->assertEquals($cols[0]->getText(), "1");
     // SourceFrom
     $this->assertEquals($cols[1]->getText(), "nowhere");
     // Name
     $this->assertEquals($cols[2]->getText(), "TestParameterNotRealMAGICNUMBER335");
     // SourceField
     $this->assertEquals($cols[3]->getText(), "imaginary");
     // Description
     $this->assertEquals($cols[4]->getText(), "I am a fake description used only for testing you should not see me. MAGICNUMBER335");
 }
开发者ID:spaiva,项目名称:Loris,代码行数:43,代码来源:datadictTest.php

示例5: _assertSearchBy

 /**
  * Performs a candidate search using the specified criteria and verifies
  * the candidates obtained.
  *
  * @param array  $criteria        criteria for the search.
  * @param string $expectedResults the candidates that should be returned.
  *
  * @return void.
  */
 private function _assertSearchBy(array $criteria, $expectedResults)
 {
     foreach ($criteria as $elementName => $elementValue) {
         $element = $this->webDriver->findElement(WebDriverBy::Name($elementName));
         switch ($element->getTagName()) {
             case 'input':
                 $element->clear();
                 $element->sendKeys($elementValue);
                 break;
             case 'select':
                 $selectElement = new WebDriverSelect($element);
                 $selectElement->selectByVisibleText($elementValue);
                 break;
             default:
                 throw Exception('Element type ' . $element->getTagName() . ' not supported');
         }
     }
     $showDataButton = $this->webDriver->findElement(WebDriverBy::Id("showdata_advanced_options"));
     $showDataButton->click();
     $this->_assertCandidateTableContents('datatable', $expectedResults);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:30,代码来源:candidate_listTest.php

示例6: testDocumentRepositoryUploadFileEditDeleteComment

 /**
  * Tests that, upload function in document_repository module
  *
  * @return void
  */
 function testDocumentRepositoryUploadFileEditDeleteComment()
 {
     $this->markTestSkipped("This method isn't working properly on travis.");
     $this->safeGet($this->url . "/document_repository/");
     $this->safeFindElement(WebDriverBy::Xpath("//*[@id='TESTTESTTESTTESTa']/td/span"))->click();
     $this->safeFindElement(WebDriverBy::Id("9999999"))->click();
     // modify comment,search it and check it
     $select = $this->safeFindElement(WebDriverBy::Id("categoryEdit"));
     $element = new WebDriverSelect($select);
     $element->selectByVisibleText("TESTTESTTESTTEST");
     $site = $this->safeFindElement(WebDriverBy::Id("siteEdit"));
     $elementSite = new WebDriverSelect($site);
     $elementSite->selectByVisibleText("Any");
     $this->safeFindElement(WebDriverBy::Id("commentsEdit"))->sendKeys("This is a test comment!");
     $this->safeFindElement(WebDriverBy::Id("postEdit"))->click();
     sleep(5);
     $this->safeFindElement(WebDriverBy::Name("File_name"))->sendKeys("README.md");
     $this->safeFindElement(WebDriverBy::Name("filter"))->click();
     $text = $this->safeFindElement(WebDriverBy::cssSelector("#dir-tree > tr"), 3000)->getText();
     $this->assertContains("This is a test comment!", $text);
     // delete upload file
     $this->safeFindElement(WebDriverBy::linkText("Delete"), 3000)->click();
     $this->safeFindElement(WebDriverBy::Id("postDelete"))->click();
     $this->safeFindElement(WebDriverBy::Name("File_name"))->sendKeys("README.md");
     $this->safeFindElement(WebDriverBy::Name("filter"))->click();
     sleep(5);
     $text = $this->safeFindElement(WebDriverBy::cssSelector("tbody"), 3000)->getText();
     $this->assertEquals('', $text);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:34,代码来源:document_repositoryTest.php

示例7: testGenomicBrowserSNPShowBriefFields

 /**
  * Tests that, SNP 'Show brief fields' filter works.
  *
  * Note: the brief fields option should have been tested in
  * testGenomicBrowserSNPDataSortableBrief
  *
  * @-depends testGenomicBrowserSNPDatatable
  *
  * @return void
  */
 function testGenomicBrowserSNPShowBriefFields()
 {
     $this->markTestIncomplete('Test should be updated for new main genomic browser tab.');
     $expected_headers = array('No.', 'PSC', 'DCCID', 'PSCID', 'Gender', 'Subproject', 'DoB', 'ExternalID', 'Chromosome', 'Strand', 'StartLoc', 'EndLoc', 'Size', 'Gene Symbol', 'Gene Name', 'Platform', 'RsID', 'SNP Name', 'SNP Description', 'External Source', 'Observed Base', 'Reference Base', 'Array Report', 'Markers', 'Validation Method', 'Validated', 'Function Prediction', 'Damaging', 'Genotype Quality', 'Exonic Function');
     $this->safeGet($this->url . "/genomic_browser/?submendu=snp_browser");
     // Apply filter
     $this->webDriver->findElement(WebDriverBy::Name('Show_Brief_Results'))->sendKeys("All fields");
     $button = $this->webDriver->findElement(WebDriverBy::xPath("\n                //input[@name='filter']\n            "));
     $this->clickToLoadNewPage($button);
     // Check column count
     $this->safeGet($this->url . "/genomic_browser/?submenu=snp_browser");
     $headers = $this->webDriver->findElements(WebDriverBy::xPath("\n                //div[@id='lorisworkspace']\n                //table[contains(@class, 'dynamictable')]\n                /thead\n                /tr\n                /th\n            "));
     $this->assertCount(count($expected_headers), $headers, "There should be " . count($expected_headers) . " columns in the table.");
 }
开发者ID:spaiva,项目名称:Loris,代码行数:24,代码来源:genomic_browserTest.php

示例8: testNewProfilePSCIDSequential

 function testNewProfilePSCIDSequential()
 {
     $this->changeStudySite();
     $this->webDriver->get($this->url . "/new_profile/");
     $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date"));
     $dates[0]->sendKeys("01/01/2015");
     $dates[1]->sendKeys("01/01/2015");
     $gender = $this->webDriver->findElement(WebDriverBy::Name("gender"));
     $gender->sendKeys("Male");
     $startVisit = $this->webDriver->findElement(WebDriverBy::Name("fire_away"));
     $startVisit->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
     $this->assertContains("PSCID: BBQ0000", $bodyText);
     $this->webDriver->get($this->url . "/new_profile/");
     $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date"));
     $dates[0]->sendKeys("01/01/2015");
     $dates[1]->sendKeys("01/01/2015");
     $gender = $this->webDriver->findElement(WebDriverBy::Name("gender"));
     $gender->sendKeys("Male");
     $startVisit = $this->webDriver->findElement(WebDriverBy::Name("fire_away"));
     $startVisit->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
     $this->assertContains("PSCID: BBQ0001", $bodyText);
     $this->deleteCandidate("BBQ0000");
     $this->deleteCandidate("BBQ0001");
     $this->resetStudySite();
 }
开发者ID:spaiva,项目名称:Loris,代码行数:27,代码来源:new_profileTest.php

示例9: _assertSearchBy

 /**
  * Performs a candidate search using the specified criteria and verifies
  * the candidates obtained.
  *
  * @param array  $criteria        criteria for the search.
  * @param string $expectedResults the candidates that should be returned.
  *
  * @return void.
  */
 private function _assertSearchBy(array $criteria, $expectedResults)
 {
     foreach ($criteria as $elementName => $elementValue) {
         $element = $this->safeFindElement(WebDriverBy::Name($elementName));
         $element->clear();
         $element->sendKeys($elementValue);
     }
     $this->safeClick(WebDriverBy::Name("filter"));
     $this->_assertUserTableContents('dynamictable', $expectedResults);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:19,代码来源:user_accountsTest.php

示例10: testSurveyAccountsSearchButton

 /**
  * Tests that, input some data and click search button, check the results.
  *
  * @return void
  */
 function testSurveyAccountsSearchButton()
 {
     //testing search by PSCID
     $this->safeGet($this->url . "/survey_accounts/");
     $this->webDriver->findElement(WebDriverBy::Name("PSCID"))->sendKeys("8888");
     $this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
     sleep(5);
     $this->webDriver->findElement(WebDriverBy::Name("PSCID"))->clear();
     $bodyText = $this->webDriver->getPageSource();
     $this->assertContains("8888", $bodyText);
     //testing search by Email
     $this->safeGet($this->url . "/survey_accounts/");
     $this->webDriver->findElement(WebDriverBy::Name("Email"))->sendKeys("TestTestTest@example.com");
     $this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
     sleep(5);
     $this->webDriver->findElement(WebDriverBy::Name("Email"))->clear();
     $bodyText = $this->webDriver->getPageSource();
     $this->assertContains("TestTestTest@example.com", $bodyText);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:24,代码来源:survey_accountsTest.php

示例11: testImageCommentsWindowEditable

 /**
  * Link to visit level comments editable with proper permissions
  *
  * @return void
  */
 function testImageCommentsWindowEditable()
 {
     $this->markTestSkipped('React components can not be tested');
     // Setting permissions to view all sites to view all datasets
     $this->setupPermissions(array('imaging_browser_view_allsites', 'imaging_browser_qc'));
     $this->safeGet($this->url . "/imaging_browser/");
     $NativeLink = $this->webDriver->findElement(WebDriverBy::xPath('//*[@id="lorisworkspace"]/div[2]/div/div/table/tbody/tr/td[12]/a'));
     $this->clickToLoadNewPage($NativeLink);
     $ImageQCFeedback = $this->webDriver->findElement(WebDriverBy::cssSelector(".mri-second-row-panel > a:nth-child(1) > " . "span:nth-child(1) > span:nth-child(2)"));
     $handleList = $this->webDriver->getWindowHandles();
     $ImageQCFeedback->click();
     $newHandleList = $this->webDriver->getWindowHandles();
     $diff = array_diff($newHandleList, $handleList);
     $this->assertCount(1, $diff);
     $this->webDriver->switchTo()->window($diff[1]);
     // First clear the field then send the comments/text
     $this->webDriver->findElement(WebDriverBy::Name("savecomments[text][1]"))->clear();
     $this->webDriver->findElement(WebDriverBy::Name("savecomments[text][1]"))->sendKeys("Testing comment field within Geometric Intensity");
     $SaveButton = $this->webDriver->findElement(WebDriverBy::Name("fire_away"));
     $SaveButton->click();
     $GeometricDistortionText = $this->webDriver->findElement(WebDriverBy::Name("savecomments[text][1]"))->getText();
     $this->assertEquals("Testing comment field within Geometric Intensity", $GeometricDistortionText);
     $this->webDriver->switchTo()->window($diff[1])->close();
 }
开发者ID:spaiva,项目名称:Loris,代码行数:29,代码来源:imaging_browserTest.php

示例12: testNotResolvedSaveButton

 /**
  * Tests that,in the not resolved menu, change the Resolution status of the first row.
  * Save it and check it. 
  *
  * @return void
  */
 function testNotResolvedSaveButton()
 {
     $this->safeGet($this->url . "/mri_violations/");
     $resolutionElement = $this->safeFindElement(WebDriverBy::Name("resolvable[c57b919a921eaa1a43bb5e0c44cd4226]"));
     $resolution = new WebDriverSelect($resolutionElement);
     $resolution->selectByVisibleText("Inserted");
     $this->safeClick(WebDriverBy::Name("fire_away"));
     $resolutionElement = $this->safeFindElement(WebDriverBy::Name("resolvable[c57b919a921eaa1a43bb5e0c44cd4226]"));
     $resolution = new WebDriverSelect($resolutionElement);
     $value = $resolution->getFirstSelectedOption()->getAttribute('value');
     $this->assertEquals("inserted", $value);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:18,代码来源:mri_violationsTest.php

示例13: testNextStageSuccess

 /**
  * Tests that page returns success when inputed correctly
  *
  * @return void
  */
 function testNextStageSuccess()
 {
     $this->webDriver->get($this->url . "/next_stage/?candID=900000&sessionID=999999&identifier=999999");
     $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date"));
     $dates[0]->sendKeys("2015-01-01");
     $dates[1]->sendKeys("2015-01-01");
     $scanDone = $this->webDriver->findElement(WebDriverBy::Name("scan_done"));
     $scanDone->sendKeys("No");
     $Subproject = $this->webDriver->findElement(WebDriverBy::Name("SubprojectID"));
     $Subproject->sendKeys("Control");
     $startVisit = $this->webDriver->findElement(WebDriverBy::Name("fire_away"));
     $startVisit->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::cssSelector("body"))->getText();
     $this->assertContains("Next stage started.", $bodyText);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:20,代码来源:next_stageTest.php

示例14: testClearFormResolvedConflicts

 /**
  * Tests Clear Form function in resolved conflicts
  * author: Wang Shen
  *
  * @return void
  */
 function testClearFormResolvedConflicts()
 {
     $this->safeGet($this->url . "/conflict_resolver/?submenu=resolved_conflicts");
     $keywordElement = $this->webDriver->findElement(WebDriverBy::Name("Question"));
     $keywordElement->sendkeys('TestTestTest');
     //click clear form button
     $this->webDriver->findElement(WebDriverBy::ID("testClearForm1"))->click();
     $bodyText = $this->webDriver->findElement(WebDriverBy::Name("Question"))->getText();
     $this->assertNotContains("TestTestTest", $bodyText);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:16,代码来源:conflict_resolverTest.php

示例15: testdicomArchiveFileterByDateOfBirth

 /**
  * Tests that filter with the date of birth
  *
  * @return void
  */
 function testdicomArchiveFileterByDateOfBirth()
 {
     $this->markTestSkipped("This method isn't working properly on travis.");
     //testing the Patient's date of birth
     $this->safeGet($this->url . "/dicom_archive/");
     $DoBElement = $this->safeFindElement(WebDriverBy::Name("DoB"));
     $DoBElement->sendKeys("1900-01-01");
     $this->safeClick(WebDriverBy::Name("filter"));
     $DoB = $this->safeFindElement(WebDriverBy::cssSelector("tbody"))->getText();
     $this->assertContains('1900-01-01', $DoB);
 }
开发者ID:spaiva,项目名称:Loris,代码行数:16,代码来源:dicom_archiveTest.php


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