Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplifying user feature in UI tests #29050

Merged
merged 1 commit into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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