本文整理汇总了PHP中Codeception\Util\Locator::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Locator::find方法的具体用法?PHP Locator::find怎么用?PHP Locator::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Codeception\Util\Locator
的用法示例。
在下文中一共展示了Locator::find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fileManagementViewEditTemplatesTest
/**
* Test the 'File management -> View / edit templates' interface
*
* @param \AcceptanceTester $I
*/
public function fileManagementViewEditTemplatesTest(\AcceptanceTester $I)
{
$I->wantTo("Use the 'File management -> View / edit templates' interface as the 'developer' user");
// Set up the browser
$I->setCookie($this->tokenNames['authtoken'], $this->cookies[$this->tokenNames['authtoken']]);
$I->setCookie($this->tokenNames['session'], $this->cookies[$this->tokenNames['session']]);
$I->amOnPage('/bolt/files/themes');
// Inspect the landing page
$dir = 'base-2016';
$I->see('Create folder', Locator::find('a', ['href' => '#']));
$I->see($dir, Locator::href("/bolt/files/themes/{$dir}"));
$I->see("Rename {$dir}", Locator::find('a', ['href' => '#']));
$I->see("Delete {$dir}", Locator::find('a', ['href' => '#']));
// Navigate into the theme and check the results
$I->click("{$dir}/", Locator::href("/bolt/files/themes/{$dir}"));
$I->see('css/', Locator::href("/bolt/files/themes/{$dir}/css"));
$I->see('images/', Locator::href("/bolt/files/themes/{$dir}/images"));
$I->see('js/', Locator::href("/bolt/files/themes/{$dir}/js"));
$I->see('theme.yml', Locator::href("/bolt/file/edit/themes/{$dir}/theme.yml"));
$I->see('record.twig', Locator::href("/bolt/file/edit/themes/{$dir}/record.twig"));
$I->see('index.twig', Locator::href("/bolt/file/edit/themes/{$dir}/index.twig"));
// Navigate into a subdirectory
$I->click('css/', Locator::href("/bolt/files/themes/{$dir}/css"));
$I->see('theme.css', Locator::href("/bolt/file/edit/themes/{$dir}/css/theme.css"));
}
示例2: updateDatabaseTest
/**
* Update the database after creating the Resources Contenttype
*
* @param \AcceptanceTester $I
*/
public function updateDatabaseTest(\AcceptanceTester $I)
{
$I->wantTo("update the database and add the new 'Resources' Contenttype");
// Set up the browser
$I->setCookie('bolt_authtoken', $this->cookies['bolt_authtoken']);
$I->setCookie('bolt_session', $this->cookies['bolt_session']);
$I->amOnPage('/bolt/dbcheck');
$I->see('The database needs to be updated/repaired');
$I->see('is not present');
$I->see('Update the database', Locator::find('button', array('type' => 'submit')));
$I->click('Update the database', Locator::find('button', array('type' => 'submit')));
$I->see('Modifications made to the database');
$I->see('Created table');
$I->see('Your database is now up to date');
}
示例3: testFind
public function testFind()
{
$xml = new SimpleXMLElement("<root><a href='#' tabindex='2'>Click Me</a></root>");
$this->assertNotEmpty($xml->xpath(Locator::find('a', array('href' => '#'))));
$this->assertNotEmpty($xml->xpath(Locator::find('a', array('href', 'tabindex' => '2'))));
}
示例4: updateDatabaseTest
/**
* Update the database after creating the Resources Contenttype
*
* @param \AcceptanceTester $I
*/
public function updateDatabaseTest(\AcceptanceTester $I)
{
$I->wantTo("update the database and add the new 'Resources' Contenttype");
// Set up the browser
$this->setLoginCookies($I);
$I->amOnPage('/bolt');
$I->see('The database needs to be updated/repaired');
$I->see('Check Database', 'a');
$I->click('Check Database', 'a');
// We are now on '/bolt/dbcheck'.
$I->see('is not present');
$I->see('Update the database', Locator::find('button', ['type' => 'submit']));
$I->click('Update the database', Locator::find('button', ['type' => 'submit']));
$I->see('Modifications made to the database');
$I->see('Created table');
$I->see('Your database is now up to date');
}