Support the ongoing development of Laravel.io →
posted 10 years ago
Testing

When I test manually, everything works, but RegisterCept.php functional test just won't pass

$I = new FunctionalTester($scenario);
$I->am('guest');
$I->wantTo('register');

$I->amOnPage('/');
$I->click('Register');
$I->seeCurrentUrlEquals('/register');

$I->fillField('username', 'John');
$I->fillField('email', 'john@example.com');
$I->fillField('password', 'password');
$I->fillField('password_confirmation', 'password');
$I->click('Register');

$I->seeCurrentUrlEquals(''); // fails but /register passes
$I->see('Account created successfully. Validate your email before signing in.'); // also fails

It should redirect to site.dev/, but apparently it doesn't. Output file shows normal /register page HTML without any messages/errors. Trying to force an error (The Password field is required for example) also fails $I->see(). Removing the mail send also doesn't work. DB record doesn't get created... I've tried everything I can think of and nothing seems to work. Even creating a simple controller won't work

User::create(Input::all());
return Redirect::home()->withMessage('FooBar');

LoginCept and ActivateAccountCept work just fine.

Codeception version is 2.0.5

Last updated 2 years ago.
0

Do you have the Laravel4 module and the Db module included in your functional.suite.yaml file?

If so, did you do a codecept build before running your tests?

Last updated 2 years ago.
0

Yes, no and yes.

I have Filesystem, FunctionalHelper, Laravel4, Asserts modules.

I can insert data, since login test does work correctly. and seeRecord() works

I figured it's because of a link that's also named Register, so I renamed the button and added a class, but it can't find neither of them for click().

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

pogachar pogachar Joined 26 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.