I am trying to create acceptance tests for my Symfony 3 application, but it is not working. It always show me one error:
AdminFamilyTestCest: Test admin\farm page of my site Test tests\acceptance\AdminFamilyTestCest.php:testFamilyPage Step Can see in title "Family" Fail Failed asserting that
/admin/families/ --> Failed to start the session because headers have already been sent by "C:\wamp64\www\farm\vendor\symfony\phpunit-bridge\SymfonyTestsListener.php" at line 77. (500 Internal Server Error) OK Need support? Failed to start the session because headers have already been sent by "C:\wamp64\www\farm\vendor [Content too long to display. See complete response in 'C:\wamp64\www\farm\tests/_output\' directory] --> contains "#logout".
Scenario Steps:
- $I->see("#logout")
- $I->canSeeInTitle("Family")
- $I->amOnPage("/admin/families/")
- $I->click("Log in")
- $I->fillField("_password","admin")
- $I->fillField("_username","admin")
FAILURES! Tests: 1, Assertions: 3, Failures: 2.
Shorter message is: Failed to start the session because headers have already been sent.
Code of my tests:
class AdminFamilyTestCest
{
public function testFamilyPage(AcceptanceTester $I)
{
$I->wantToTest('Admin\Farm page of my site');
$I->amOnPage('/login');
$I->see('Log in');
$I->fillField('_username', 'admin');
$I->fillField('_password', 'admin');
$I->click('Log in');
$I->amOnPage('/admin/families/');
$I->canSeeInTitle('Family');
$I->see('#logout');
$I->amOnPage('/logout');
$I->amOnPage('/login');
$I->seeInTitle('Welcome!');
}
}
Test is very simple, but I don't know why the error happens.
tests/_output/AdminFamilyTestCest.testFamilyPage.htmlfile and read a complete error message. It will tell you what code is making the output. This is an application error, not a Codeception error.