本文整理匯總了PHP中Codeception\Util\Locator::elementAt方法的典型用法代碼示例。如果您正苦於以下問題:PHP Locator::elementAt方法的具體用法?PHP Locator::elementAt怎麽用?PHP Locator::elementAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Codeception\Util\Locator
的用法示例。
在下文中一共展示了Locator::elementAt方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testLocatingElementPosition
public function testLocatingElementPosition()
{
$this->assertEquals('(descendant-or-self::p)[position()=1]', Locator::firstElement('p'));
$this->assertEquals('(descendant-or-self::p)[position()=last()]', Locator::lastElement('p'));
$this->assertEquals('(descendant-or-self::p)[position()=1]', Locator::elementAt('p', 1));
$this->assertEquals('(descendant-or-self::p)[position()=last()-0]', Locator::elementAt('p', -1));
$this->assertEquals('(descendant-or-self::p)[position()=last()-1]', Locator::elementAt('p', -2));
}
示例2: test_default_non_editable_department_named_company
public function test_default_non_editable_department_named_company(SuperUser $i)
{
$i->wantTo('Test if default "Company" named department is there and it is non editable');
$i->login('management@xavoc.com');
$i->clickMenu('HR->Department');
$i->see('Company', Locator::elementAt('//table/tbody/tr/td', 1));
$i->dontSeeElementInDOM('table tbody tr:first-child td:last-child a');
$i->wantTo('Test Quick Search');
$i->searchFor('comp');
$i->see('Company', Locator::elementAt('//table/tbody/tr/td', 1));
$i->searchFor('xxxxssssss');
$i->see('No matching records found');
$i->searchFor('');
$i->dontSee('No matching records found');
$i->see('Company', Locator::elementAt('//table/tbody/tr/td', 1));
$i->click('Active');
$i->waitPageLoad();
$i->click('InActive');
$i->waitPageLoad();
}
示例3: testDeleteAndReload
public function testDeleteAndReload($I)
{
$url = $I->grabAttributeFrom(Locator::elementAt('//table/tbody/tr[2]/td/a', -1), 'href');
$I->sendAjaxPostRequest($url . '&reload=1');
$I->seeResponseCodeIs(302);
$I->amOnPage($I->grabHttpHeader('X-Redirect'));
$I->seeNumberOfElements('//table/tbody/tr', 5);
$I->dontSee('user-5');
}