-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Tests-Only] Refactor acceptance tests #394
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ Feature: Guests | |
Then the HTTP status code should be "422" | ||
And user "guest" should not exist | ||
|
||
Scenario: A guest user cannot upload files | ||
Scenario: A guest user cannot upload files to their own storage | ||
Given the administrator has created guest user "guest" with email "[email protected]" | ||
And the HTTP status code should be "201" | ||
When user "[email protected]" uploads overwriting file "textfile.txt" from the guests test data folder to "/myfile.txt" with all mechanisms using the WebDAV API | ||
|
@@ -28,7 +28,7 @@ Feature: Guests | |
And as "[email protected]" file "/textfile.txt" should not exist | ||
And as "user0" file "/textfile.txt" should not exist | ||
|
||
Scenario: A guest user cannot upload files (async upload) | ||
Scenario: A guest user cannot upload files to their own storage (async upload) | ||
Given the administrator has enabled async operations | ||
And the administrator has created guest user "guest" with email "[email protected]" | ||
When user "[email protected]" uploads file "textfile.txt" from the guests test data folder asynchronously to "/textfile.txt" in 3 chunks using the WebDAV API | ||
|
@@ -37,7 +37,7 @@ Feature: Guests | |
And as "user0" file "/textfile.txt" should not exist | ||
|
||
@mailhog | ||
Scenario: A guest user can upload files | ||
Scenario: A guest user can upload files to a folder shared with them | ||
Given user "user0" has been created with default attributes and skeleton files | ||
And the administrator has created guest user "guest" with email "[email protected]" | ||
And the HTTP status code should be "201" | ||
|
@@ -48,7 +48,7 @@ Feature: Guests | |
Then the HTTP status code should be "201" | ||
|
||
@mailhog | ||
Scenario: A guest user can upload chunked files | ||
Scenario: A guest user can upload chunked files to a folder shared with them | ||
Given user "user0" has been created with default attributes and skeleton files | ||
And the administrator has created guest user "guest" with email "[email protected]" | ||
And the HTTP status code should be "201" | ||
|
@@ -64,7 +64,7 @@ Feature: Guests | |
And as "user0" file "/tmp/myChunkedFile.txt" should exist | ||
|
||
@mailhog @issue-279 | ||
Scenario: A guest user can upload files | ||
Scenario: A guest user can upload files to a folder shared with them | ||
Given user "user0" has been created with default attributes and skeleton files | ||
And the administrator has created guest user "guest" with email "[email protected]" | ||
And the HTTP status code should be "201" | ||
|
@@ -89,7 +89,7 @@ Feature: Guests | |
""" | ||
|
||
@mailhog | ||
Scenario: A guest user can upload files (async upload) | ||
Scenario: A guest user can upload files to a folder shared with them (async upload) | ||
Given the administrator has enabled async operations | ||
And user "user0" has been created with default attributes and skeleton files | ||
And the administrator has created guest user "guest" with email "[email protected]" | ||
|
@@ -169,19 +169,6 @@ Feature: Guests | |
Then the OCS status code should be "404" | ||
And the HTTP status code should be "200" | ||
|
||
Scenario: Check that skeleton is properly set | ||
Given user "user0" has been created with default attributes and skeleton files | ||
Then user "user0" should see the following elements | ||
| /FOLDER/ | | ||
| /PARENT/ | | ||
| /PARENT/parent.txt | | ||
| /textfile0.txt | | ||
| /textfile1.txt | | ||
| /textfile2.txt | | ||
| /textfile3.txt | | ||
| /textfile4.txt | | ||
| /welcome.txt | | ||
|
||
@mailhog | ||
Scenario: A created guest user can log in | ||
Given user "user0" has been created with default attributes and skeleton files | ||
|
@@ -198,10 +185,10 @@ Feature: Guests | |
Given the administrator has created guest user "guest" with email "[email protected]" | ||
And the HTTP status code should be "201" | ||
And user "guest" should be a guest user | ||
When the administrator creates guest user "guest" with email "[email protected]" using the API | ||
When the administrator attempts to create guest user "guest" with email "[email protected]" using the API | ||
Then the HTTP status code should be "422" | ||
|
||
Scenario: removing a user from a group | ||
Scenario: removing a guest user from a group | ||
Given the administrator has created guest user "guest" with email "[email protected]" | ||
And the HTTP status code should be "201" | ||
And group "guests_app" has been created | ||
|
@@ -218,11 +205,11 @@ Feature: Guests | |
And user "user0" has created folder "/tmp" | ||
And user "user0" has shared folder "/tmp" with user "[email protected]" | ||
And guest user "guest" registers | ||
When user "[email protected]" has created guest user "guest2" with email "[email protected]" | ||
When user "[email protected]" attempts to create guest user "guest2" with email "[email protected]" using the API | ||
Then the HTTP status code should be "403" | ||
|
||
@mailhog | ||
Scenario: Create a regular user using the same email address of an existing guest user | ||
Scenario: Create a regular user using the same email address as an existing guest user | ||
Given the administrator has created guest user "guest" with email "[email protected]" | ||
When the administrator creates these users with skeleton files: | ||
| username | email | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,34 +86,6 @@ public function __construct(SetPasswordPage $setPasswordPage, FilesPage $filesPa | |
$this->filesPage = $filesPage; | ||
} | ||
|
||
/** | ||
* @return string|null | ||
*/ | ||
public function getGuestGroupName() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function was not used. |
||
$configkeyList = $this->featureContext->getConfigKeyList('guests'); | ||
foreach ($configkeyList as $config) { | ||
if ($config['configkey'] === 'group') { | ||
return $config['value']; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
/** | ||
* @Given guest user :user has been created with email :email and password :password | ||
* | ||
* @param string $user | ||
* @param string $email | ||
* @param string $password | ||
* | ||
* @return void | ||
* @throws Exception | ||
*/ | ||
public function guestUserHasBeenCreatedWithEmailAndPassword($user, $email, $password) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function was not used. |
||
$this->featureContext->createUser($user, $password, $user, $email); | ||
$this->featureContext->addUserToGroup($user, $this->getGuestGroupName()); | ||
} | ||
|
||
/** | ||
* @When guest user :user registers with email :guestEmail and sets password to :password using the webUI | ||
* | ||
|
@@ -190,7 +162,11 @@ public function userShouldNotBeDisplayedInTheDropdownAsGuestUser($user) { | |
$sharingDialog = $this->filesPage->getSharingDialog(); | ||
$arrayList = $sharingDialog->getAutoCompleteItemsList(); | ||
$userAddDialog = \sprintf($this->userAddDialogBoxFramework, $user); | ||
PHPUnit\Framework\Assert::assertNotContains($userAddDialog, $arrayList); | ||
Assert::assertNotContains( | ||
$userAddDialog, | ||
$arrayList, | ||
__METHOD__ . " user $user was displayed in the dropdown as a guest user when it should not be" | ||
); | ||
} | ||
|
||
/** | ||
|
@@ -207,7 +183,7 @@ public function assertWarningMessage($expectedMessage) { | |
} | ||
} | ||
Assert::fail( | ||
"could not find message with the text '$expectedMessage'" | ||
"could not find message with the text '$expectedMessage' on the set-password-page" | ||
); | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scenario was not related to guests at all