In yii2-basic template app, tests/codeception/_suppoprt/AcceptanceTester.php seems can define custom action.
class AcceptanceTester extends \Codeception\Actor
{
use _generated\AcceptanceTesterActions;
/**
* Define custom actions here
*/
/**
* I tried to add a customer function
*/
public function foo() {
//....
}
}
then in tests/codeception/acceptance/ContactCept.php, I try to use it
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that contact works');
$I->foo(); <=============================try to call this
$contactPage = ContactPage::openBy($I);
$I->see('Contact', 'h1');
$I->amGoingTo('submit contact form with no data');
$contactPage->submit([]);
Get exception
RuntimeException: Call to undefined method AcceptanceTester::foo