$id = $I->grabFromCurrentUrl('~(\\d+)~'); $I->amOnPage(\BlogFeedPage::$url); $I->see('What a title', '.sidebar'); $I->editPost($id, ''); \PostFormPage::of($I)->hasErrors(); $I->editPost($id, 'Another title', ''); \PostFormPage::of($I)->hasErrors(); $I->editPost($id, 'Another title'); \PostFormPage::of($I)->hasNoErrors(); $I->amOnPage(\BlogFeedPage::$url); $I->see('Another title', '.sidebar'); $I->editPost($id, 'Another title', null, ''); \PostFormPage::of($I)->hasNoErrors(); $I->seeInField(\PostFormPage::$slugField, 'another-title'); $slug = \Codeception\Util\Fixtures::get('data:posts[0]:slug'); $I->editPost($id, null, null, $slug); \PostFormPage::of($I)->hasNoErrors(); $I->seeInField(\PostFormPage::$slugField, $slug . '-1'); $I->click(\PostFormPage::$categoryMenuToggleButton); $I->wait(1); $I->fillField(\PostFormPage::$newCategoryField, 'Phantom menace'); $I->click(\PostFormPage::$submitButton); $I->click('link.navigation [location:link.thispost]'); $I->seeLink('Phantom menace', 'phantom-menace'); $I->amOnPage(\PostsDashboardPage::$url); $I->click('control.delete', '#post-' . $id); $I->seeCurrentUrlEquals(\PostsDashboardPage::$url); // flash message containing post title will be shown $I->dontSee('Another title', '#post-' . $id); $I->amOnPage(\BlogFeedPage::$url); $I->dontSee('Another title');