Skip to content

Commit

Permalink
fix acceptance tests
Browse files Browse the repository at this point in the history
Signed-off-by: GretaD <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Dec 10, 2019
1 parent 410fa1f commit afe2924
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
21 changes: 18 additions & 3 deletions tests/acceptance/features/bootstrap/UsersSettingsContext.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
*
*
* @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com)
* @copyright Copyright (c) 2018, John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
*
Expand Down Expand Up @@ -86,7 +86,7 @@ public static function rowForUser($user) {

/**
* Warning: you need to watch out for the proper classes order
*
*
* @return Locator
*/
public static function classCellForUser($class, $user) {
Expand Down Expand Up @@ -164,6 +164,14 @@ public static function editModeToggle($user) {
describedAs("The edit toggle button for the user $user in Users Settings");
}

/**
* @return Locator
*/
public static function editModeOn($user) {
return Locator::forThe()->css(".row--editable")->
descendantOf(self::rowForUser($user))->
describedAs("I see the edit mode is on for the user $user in Users Settings");
}
/**
* @When I click the New user button
*/
Expand Down Expand Up @@ -220,6 +228,13 @@ public function iToggleTheEditModeForUser($user) {
$this->actor->find(self::editModeToggle($user), 10)->click();
}

/**
* @When I see the edit mode is on
*/
public function ISeeTheEditModeIsOn($user) {
$this->actor->find(self::editModeOn($user), 10)->click();
}

/**
* @When I create user :user with password :password
*/
Expand Down Expand Up @@ -323,6 +338,6 @@ public function iSeeThatTheuserQuotaIs($user, $quota) {
PHPUnit_Framework_Assert::assertEquals(
$this->actor->find(self::selectedSelectOption('quota', $user), 2)->getText(), $quota);
}


}
16 changes: 10 additions & 6 deletions tests/acceptance/features/users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,21 @@ Feature: users
Given I act as Jane
And I am logged in as the admin
And I open the User settings
When I toggle the edit mode for the user0
Then I see that the edit mode is on
And I see that the list of users contains the user user0
# disabled because we need the TAB patch:
# disabled because we need the TAB patch:
# https://github.com/minkphp/MinkSelenium2Driver/pull/244
# When I assign the user user0 to the group admin
# Then I see that the section Admins is shown
# And I see that the section Admins has a count of 2

Scenario: create and delete a group
Given I act as Jane
And I am logged in as the admin
And I open the User settings
And I see that the list of users contains the user user0
# disabled because we need the TAB patch:
# disabled because we need the TAB patch:
# https://github.com/minkphp/MinkSelenium2Driver/pull/244
# And I assign the user user0 to the group Group1
# And I see that the section Group1 is shown
Expand Down Expand Up @@ -112,7 +114,7 @@ Feature: users
Then I see that the "Storage location" column is shown
When I toggle the showUserBackend checkbox in the settings
Then I see that the "User backend" column is shown

# Scenario: change display name
# Given I act as Jane
# And I am logged in as the admin
Expand All @@ -128,6 +130,8 @@ Feature: users
And I am logged in as the admin
And I open the User settings
And I see that the list of users contains the user user0
When I toggle the edit mode for the user user0
Then I see that the edit mode is on
And I see that the password of user0 is ""
When I set the password for user0 to 123456
And I see that the password cell for user user0 is done loading
Expand All @@ -152,7 +156,7 @@ Feature: users
When I toggle the edit mode for the user user0
Then I see that the edit mode is on
And I see that the user quota of user0 is Unlimited
# disabled because we need the TAB patch:
# disabled because we need the TAB patch:
# https://github.com/minkphp/MinkSelenium2Driver/pull/244
# When I set the user user0 quota to 1GB
# And I see that the quota cell for user user0 is done loading
Expand All @@ -165,4 +169,4 @@ Feature: users
# Then I see that the user quota of user0 is "0 B"
# When I set the user user0 quota to Default
# And I see that the quota cell for user user0 is done loading
# Then I see that the user quota of user0 is "Default quota"
# Then I see that the user quota of user0 is "Default quota"

0 comments on commit afe2924

Please sign in to comment.