Skip to content

Commit

Permalink
simplifying user feature in UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Sep 19, 2017
1 parent 8c03224 commit ce7e630
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
25 changes: 10 additions & 15 deletions tests/ui/features/bootstrap/UsersContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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());
}

Expand Down
1 change: 1 addition & 0 deletions tests/ui/features/other/users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<start_quota>"
Expand Down

0 comments on commit ce7e630

Please sign in to comment.