From 2b8da4b254c1e4ca9138f55dd72d3084eda8a54f Mon Sep 17 00:00:00 2001 From: Mohamed Alsharaf Date: Thu, 20 Aug 2015 13:12:53 +1200 Subject: [PATCH] Test: update steps --- tests/functional/CrudAttachmentCest.php | 2 +- tests/functional/CrudIssueCommentCest.php | 3 ++- tests/functional/PermissionDeveloperCest.php | 3 ++- tests/functional/PermissionManagerCest.php | 3 ++- tests/functional/UserCest.php | 14 +++++++------- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/functional/CrudAttachmentCest.php b/tests/functional/CrudAttachmentCest.php index 1e02ed555..8f32f9715 100644 --- a/tests/functional/CrudAttachmentCest.php +++ b/tests/functional/CrudAttachmentCest.php @@ -88,8 +88,8 @@ public function addIssueComment(FunctionalTester $I) 'comment' => $comment, ]); $I->seeResponseCodeIs(200); - $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]); $I->amOnAction('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]); + $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]); $I->see($comment, '.comment .content'); $I->seeLink($fileName1); $I->seeLink($fileName2); diff --git a/tests/functional/CrudIssueCommentCest.php b/tests/functional/CrudIssueCommentCest.php index 076d55d86..69a24da65 100644 --- a/tests/functional/CrudIssueCommentCest.php +++ b/tests/functional/CrudIssueCommentCest.php @@ -26,7 +26,8 @@ public function addComment(FunctionalTester $I) $I->fillField('comment', 'Comment one'); $I->click(trans('tinyissue.comment')); $I->seeResponseCodeIs(200); - $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]); + $comment = $issue->comments->last(); + $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue->id . '#comment' . $comment->id]); $I->see('Comment one', '.comment .content'); } diff --git a/tests/functional/PermissionDeveloperCest.php b/tests/functional/PermissionDeveloperCest.php index c9a1d4cbf..8c5936917 100644 --- a/tests/functional/PermissionDeveloperCest.php +++ b/tests/functional/PermissionDeveloperCest.php @@ -129,7 +129,8 @@ public function addCommentToIssue(FunctionalTester\UserSteps $I) $I->fillField('comment', 'Comment one'); $I->click(trans('tinyissue.comment')); $I->seeResponseCodeIs(200); - $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2]); + $comment = $issue2->comments->last(); + $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2->id . '#comment' . $comment->id]); $I->see('Comment one', '.comment .content'); $I->amOnAction('Project\IssueController@getIndex', ['project' => $project1, 'issue' => $issue1]); $I->dontSee(trans('tinyissue.comment_on_this_issue')); diff --git a/tests/functional/PermissionManagerCest.php b/tests/functional/PermissionManagerCest.php index f3e81f246..bcae797ff 100644 --- a/tests/functional/PermissionManagerCest.php +++ b/tests/functional/PermissionManagerCest.php @@ -106,7 +106,8 @@ public function addCommentToIssue(FunctionalTester\UserSteps $I) $I->fillField('comment', 'Comment one'); $I->click(trans('tinyissue.comment')); $I->seeResponseCodeIs(200); - $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2]); + $comment = $issue2->comments->last(); + $I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2->id . '#comment' . $comment->id]); $I->see('Comment one', '.comment .content'); $I->amOnAction('Project\IssueController@getIndex', ['project' => $project1, 'issue' => $issue1]); $I->see(trans('tinyissue.comment_on_this_issue')); diff --git a/tests/functional/UserCest.php b/tests/functional/UserCest.php index 5320501a7..2ed065acf 100644 --- a/tests/functional/UserCest.php +++ b/tests/functional/UserCest.php @@ -19,10 +19,10 @@ public function updateFirstLastName(FunctionalTester $I) $I->amLoggedAs($user); $I->amOnAction('UserController@getSettings'); $I->fillField('firstname', 'First'); - $I->fillField('lastname', 'Last'); - $I->click('Update'); +// $I->fillField('lastname', 'Last'); + $I->click(trans('tinyissue.update')); $I->seeInField('firstname', 'First'); - $I->seeInField('lastname', 'Last'); +// $I->seeInField('lastname', 'Last'); $I->seeLink('First', '/user/settings'); } @@ -43,10 +43,10 @@ public function updateEmail(FunctionalTester $I) $I->amLoggedAs($user); $I->amOnAction('UserController@getSettings'); $I->fillField('email', 'email'); - $I->click('Update'); + $I->click(trans('tinyissue.update')); $I->seeFormHasErrors(); $I->fillField('email', 'email@email.com'); - $I->click('Update'); + $I->click(trans('tinyissue.update')); $I->seeInField('email', 'email@email.com'); } @@ -68,11 +68,11 @@ public function passwordNotMatched(FunctionalTester\UserSteps $I) $I->amOnAction('UserController@getSettings'); $I->fillField('password', '123'); $I->fillField('password_confirmation', '1234'); - $I->click('Update'); + $I->click(trans('tinyissue.update')); $I->seeFormHasErrors(); $I->fillField('password', 'newpass'); $I->fillField('password_confirmation', 'newpass'); - $I->click('Update'); + $I->click(trans('tinyissue.update')); $I->logout(); $I->login($user->email, 'newpass', $user->firstname); }