-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
UI tests for delete feature #28809
Merged
Merged
UI tests for delete feature #28809
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
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Feature: delete | ||
|
||
Background: | ||
Given a regular user exists | ||
And I am logged in as a regular user | ||
And I am on the files page | ||
|
||
Scenario: Delete files & folders one by one and check its existence after page reload | ||
When I delete the folder "simple-folder" | ||
Then the folder "simple-folder" should not be listed | ||
When I delete the file "lorem.txt" | ||
Then the file "lorem.txt" should not be listed | ||
When I delete the folder "strängé नेपाली folder" | ||
Then the folder "strängé नेपाली folder" should not be listed | ||
When I delete the file "strängé filename (duplicate #2).txt" | ||
Then the file "strängé filename (duplicate #2).txt" should not be listed | ||
When the files page is reloaded | ||
Then the folder "simple-folder" should not be listed | ||
And the folder "strängé नेपाली folder" should not be listed | ||
And the file "lorem.txt" should not be listed | ||
And the file "strängé filename (duplicate #2).txt" should not be listed | ||
|
||
Scenario: Delete a file with problematic characters | ||
When I rename the following file to | ||
|from-name-parts |to-name-parts | | ||
|lorem.txt |'single' | | ||
| |"double" quotes| | ||
| |question? | | ||
| |&and#hash | | ||
And the files page is reloaded | ||
Then the following file should be listed | ||
|name-parts | | ||
|'single' | | ||
|"double" quotes| | ||
|question? | | ||
|&and#hash | | ||
And I delete the following file | ||
|name-parts | | ||
|'single' | | ||
|"double" quotes| | ||
|question? | | ||
|&and#hash | | ||
Then the following file should not be listed | ||
|name-parts | | ||
|'single' | | ||
|"double" quotes| | ||
|question? | | ||
|&and#hash | | ||
And the files page is reloaded | ||
Then the following file should not be listed | ||
|name-parts | | ||
|'single' | | ||
|"double" quotes| | ||
|question? | | ||
|&and#hash | | ||
|
||
Scenario: Delete multiple files at once | ||
When I mark these files for batch action | ||
|name | | ||
|data.zip| | ||
|lorem.txt| | ||
|simple-folder| | ||
And I batch delete the marked files | ||
Then the folder "simple-folder" should not be listed | ||
And the file "data.zip" should not be listed | ||
And the file "lorem.txt" should not be listed | ||
When the files page is reloaded | ||
Then the folder "simple-folder" should not be listed | ||
And the file "data.zip" should not be listed | ||
And the file "lorem.txt" should not be listed | ||
|
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
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 |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
use Page\OwncloudPage; | ||
use SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException; | ||
use Behat\Mink\Element\NodeElement; | ||
use Behat\Mink\Session; | ||
|
||
/** | ||
* Object of a row on the FilesPage | ||
|
@@ -167,14 +168,24 @@ public function findRenameInputField() { | |
*/ | ||
public function rename($toName) { | ||
$actionMenu = $this->openFileActionsMenu(); | ||
$actionMenu->rename($this->fileRenameInputXpath); | ||
$actionMenu->rename(); | ||
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. nothing to do with deleting. just too much waiting that I've noticed. |
||
$this->waitTillElementIsNotNull($this->fileRenameInputXpath); | ||
$inputField = $this->findRenameInputField(); | ||
$this->cleanInputAndSetValue($inputField, $toName); | ||
$inputField->blur(); | ||
$this->waitTillElementIsNull($this->fileBusyIndicatorXpath); | ||
} | ||
|
||
/** | ||
* deletes the file | ||
* | ||
* @return void | ||
*/ | ||
public function delete() { | ||
$actionMenu = $this->openFileActionsMenu(); | ||
$actionMenu->delete(); | ||
} | ||
|
||
/** | ||
* finds and returns the tooltip element | ||
* | ||
|
@@ -191,6 +202,15 @@ public function findTooltipElement() { | |
return $element; | ||
} | ||
|
||
/** | ||
* returns the tooltip text | ||
* | ||
* @return string | ||
*/ | ||
public function getTooltip() { | ||
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. placed the function higher up, to make the order more logical. |
||
return $this->findTooltipElement()->getText(); | ||
} | ||
|
||
/** | ||
* finds and returns the thumbnail of the file | ||
* | ||
|
@@ -206,12 +226,13 @@ public function findThumbnail() { | |
} | ||
return $thumbnail; | ||
} | ||
|
||
/** | ||
* returns the tooltip text | ||
* selects this row for batch action e.g. download or delete | ||
* | ||
* @return string | ||
* @return void | ||
*/ | ||
public function getTooltip() { | ||
return $this->findTooltipElement()->getText(); | ||
public function selectForBatchAction() { | ||
$this->findThumbnail()->click(); | ||
} | ||
} |
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
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.
not specific to deleting but when trying to find a file at the top of the page after the page got scrolled down it would find the file but could not click it as it was out of view