當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Locator::find方法代碼示例

本文整理匯總了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"));
 }
開發者ID:Boorj,項目名稱:bolt,代碼行數:30,代碼來源:BackendDeveloperCest.php

示例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');
 }
開發者ID:PhillippOhlandt,項目名稱:bolt-onepage-example,代碼行數:20,代碼來源:BackendAdminCest.php

示例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'))));
 }
開發者ID:corcre,項目名稱:elabftw,代碼行數:6,代碼來源:LocatorTest.php

示例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');
 }
開發者ID:robbert-vdh,項目名稱:bolt,代碼行數:22,代碼來源:BackendAdminCest.php


注:本文中的Codeception\Util\Locator::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。