本文整理匯總了PHP中SeleniumClient\By::partialLinkText方法的典型用法代碼示例。如果您正苦於以下問題:PHP By::partialLinkText方法的具體用法?PHP By::partialLinkText怎麽用?PHP By::partialLinkText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SeleniumClient\By
的用法示例。
在下文中一共展示了By::partialLinkText方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCreateMenuItem
public function testCreateMenuItem()
{
$d = $this->driver;
$cpPage = $this->doAdminLogin();
// $genericPage = new GenericAdminPage($d, $this);
$genericPage = $cpPage->clickMenu('Menu Manager');
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('Main Menu'));
echo "found Main Menu";
$el->click();
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('New'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//input[contains(@onclick, 'iframe')]"));
echo "found select button";
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//div[@id='sbox-content']/iframe"));
// switch to modal iframe
$el = $d->switchTo()->getFrameByWebElement($el)->findElement(By::partialLinkText('Single Article'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//input[@value='Single Article']"));
$salt = mt_rand();
$d->findElement(By::id('jform_title'))->sendKeys('Test Menu Title ' . $salt);
$el = $d->findElement(By::partialLinkText('Select / Change'))->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//div[@id='sbox-content']/iframe"));
$el = $d->switchTo()->getFrameByWebElement($el)->findElement(By::partialLinkText('Australian Parks'));
$text = $d->findElement(By::xPath("//body"))->getText();
$this->assertTrue(strpos($text, '( ! ) Notice:') === false, '**PHP notice found on page.');
$el->click();
$el = $d->waitForElementUntilIsNotPresent(By::xPath("//div[@id='sbox-content']/iframe"));
$d->findElement(By::xPath("//a[contains(@onclick, 'item.save')]"))->click();
// Clean up
}
示例2: createMenuItem
/**
* @test
*/
public function createMenuItem()
{
$cpPage = $this->doAdminLogin();
$page = $cpPage->clickMenu('Main Menu');
$page->clickButton('New');
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('New'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//input[contains(@onclick, 'iframe')]"));
echo "found select button";
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//div[@id='sbox-content']/iframe"));
// switch to modal iframe
$el = $d->switchTo()->getFrameByWebElement($el)->findElement(By::partialLinkText('Single Article'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//input[@value='Single Article']"));
$salt = mt_rand();
$d->findElement(By::id('jform_title'))->sendKeys('Test Menu Title ' . $salt);
$el = $d->findElement(By::partialLinkText('Select / Change'))->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//div[@id='sbox-content']/iframe"));
$el = $d->switchTo()->getFrameByWebElement($el)->findElement(By::partialLinkText('Australian Parks'));
$el->click();
$el = $d->waitForElementUntilIsNotPresent(By::xPath("//div[@id='sbox-content']/iframe"));
$d->findElement(By::xPath("//a[contains(@onclick, 'item.save')]"))->click();
// Clean up
}
示例3: testTinyTyping
public function testTinyTyping()
{
$d = $this->_driver;
//get url
$d->get($this->_testUrl . '/administrator');
//access text input
$webElement = $d->findElement(By::id("mod-login-username"));
$webElement->clear();
$webElement->sendKeys("admin");
$webElement = $d->findElement(By::id("mod-login-password"));
$webElement->clear();
$webElement->sendKeys("password");
//access button
$d->findElement(By::partialLinkText("Log in"))->click();
$d->waitForElementUntilIsPresent(By::partialLinkText('Add New Article'))->click();
$salt = mt_rand();
$d->waitForElementUntilIsPresent(By::id('jform_title'))->sendKeys('Article Title ' . $salt);
$d->switchTo()->getFrameByName('jform_articletext_ifr');
$d->findElement(By::id('tinymce'))->sendKeys('This is some article text.');
$d->switchTo()->getDefaultFrame();
$d->findElement(By::xPath("//a[contains(@onclick, 'article.save')]"))->click();
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('Article Title ' . $salt));
$this->assertInstanceOf('SeleniumClient\\WebElement', $el);
$el->click();
$d->waitForElementUntilIsPresent(By::id('jform_title'));
$select = new SelectElement($d->findElement(By::id("jform_state")));
$select->selectByValue("2");
$select = new SelectElement($d->findElement(By::id("jform_featured")));
$select->selectByValue("1");
sleep(5);
// Clean up
}
示例4: testCreateMenuItem
public function testCreateMenuItem()
{
//get url
$this->_driver->get($this->_testUrl . '/administrator');
//access text input
$webElement = $this->_driver->findElement(By::id("mod-login-username"));
$webElement->clear();
$webElement->sendKeys("admin");
$webElement = $this->_driver->findElement(By::id("mod-login-password"));
$webElement->clear();
$webElement->sendKeys("password");
//access button
$this->_driver->findElement(By::partialLinkText("Log in"))->click();
$d = $this->_driver;
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('Menu Manager'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('Main Menu'));
echo "found Main Menu";
$el->click();
$el = $d->waitForElementUntilIsPresent(By::partialLinkText('New'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//input[contains(@onclick, 'iframe')]"));
echo "found select button";
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//div[@id='sbox-content']/iframe"));
// switch to modal iframe
$el = $d->switchTo()->getFrameByWebElement($el)->findElement(By::partialLinkText('Single Article'));
$el->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//input[@value='Single Article']"));
$salt = mt_rand();
$d->findElement(By::id('jform_title'))->sendKeys('Test Menu Title ' . $salt);
$el = $d->findElement(By::partialLinkText('Select / Change'))->click();
$el = $d->waitForElementUntilIsPresent(By::xPath("//div[@id='sbox-content']/iframe"));
$el = $d->switchTo()->getFrameByWebElement($el)->findElement(By::partialLinkText('Australian Parks'));
$el->click();
$el = $d->waitForElementUntilIsNotPresent(By::xPath("//div[@id='sbox-content']/iframe"));
$d->findElement(By::xPath("//a[contains(@onclick, 'item.save')]"))->click();
// Clean up
}