Skip to content

Commit b24d990

Browse files
committed
Add NewCommentCest
1 parent 091d561 commit b24d990

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/functional/NewCommentCept.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
use App\Tests\FunctionalTester;
4+
use Codeception\Util\HttpCode;
5+
6+
$I = new FunctionalTester($scenario);
7+
$I->am('Regular user');
8+
$I->wantTo('add new comment to post and see it');
9+
$I->amOnPage('/en/login');
10+
$I->seeResponseCodeIs(HttpCode::OK);
11+
$I->fillField('_username', 'john_user');
12+
$I->fillField('_password', 'kitten');
13+
$I->submitForm('.well form', []);
14+
$I->seeResponseCodeIs(HttpCode::OK);
15+
$I->seeCurrentRouteIs('blog_index');
16+
$I->click('article.post > h2 a');
17+
$I->seeResponseCodeIs(HttpCode::OK);
18+
$I->seeCurrentRouteIs('blog_post');
19+
$I->dontSee('Hi, Symfony!');
20+
$I->fillField('comment[content]', 'Hi, Symfony!');
21+
$I->submitForm('#post-add-comment > form', []);
22+
$I->seeCurrentRouteIs('blog_post');
23+
$I->see('Hi, Symfony!');
24+
$I->seeInRepository(\App\Entity\Comment::class, ['content' => 'Hi, Symfony!']);

0 commit comments

Comments
 (0)