本文整理汇总了PHP中AcceptanceTester::amOnUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::amOnUrl方法的具体用法?PHP AcceptanceTester::amOnUrl怎么用?PHP AcceptanceTester::amOnUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcceptanceTester
的用法示例。
在下文中一共展示了AcceptanceTester::amOnUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('perform actions and see result');
$I->amOnUrl('http://localhost/~hab/test/web/app_dev.php/');
$I->see('Hello World!');
//$I->fillField('username','hamza');
//$I->click('submit');
//$I->makeScreenshot($scenario->current('name').'_screenshot.png');
//$I->seeCurrentUrlEquals('/~hab/test/web/app_dev.php/testform');
//$I->seeInCurrentUrl('/testform');
示例2: AcceptanceTester
<?php
/**
* @var Codeception\Scenario $scenario
*/
$I = new AcceptanceTester($scenario);
$I->wantTo('make sure that every page in the sitemap');
$I->sendGET('/sitemap');
$I->seeResponseIsXml();
$urls = $I->parseSitemap($I->grabResponse());
foreach ($urls as $url) {
$I->amOnUrl($url);
$I->seeResponseCodeIs(200);
}
示例3: dd
$I->see('Dashboard - Code School', 'title');
$I->wantTo('get codeschool courses page');
$I->amOnPage('paths');
$I->wantTo('get database course detail');
$I->amOnPage('paths/database');
//$aLinkText[] = $I->grabMultiple('a','.course-title-link');
//$x[] = $I->seeElement('a', ['class' => 'course-title-link']);
//$x[] = $I->grabAttributeFrom('.course-title-link', 'a');
$basePath = 'https://www.codeschool.com/';
$videos = '/videos';
$texts = $I->grabMultiple('a.course-title-link');
$hrefs = $I->grabMultiple('a.course-title-link', 'href');
//Download HD Quality
foreach ($hrefs as $link) {
$desiredLink = $link . $videos;
$I->amOnPage($desiredLink);
$videoHrefs = $I->grabMultiple('a.js-level-open', 'href');
foreach ($videoHrefs as $video) {
$I->wantTo('get real video paths');
$I->amOnUrl($basePath . $link . $videos . $video);
$realVideoLink = $I->grabMultiple('iframe.hidden-iframe', 'src');
dd($realVideoLink);
}
}
function dd($val)
{
echo '<pre>';
print_r($val);
die;
}
//https://www.codeschool.com/courses/try-sql
示例4:
public function systeminfo_セキュリティ管理SSL(\AcceptanceTester $I)
{
$I->wantTo('EA0804-UC01-T04 セキュリティ管理 - SSL強制');
$testConfig = Fixtures::get('test_config');
$I->amOnUrl('http://' . $testConfig['hostname'] . '/');
$I->assertRegExp('/^http:\\/\\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされない');
$config = Fixtures::get('config');
$I->amOnUrl('https://' . $testConfig['hostname'] . '/' . $config['admin_route'] . '/setting/system/security');
$I->checkOption(['id' => 'admin_security_force_ssl']);
$I->click('#aside_column div div div div div button');
// httpでアクセスしたらhttpsにリダイレクトされる
$I->amOnUrl('http://' . $testConfig['hostname'] . '/');
$I->assertRegExp('/^https:\\/\\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされる');
// 後続テストのために戻しておく
$I->amOnUrl('https://' . $testConfig['hostname'] . '/' . $config['admin_route'] . '/setting/system/security');
$I->uncheckOption(['id' => 'admin_security_force_ssl']);
$I->click('#aside_column div div div div div button');
}
示例5: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('home page is available');
// $I->amOnPage('/');
// $I->see('Welcome'/*, 'h2'*/);
$I->amOnUrl('http://codeception.com');
$I->see('Modern PHP testing for everyone.');