Skip to content

Commit 4a7f3df

Browse files
committed
Merge branch 'master' of github.com:notgosu/yii2-app-basic
2 parents 71ee8a0 + aaee084 commit 4a7f3df

15 files changed

+163
-141
lines changed

tests/codeception/_pages/ContactPage.php

-26
This file was deleted.

tests/codeception/_support/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class AcceptanceTester extends \Codeception\Actor
20+
{
21+
use _generated\AcceptanceTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class FunctionalTester extends \Codeception\Actor
20+
{
21+
use _generated\FunctionalTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class UnitTester extends \Codeception\Actor
20+
{
21+
use _generated\UnitTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

tests/codeception/acceptance.suite.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class_name: AcceptanceTester
1212
modules:
1313
enabled:
1414
- PhpBrowser
15+
# - Yii2:
16+
# configFile: '/codeception/config/acceptance.php'
1517
# you can use WebDriver instead of PhpBrowser to test javascript and ajax.
1618
# This will require you to install selenium. See http://codeception.com/docs/03-AcceptanceTests#selenium-webdriver
1719
# "restart" option is used by the WebDriver to start each time per test-file new session and cookies,

tests/codeception/acceptance/AboutCept.php

-10
This file was deleted.
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
class AboutCest
4+
{
5+
public function ensureThatAboutWorks(AcceptanceTester $I)
6+
{
7+
//$I->amOnPage(['site/about']);
8+
$I->amOnPage('index.php?r=site%2Fabout');
9+
$I->see('About', 'h1');
10+
}
11+
}

tests/codeception/acceptance/ContactCept.php

-57
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* Class ContactCest
5+
*/
6+
class ContactCest
7+
{
8+
public function _before(\AcceptanceTester $I)
9+
{
10+
$I->amOnPage('index-test.php?r=site%2Fcontact');
11+
}
12+
13+
public function contactPageWorks(AcceptanceTester $I)
14+
{
15+
$I->wantTo('ensure that contact page works');
16+
$I->see('Contact', 'h1');
17+
}
18+
19+
public function contactFormCanBeSubmitted(AcceptanceTester $I)
20+
{
21+
$I->amGoingTo('submit contact form with correct data');
22+
$I->fillField('#contactform-name', 'tester');
23+
$I->fillField('#contactform-email', 'tester@example.com');
24+
$I->fillField('#contactform-subject', 'test subject');
25+
$I->fillField('#contactform-body', 'test content');
26+
$I->fillField('#contactform-verifycode', 'testme');
27+
28+
$I->click('contact-button');
29+
30+
$I->dontSeeElement('#contact-form');
31+
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
32+
}
33+
}

tests/codeception/acceptance/HomeCept.php

-11
This file was deleted.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
class HomeCest
4+
{
5+
public function ensureThatHomePageWorks(AcceptanceTester $I)
6+
{
7+
//$I->amOnPage(Yii::$app->homeUrl);
8+
$I->amOnPage('index.php?r=site%2Findex');
9+
$I->see('My Company');
10+
11+
$I->seeLink('About');
12+
$I->click('About');
13+
14+
$I->see('This is the About page.');
15+
}
16+
}

tests/codeception/acceptance/LoginCept.php

-37
This file was deleted.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
class LoginCest
4+
{
5+
public function ensureThatLoginWorks(AcceptanceTester $I)
6+
{
7+
//$I->amOnPage(['site/login']);
8+
$I->amOnPage('index.php?r=site%2Flogin');
9+
$I->see('Login', 'h1');
10+
11+
$I->amGoingTo('try to login with correct credentials');
12+
$I->fillField('input[name="LoginForm[username]"]', 'admin');
13+
$I->fillField('input[name="LoginForm[password]"]', 'admin');
14+
$I->click('login-button');
15+
16+
$I->expectTo('see user info');
17+
$I->see('Logout (admin)');
18+
}
19+
}

0 commit comments

Comments
 (0)