本文整理汇总了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');
}