/** * @param FunctionalTester $I */ public function testIndex(FunctionalTester $I) { $I->wantTo('ensure that index post works'); $I->amOnPage(Url::to(['/post/index', 'id' => '1'])); $I->seeLink('Sample Post'); $I->click('Sample Post'); $I->see('Sample Post', 'h1'); }
<?php use tests\codeception\frontend\FunctionalTester; $I = new FunctionalTester($scenario); $I->wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); $I->see('My Company'); $I->seeLink('About'); $I->click('About'); $I->see('This is the About page.');
<?php use tests\codeception\frontend\FunctionalTester; /* @var $scenario Codeception\Scenario */ $I = new FunctionalTester($scenario); $I->wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); $I->see('My Yii Application'); $I->seeLink('Sing in'); $I->click('Sing in'); $I->see('Sign in to start your session');
<?php use tests\codeception\frontend\FunctionalTester; /* @var $scenario Codeception\Scenario */ $I = new FunctionalTester($scenario); $I->wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); $I->see('Реклама'); $I->seeLink('Вход'); $I->click('Вход'); $I->see('Авторизация');