コード例 #1
0
ファイル: LoginCept.php プロジェクト: deesoft/yii2-app-single
<?php

use tests\codeception\app\FunctionalTester;
use tests\codeception\common\_pages\LoginPage;
/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure login page works');
$loginPage = LoginPage::openBy($I);
$I->amGoingTo('submit login form with no data');
$loginPage->login('', '');
$I->expectTo('see validations errors');
$I->see('Username cannot be blank.', '.help-block');
$I->see('Password cannot be blank.', '.help-block');
$I->amGoingTo('try to login with wrong credentials');
$I->expectTo('see validations errors');
$loginPage->login('admin', 'wrong');
$I->expectTo('see validations errors');
$I->see('Incorrect username or password.', '.help-block');
$I->amGoingTo('try to login with correct credentials');
$loginPage->login('erau', 'password_0');
$I->expectTo('see that user is logged');
$I->seeLink('Logout (erau)');
$I->dontSeeLink('Login');
$I->dontSeeLink('Signup');
コード例 #2
0
ファイル: HomeCept.php プロジェクト: Humanized/viajero
<?php

use tests\codeception\app\FunctionalTester;
/* @var $scenario Codeception\Scenario */
$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.');
コード例 #3
0
ファイル: ContactCept.php プロジェクト: Humanized/viajero
<?php

use tests\codeception\app\FunctionalTester;
use tests\codeception\app\_pages\ContactPage;
/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that contact works');
$contactPage = ContactPage::openBy($I);
$I->see('Contact', 'h1');
$I->amGoingTo('submit contact form with no data');
$contactPage->submit([]);
$I->expectTo('see validations errors');
$I->see('Contact', 'h1');
$I->see('Name cannot be blank', '.help-block');
$I->see('Email cannot be blank', '.help-block');
$I->see('Subject cannot be blank', '.help-block');
$I->see('Body cannot be blank', '.help-block');
$I->see('The verification code is incorrect', '.help-block');
$I->amGoingTo('submit contact form with not correct email');
$contactPage->submit(['name' => 'tester', 'email' => 'tester.email', 'subject' => 'test subject', 'body' => 'test content', 'verifyCode' => 'testme']);
$I->expectTo('see that email adress is wrong');
$I->dontSee('Name cannot be blank', '.help-block');
$I->see('Email is not a valid email address.', '.help-block');
$I->dontSee('Subject cannot be blank', '.help-block');
$I->dontSee('Body cannot be blank', '.help-block');
$I->dontSee('The verification code is incorrect', '.help-block');
$I->amGoingTo('submit contact form with correct data');
$contactPage->submit(['name' => 'tester', 'email' => '*****@*****.**', 'subject' => 'test subject', 'body' => 'test content', 'verifyCode' => 'testme']);
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
コード例 #4
0
ファイル: HomeCept.php プロジェクト: frostiks25/rzwebsys7
<?php

use tests\codeception\app\FunctionalTester;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->urlManager->createUrl('main/pages/index'));
$I->see('RzWebSys7');
$I->seeLink('Главная');
コード例 #5
0
ファイル: AboutCept.php プロジェクト: Humanized/viajero
<?php

use tests\codeception\app\FunctionalTester;
use tests\codeception\app\_pages\AboutPage;
/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that about works');
AboutPage::openBy($I);
$I->see('About', 'h1');