diff --git a/tests/acceptance/features/apiShareManagementBasic/createShare.feature b/tests/acceptance/features/apiShareManagementBasic/createShare.feature index a3a9b077324b..5672859d67c3 100644 --- a/tests/acceptance/features/apiShareManagementBasic/createShare.feature +++ b/tests/acceptance/features/apiShareManagementBasic/createShare.feature @@ -335,7 +335,7 @@ Feature: sharing #And user "brian" should see the following elements # | /randomfile.txt | #And the content of file "randomfile.txt" for user "brian" should be "Random data" - And user "brian" should not see the following elements + And user "brian" should not see the following elements if the upper and lower case username are different | /randomfile.txt | @skipOnLDAP diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 7177aebdefff..b80fa6b77655 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -1420,6 +1420,26 @@ public function userShouldSeeTheElements($user, $shouldOrNot, $elements) { $this->checkElementList($user, $elements, $should); } + /** + * @Then /^user "([^"]*)" should not see the following elements if the upper and lower case username are different/ + * + * @param string $user + * @param TableNode $elements + * + * @return void + * @throws InvalidArgumentException + * + */ + public function userShouldNotSeeTheElementsIfUpperAndLowerCaseUsernameDifferent($user, $elements) { + $effectiveUser = $this->getActualUsername($user); + if (\strtoupper($effectiveUser) === \strtolower($effectiveUser)) { + $expectedToBeListed = true; + } else { + $expectedToBeListed = false; + } + $this->checkElementList($user, $elements, $expectedToBeListed); + } + /** * asserts that a the user can or cannot see a list of files/folders by propfind * diff --git a/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php b/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php index b7d1d762081d..c759c12004a4 100644 --- a/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php +++ b/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php @@ -50,7 +50,7 @@ class SharingDialog extends OwncloudPage { private $suffixToIdentifyUsers = " User"; private $suffixToIdentifyRemoteUsers = " Federated"; private $sharerInformationXpath = ".//*[@class='reshare']"; - private $sharedWithAndByRegEx = "^(?:[A-Z]\s)?Shared with you(?: and the group (.*))? by (.*)$"; + private $sharedWithAndByRegEx = "Shared with you(?: and the group (.*))? by (.*)$"; private $permissionsFieldByUserNameWithExtraInfo = "//*[@id='shareWithList']//span[contains(text(), '%s')]/parent::li[@data-share-with='%s']"; private $permissionsFieldByUserName = "//*[@id='shareWithList']//span[contains(text(), '%s')]/parent::li"; private $permissionsFieldByGroupName = "//*[@id='shareWithList']//span[contains(text(), '%s (group)')]/parent::li";