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