本文整理匯總了PHP中WebDriverBy::Xpath方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebDriverBy::Xpath方法的具體用法?PHP WebDriverBy::Xpath怎麽用?PHP WebDriverBy::Xpath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebDriverBy
的用法示例。
在下文中一共展示了WebDriverBy::Xpath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testNotResolvedSearchButton
/**
* Tests that, input some data and click search button, check the results.
*
* @return void
*/
function testNotResolvedSearchButton()
{
//testing search by PatientName
$this->safeGet($this->url . "/mri_violations/");
$this->webDriver->findElement(WebDriverBy::Name("PatientName"))->sendKeys("[Test]PatientName");
$this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
$bodyText = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='violationsTable']/tbody/tr[1]/td[2]"))->getText();
$this->assertEquals("[Test]PatientName", $bodyText);
//testing search by Filename
$this->webDriver->findElement(WebDriverBy::Name("Filename"))->sendKeys("assembly/test2/test2/mri/test2/test2.mnc");
$this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
$bodyText = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='violationsTable']/tbody/tr[1]/td[2]"))->getText();
$this->assertEquals("[Test]PatientName", $bodyText);
//testing search by Description
$this->webDriver->findElement(WebDriverBy::Name("Description"))->sendKeys("Test Series Description");
$this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
$bodyText = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='violationsTable']/tbody/tr[1]/td[2]"))->getText();
$this->assertEquals("[Test]PatientName", $bodyText);
//testing search by site
$siteElement = $this->safeFindElement(WebDriverBy::Name("Site"));
$site = new WebDriverSelect($siteElement);
$site->selectByVisibleText("TESTinPSC");
$this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
$bodyText = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='violationsTable']/tbody/tr[1]/td[2]"))->getText();
$this->assertEquals("[Test]PatientName", $bodyText);
//testing search by Description
$this->webDriver->findElement(WebDriverBy::Name("SeriesUID"))->sendKeys("5556");
$this->webDriver->findElement(WebDriverBy::Name("filter"))->click();
$bodyText = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='violationsTable']/tbody/tr[1]/td[2]"))->getText();
$this->assertEquals("[Test]PatientName", $bodyText);
}
示例2: 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);
}
示例3: testDashboardRecruitmentView
/**
* To test that, when loading the Dashboard, click the Views button of
* Recruitment, the items "View overall recruitment" and "View site breakdown"
* appear
* author : Wang Shen
*
* @return void
*/
public function testDashboardRecruitmentView()
{
$this->safeGet($this->url . '/dashboard/');
$views = $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='lorisworkspace']/div/di" . "v[1]/div[2]/div[1]/div/div/button"));
$views->click();
$assertText1 = $this->webDriver->findElement(WebDriverBy::XPath("//*[@id='lorisworkspace']/div/div[1]" . "/div[2]/div[1]/div/div/ul/li[1]/a"))->getText();
$assertText2 = $this->webDriver->findElement(WebDriverBy::XPath("//*[@id='lorisworkspace']/div/div[1]" . "/div[2]/div[1]/div/div/ul/li[2]/a"))->getText();
$this->assertContains("View overall recruitment", $assertText1);
$this->assertContains("View site breakdown", $assertText2);
}