本文整理汇总了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);
}