Skip to content

Commit

Permalink
scenarios migrated to breadcrumb feature
Browse files Browse the repository at this point in the history
  • Loading branch information
haribhandari07 committed Dec 2, 2019
1 parent 611e17e commit 8612ef9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
23 changes: 21 additions & 2 deletions tests/acceptance/features/webUIFiles/breadcrumb.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: access breadcrumb

@issue-2538
Scenario: Check breadCrumb for folder one level below the root folder when rootFolder is set
Given the rootFolder has been set to "" in phoenix config file
Given the "rootFolder" has been set to "" in phoenix config file
And user "user1" has logged in using the webUI
When the user opens folder "simple-folder" using the webUI
# Then breadcrumb for folder "simple-folder" should be displayed on the webUI
Expand All @@ -17,9 +17,28 @@ Feature: access breadcrumb
Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI

Scenario: Change rootFolder to simple-folder and check for the displayed files
Given the rootFolder has been set to "simple-folder" in phoenix config file
Given the "rootFolder" has been set to "simple-folder" in phoenix config file
And user "user1" has logged in using the webUI
When the user browses to the files page
Then folder "0" should not be listed on the webUI
But as "user1" folder "0" should exist
And file "lorem.txt" should be listed on the webUI

@issue-1883
Scenario: Select breadcrumb inside folder with problematic name
Given the "rootFolder" configuration has been deleted in phoenix config file
And user "user1" has created folder "folder%2Fwith%2FSlashes"
And user "user1" has logged in using the webUI
When the user opens folder "folder%2Fwith%2FSlashes" using the webUI
And the user browses to folder "folder%2Fwith%2FSlashes" using the breadcrumb on the webUI
Then the error message "Loading folder failed…" should be displayed on the webUI
# Then the error message should not be displayed on the webUI

@issue-1883
Scenario: Reload webUI inside the problamatic folder
Given user "user1" has created folder "folder%2Fwith%2FSlashes"
And user "user1" has logged in using the webUI
When the user opens folder "folder%2Fwith%2FSlashes" using the webUI
And the user reloads the current page of the webUI
Then the error message "Loading folder failed…" should be displayed on the webUI
# Then the error message should not be displayed on the webUI
16 changes: 0 additions & 16 deletions tests/acceptance/features/webUIFiles/createFolderEdgeCases.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,3 @@ Feature: create folder
| "0" |
| "'single'quotes" |
| "strängé नेपाली folder" |

@issue-1883
Scenario: Select breadcrumb inside folder with problematic name
When the user creates a folder with the name "folder%2Fwith%2FSlashes" using the webUI
And the user opens folder "folder%2Fwith%2FSlashes" using the webUI
And the user browses to folder "folder%2Fwith%2FSlashes" using the breadcrumb on the webUI
Then the error message "Loading folder failed…" should be displayed on the webUI
# Then the error message should not be displayed on the webUI

@issue-1883
Scenario: Reload webUI inside the problamatic folder
When the user creates a folder with the name "folder%2Fwith%2FSlashes" using the webUI
And the user opens folder "folder%2Fwith%2FSlashes" using the webUI
And the user reloads the current page of the webUI
Then the error message "Loading folder failed…" should be displayed on the webUI
# Then the error message should not be displayed on the webUI
10 changes: 8 additions & 2 deletions tests/acceptance/stepDefinitions/generalContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ const getConfigJsonContent = function (fullPathOfConfigFile) {
return JSON.parse(rawdata)
}

Given('the rootFolder has been set to {string} in phoenix config file', function (value) {
Given('the {string} has been set to {string} in phoenix config file', function (key, value) {
const data = getConfigJsonContent(this.fullPathOfConfigFile)
data.rootFolder = value
data[key] = value
return fs.writeFileSync(this.fullPathOfConfigFile, JSON.stringify(data, null, 4))
})

Given('the {string} configuration has been deleted in phoenix config file', function (key) {
const data = getConfigJsonContent(this.fullPathOfConfigFile)
delete data[key]
return fs.writeFileSync(this.fullPathOfConfigFile, JSON.stringify(data, null, 4))
})

Expand Down

0 comments on commit 8612ef9

Please sign in to comment.