Skip to content

Commit

Permalink
Merge pull request #35474 from HariBhandari07/skeleton-webui-rename-f…
Browse files Browse the repository at this point in the history
…iles

webui rename files without skeleton
  • Loading branch information
phil-davis authored Jun 12, 2019
2 parents 1150c63 + 7b90d83 commit a718941
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 35 deletions.
85 changes: 57 additions & 28 deletions tests/acceptance/features/webUIRenameFiles/renameFiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ Feature: rename files
So that I can organise my data structure

Background:
Given user "user1" has been created with default attributes and skeleton files
And user "user1" has logged in using the webUI
And the user has browsed to the files page
Given user "user1" has been created with default attributes and without skeleton files

@smokeTest
Scenario Outline: Rename a file using special characters
When the user renames file "lorem.txt" to <to_file_name> using the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to <to_file_name> using the webUI
Then file <to_file_name> should be listed on the webUI
When the user reloads the current page of the webUI
Then file <to_file_name> should be listed on the webUI
Examples:
| to_file_name |
| 'लोरेम।तयक्स्त? $%#&@' |
| 'लोरेम।तयक्स्त? $%#&@' |
| '"quotes1"' |
| "'quotes2'" |

Scenario Outline: Rename a file that has special characters in its name
Given user "user1" has uploaded file with content "some content" to <from_name>
And user "user1" has logged in using the webUI
When the user renames file <from_name> to <to_name> using the webUI
Then file <to_name> should be listed on the webUI
When the user reloads the current page of the webUI
Expand All @@ -33,7 +35,10 @@ Feature: rename files

@smokeTest
Scenario: Rename a file using special characters and check its existence after page reload
When the user renames file "lorem.txt" to "लोरेम।तयक्स्त $%&" using the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has uploaded file with content "more content" to "/zzzz-must-be-last-file-in-folder.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to "लोरेम।तयक्स्त $%&" using the webUI
And the user reloads the current page of the webUI
Then file "लोरेम।तयक्स्त $%&" should be listed on the webUI
When the user renames file "लोरेम।तयक्स्त $%&" to '"double"quotes.txt' using the webUI
Expand All @@ -50,7 +55,9 @@ Feature: rename files
Then file "aaaaaa.txt" should be listed on the webUI

Scenario: Rename a file using spaces at front and/or back of file name and type
When the user renames file "lorem.txt" to " space at start" using the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to " space at start" using the webUI
And the user reloads the current page of the webUI
Then file " space at start" should be listed on the webUI
When the user renames file " space at start" to "space at end " using the webUI
Expand All @@ -70,9 +77,11 @@ Feature: rename files
Then file " multiple space all over . dat " should be listed on the webUI

Scenario: Rename a file using both double and single quotes
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames the following file using the webUI
| from-name-parts | to-name-parts |
| lorem.txt | First 'single' quotes |
| randomfile.txt | First 'single' quotes |
| | -then "double".txt |
And the user reloads the current page of the webUI
Then the following file should be listed on the webUI
Expand All @@ -87,51 +96,71 @@ Feature: rename files
Then file "loremz.dat" should be listed on the webUI

Scenario: Rename a file using forbidden characters
When the user renames file "data.zip" to one of these names using the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to one of these names using the webUI
| lorem\txt |
| \\.txt |
| .htaccess |
Then notifications should be displayed on the webUI with the text
| Could not rename "data.zip" |
| Could not rename "data.zip" |
| Could not rename "data.zip" |
And file "data.zip" should be listed on the webUI
| Could not rename "randomfile.txt" |
| Could not rename "randomfile.txt" |
| Could not rename "randomfile.txt" |
And file "randomfile.txt" should be listed on the webUI

Scenario: Rename the last file in a folder
Given user "user1" has uploaded file with content "some content" to "/firstfile.txt"
And user "user1" has uploaded file with content "more content" to "/zzzz-must-be-last-file-in-folder.txt"
And user "user1" has logged in using the webUI
When the user renames file "zzzz-must-be-last-file-in-folder.txt" to "a-file.txt" using the webUI
And the user reloads the current page of the webUI
Then file "a-file.txt" should be listed on the webUI

Scenario: Rename a file to become the last file in a folder
When the user renames file "lorem.txt" to "zzzz-z-this-is-now-the-last-file.txt" using the webUI
Given user "user1" has uploaded file with content "some content" to "/firstfile.txt"
And user "user1" has uploaded file with content "more content" to "/lastfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "firstfile.txt" to "zzzz-z-this-is-now-the-last-file.txt" using the webUI
And the user reloads the current page of the webUI
Then file "zzzz-z-this-is-now-the-last-file.txt" should be listed on the webUI

Scenario: Rename a file putting a name of a file which already exists
When the user renames file "data.zip" to "lorem.txt" using the webUI
Then near file "data.zip" a tooltip with the text 'lorem.txt already exists' should be displayed on the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has uploaded file with content "another content" to "/anotherfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "anotherfile.txt" to "randomfile.txt" using the webUI
Then near file "anotherfile.txt" a tooltip with the text 'randomfile.txt already exists' should be displayed on the webUI

Scenario: Rename a file to ..
When the user renames file "data.zip" to ".." using the webUI
Then near file "data.zip" a tooltip with the text '".." is an invalid file name.' should be displayed on the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to ".." using the webUI
Then near file "randomfile.txt" a tooltip with the text '".." is an invalid file name.' should be displayed on the webUI

Scenario: Rename a file to .
When the user renames file "data.zip" to "." using the webUI
Then near file "data.zip" a tooltip with the text '"." is an invalid file name.' should be displayed on the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to "." using the webUI
Then near file "randomfile.txt" a tooltip with the text '"." is an invalid file name.' should be displayed on the webUI

Scenario: Rename a file to .part
When the user renames file "data.zip" to "data.part" using the webUI
Then near file "data.zip" a tooltip with the text '"data.part" has a forbidden file type/extension.' should be displayed on the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has logged in using the webUI
When the user renames file "randomfile.txt" to "randomfile.part" using the webUI
Then near file "randomfile.txt" a tooltip with the text '"randomfile.part" has a forbidden file type/extension.' should be displayed on the webUI

Scenario: rename a file on a public share
Given the user has created a new public link for folder "simple-folder" using the webUI with
Given user "user1" has created folder "/FOLDER_TO_SHARE"
And user "user1" has uploaded file with content "some content" to "/FOLDER_TO_SHARE/randomfile.txt"
And user "user1" has logged in using the webUI
And the user has created a new public link for folder "FOLDER_TO_SHARE" using the webUI with
| permission | read-write |
When the public accesses the last created public link using the webUI
And the user renames file "lorem.txt" to "a-renamed-file.txt" using the webUI
And the user renames file "randomfile.txt" to "a-renamed-file.txt" using the webUI
Then file "a-renamed-file.txt" should be listed on the webUI
But file "lorem.txt" should not be listed on the webUI
But file "randomfile.txt" should not be listed on the webUI
When the user reloads the current page of the webUI
Then file "a-renamed-file.txt" should be listed on the webUI
But file "lorem.txt" should not be listed on the webUI
And as "user1" file "simple-folder/a-renamed-file.txt" should exist
And as "user1" file "simple-folder/lorem.txt" should not exist
But file "randomfile.txt" should not be listed on the webUI
And as "user1" file "FOLDER_TO_SHARE/a-renamed-file.txt" should exist
And as "user1" file "FOLDER_TO_SHARE/randomfile.txt" should not exist
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ Feature: Renaming files inside a folder with problematic name
So that I can recognize my file easily

Background:
Given user "user1" has been created with default attributes and skeleton files
Given user "user1" has been created with default attributes and without skeleton files
And user "user1" has logged in using the webUI

Scenario Outline: Rename the existing file inside a problematic folder
When the user opens folder <folder> using the webUI
And the user renames file "lorem.txt" to "???.txt" using the webUI
Given user "user1" has uploaded file with content "some content" to "/randomfile.txt"
And user "user1" has created folder "<folder>"
And user "user1" has moved file "/randomfile.txt" to "/<folder>/randomfile.txt"
And the user reloads the current page of the webUI
When the user opens folder "<folder>" using the webUI
And the user renames file "randomfile.txt" to "???.txt" using the webUI
Then file "???.txt" should be listed on the webUI
When the user reloads the current page of the webUI
Then file "???.txt" should be listed on the webUI
Examples:
| folder |
| "0" |
| "'single'quotes" |
| "strängé नेपाली folder" |
| folder |
| 0 |
| 'single'quotes |
| strängé नेपाली folder |

0 comments on commit a718941

Please sign in to comment.