本文整理汇总了PHP中WebDriverBy::partialLinkText方法的典型用法代码示例。如果您正苦于以下问题:PHP WebDriverBy::partialLinkText方法的具体用法?PHP WebDriverBy::partialLinkText怎么用?PHP WebDriverBy::partialLinkText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebDriverBy
的用法示例。
在下文中一共展示了WebDriverBy::partialLinkText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetByPartialLinkText
public function testGetByPartialLinkText()
{
$this->driver->get($this->getTestPath('index.html'));
self::assertEquals('Click here', $this->driver->findElement(WebDriverBy::partialLinkText('Click'))->getText());
}
示例2: testWebDriverWaits
public function testWebDriverWaits()
{
$fakeWd = Stub::make('\\Codeception\\Module\\WebDriver', ['wait' => Stub::exactly(12, function () {
return new \Codeception\Util\Maybe();
})]);
$this->module->webDriver = $fakeWd;
$this->module->waitForElement(WebDriverBy::partialLinkText('yeah'));
$this->module->waitForElement(['id' => 'user']);
$this->module->waitForElement(['css' => '.user']);
$this->module->waitForElement('//xpath');
$this->module->waitForElementVisible(WebDriverBy::partialLinkText('yeah'));
$this->module->waitForElementVisible(['id' => 'user']);
$this->module->waitForElementVisible(['css' => '.user']);
$this->module->waitForElementVisible('//xpath');
$this->module->waitForElementNotVisible(WebDriverBy::partialLinkText('yeah'));
$this->module->waitForElementNotVisible(['id' => 'user']);
$this->module->waitForElementNotVisible(['css' => '.user']);
$this->module->waitForElementNotVisible('//xpath');
}
示例3: tearDownAfterClass
/**
* Closes web browser.
*/
public static function tearDownAfterClass()
{
self::$helper->login(self::$login_user, self::$login_pass);
self::$helper->toRSS();
self::$helper->deleteAllRooms();
self::$webDriver->findElement(WebDriverBy::linkText('Privilegien'))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText(self::$classname))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText('Klasse löschen'))->click();
self::$webDriver->findElement(WebDriverBy::name('cmd[deleteClass]'))->click();
self::$helper->deleteOneAttributeForBooking();
self::$helper->deleteUser();
self::$helper->toRSS();
self::$helper->deleteUser();
self::$helper->logout();
self::$webDriver->quit();
}
示例4: dontSeeLink
public function dontSeeLink($text, $url = null)
{
$nodes = $this->webDriver->findElements(\WebDriverBy::partialLinkText($text));
if (!$url) {
$this->assertNodesNotContain($text, $nodes, 'a');
return;
}
$nodes = array_filter($nodes, function (\WebDriverElement $e) use($url) {
return trim($e->getAttribute('href')) == trim($url);
});
$this->assertNodesNotContain($text, $nodes, "a[href={$url}]");
}
示例5: waitForPartialLinkText
/**
* Wait for anchor element whose visible text partially matches the search value.
*
* @param string $partialLinkText
* @param bool $mustBeVisible Pass true to check if element is also visible. False only checks presence in DOM.
* @return \RemoteWebElement
*/
public function waitForPartialLinkText($partialLinkText, $mustBeVisible = false)
{
return $this->waitForElement(\WebDriverBy::partialLinkText($partialLinkText), $mustBeVisible);
}
示例6: getPrivilegeClassIDByNamePartial
public function getPrivilegeClassIDByNamePartial($name)
{
$link_taget = $this->webDriver->findElement(WebDriverBy::partialLinkText($name . ' ⇒ User'))->getAttribute('href');
$link_taget_A_vars = explode("&", $link_taget);
foreach ($link_taget_A_vars as $var) {
if (substr($var, 0, 9) === "class_id=") {
$keyAndValue = explode("=", $var);
return $keyAndValue[1];
}
}
}
示例7: tearDownAfterClass
/**
* Closes web browser.
*/
public static function tearDownAfterClass()
{
self::$helper->login(self::$login_root, self::$pass_root);
self::$helper->toRSS();
self::$helper->deleteAllRooms();
self::$webDriver->findElement(WebDriverBy::linkText('Privilegien'))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText(self::$classname_1))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText('Klasse löschen'))->click();
self::$webDriver->findElement(WebDriverBy::name('cmd[deleteClass]'))->click();
self::$webDriver->findElement(WebDriverBy::linkText('Privilegien'))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText(self::$classname_2))->click();
self::$webDriver->findElement(WebDriverBy::partialLinkText('Klasse löschen'))->click();
self::$webDriver->findElement(WebDriverBy::name('cmd[deleteClass]'))->click();
self::$helper->deleteUser();
self::$helper->toRSS();
self::$helper->deleteUser();
self::$helper->logout();
self::$webDriver->quit();
}