From ce7e6308047d7da10dc5b72e6d364fa4ed0dbefb Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Tue, 19 Sep 2017 11:43:25 +0545 Subject: [PATCH] simplifying user feature in UI tests --- tests/ui/features/bootstrap/UsersContext.php | 25 ++++++++------------ tests/ui/features/other/users.feature | 1 + 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/tests/ui/features/bootstrap/UsersContext.php b/tests/ui/features/bootstrap/UsersContext.php index d08a439729c2..f4dbf2c8e4ec 100644 --- a/tests/ui/features/bootstrap/UsersContext.php +++ b/tests/ui/features/bootstrap/UsersContext.php @@ -47,6 +47,15 @@ public function __construct(UsersPage $usersPage) { $this->usersPage = $usersPage; } + /** + * @Given I am on the users page + * @return void + */ + public function iAmOnTheUsersPage() { + $this->usersPage->open(); + $this->usersPage->waitTillPageIsLoaded($this->getSession()); + } + /** * substitute codes like "%regularuser%" with the actual name of the user * @@ -59,26 +68,12 @@ public function checkUsername($username) { } /** - * @Given quota of user :username is set to :quota + * @Given quota of user :username is set/changed to :quota * @param string $username * @param string $quota * @return void */ public function quotaOfUserIsSetTo($username, $quota) { - $this->usersPage->open(); - $this->usersPage->waitTillPageIsLoaded($this->getSession()); - $this->usersPage->setQuotaOfUserTo($username, $quota, $this->getSession()); - } - - /** - * @When quota of user :username is changed to :quota - * @param string $username - * @param string $quota - * @return void - */ - public function quotaOfUserIsChangedTo($username, $quota) { - $this->usersPage->open(); - $this->usersPage->waitTillPageIsLoaded($this->getSession()); $this->usersPage->setQuotaOfUserTo($username, $quota, $this->getSession()); } diff --git a/tests/ui/features/other/users.feature b/tests/ui/features/other/users.feature index 6cc87c9a4cc0..74b2f8b8b0af 100644 --- a/tests/ui/features/other/users.feature +++ b/tests/ui/features/other/users.feature @@ -3,6 +3,7 @@ Feature: users Background: Given a regular user exists And I am logged in as admin + And I am on the users page Scenario Outline: change quota to a valid value And quota of user "%regularuser%" is set to ""