本文整理汇总了PHP中WebDriverBy::XPath方法的典型用法代码示例。如果您正苦于以下问题:PHP WebDriverBy::XPath方法的具体用法?PHP WebDriverBy::XPath怎么用?PHP WebDriverBy::XPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebDriverBy
的用法示例。
在下文中一共展示了WebDriverBy::XPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testHelpEditorPermission
/**
* Tests that help editor loads with the permission
*
* @return void
*/
function testHelpEditorPermission()
{
$this->setupPermissions(array("context_help"));
$this->safeGet($this->url . "/help_editor/");
$bodyText = $this->safeFindElement(WebDriverBy::XPath("//*[@id='lorisworkspace']/table/tbody/tr/td[1]"))->getText();
$this->assertContains("List of Topics", $bodyText);
$this->resetPermissions();
}
示例2: testSearchUnresolvedConflicts
/**
* Tests research function in unresolved conflicts
* author: Wang Shen
*
* @return void
*/
function testSearchUnresolvedConflicts()
{
$this->safeGet($this->url . "/conflict_resolver/");
$keywordElement = $this->webDriver->findElement(WebDriverBy::Name("Question"));
$keywordElement->sendkeys('TestTestTest');
//click show data button
$this->webDriver->findElement(WebDriverBy::ID("testShowData1"))->click();
$bodyText = $this->webDriver->findElement(WebDriverBy::XPath("//*[@id='conflict_resolver']/div/div/div/" . "table/tbody/tr[1]/td[6]"))->getText();
$this->assertContains("TestTestTest", $bodyText);
}
示例3: testGeneralDescriptionTabLoads
public function testGeneralDescriptionTabLoads()
{
$this->webDriver->get($this->url . '?test_name=statistics&subtest=stats_general&dynamictabs=dynamictabs');
$header = $this->webDriver->findElement(WebDriverBy::XPath("//div[@id = 'page']/h2"));
$this->assertContains("Welcome to the statistics page", $header->getText());
}
示例4: 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);
}