Skip to content

Commit

Permalink
seperate steps used to check file/folder listed in trashbin
Browse files Browse the repository at this point in the history
  • Loading branch information
swoichha committed Feb 18, 2020
1 parent 1801537 commit fb6fd97
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ Feature: create folder
And user "user1" has logged in using the webUI
And the user has browsed to the files page

Scenario: Create a folder using special characters
When the user creates a folder with the name '"somequotes1"' using the webUI
Then folder '"somequotes1"' should be listed on the webUI
When the user reloads the current page of the webUI
Then folder '"somequotes1"' should be listed on the webUI


Scenario Outline: Create a folder using special characters
When the user creates a folder with the name <folder_name> using the webUI
Then folder <folder_name> should be listed on the webUI
Expand Down
16 changes: 8 additions & 8 deletions tests/acceptance/features/webUITrashbin/trashbinRestore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ Feature: Restore deleted files/folders
When the user browses to the trashbin page
And the user restores file "lorem.txt" from the trashbin using the webUI
Then the success message "lorem.txt was restored successfully" should be displayed on the webUI
And file "lorem.txt" should not be listed on the webUI
And folder "lorem.txt" should be listed on the webUI
And "file" "lorem.txt" should not be listed on the webUI
And "folder" "lorem.txt" should be listed on the webUI
When the user browses to the files page using the webUI
Then file "lorem.txt" should be listed on the webUI
And folder "lorem.txt" should not be listed on the webUI
Then "file" "lorem.txt" should be listed on the webUI
And "folder" "lorem.txt" should not be listed on the webUI

Scenario: Delete and restore a folder that has the same name like a deleted file
Given the user has created file "lorem.txt"
Expand All @@ -146,8 +146,8 @@ Feature: Restore deleted files/folders
When the user browses to the trashbin page
And the user restores folder "lorem.txt" from the trashbin using the webUI
Then the success message "lorem.txt was restored successfully" should be displayed on the webUI
And folder "lorem.txt" should not be listed on the webUI
And file "lorem.txt" should be listed on the webUI
And "folder" "lorem.txt" should not be listed on the webUI
And "file" "lorem.txt" should be listed on the webUI
When the user browses to the files page using the webUI
Then folder "lorem.txt" should be listed on the webUI
And file "lorem.txt" should not be listed on the webUI
Then "folder" "lorem.txt" should be listed on the webUI
And "file" "lorem.txt" should not be listed on the webUI
1 change: 1 addition & 0 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ module.exports = {
*/
waitForFileVisible: async function (fileName, elementType = 'file') {
const linkSelector = this.getFileLinkSelectorByFileName(fileName, elementType)

await this.waitForElementPresent('@filesTableContainer')
await this.filesListScrollToTop()
await this.findItemInFilesList(fileName)
Expand Down
18 changes: 16 additions & 2 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,14 @@ Then('there should be no files/folders/resources listed on the webUI', async fun
assert.ok(allRowsResult.value.length === 0, `No resources are listed, ${allRowsResult.length} found`)
})

Then(/^(file|folder) ("([^"]*)"|'([^"]*)') should be listed on the webUI$/, (elementType, folder) => {
Then('file/folder {string} should be listed on the webUI', function (folder) {
return client
.page
.FilesPageElement.filesList()
.waitForFileVisible(folder)
})

Then('{string} {string} should be listed on the webUI', (elementType, folder) => {
return client
.page
.FilesPageElement.filesList()
Expand All @@ -364,7 +371,14 @@ Then('the last uploaded folder should be listed on the webUI', async function ()
return client
})

Then(/^(file|folder) "([^"]*)" should not be listed on the webUI$/, async (elementType, folder) => {
Then('file/folder {string} should not be listed on the webUI', async function (folder) {
const state = await client.page.FilesPageElement.filesList().isElementListed(folder)
return client.assert.ok(
!state, `Error: Resource ${folder} is listed on the filesList`
)
})

Then('{string} {string} should not be listed on the webUI', async (elementType, folder) => {
const state = await client.page.FilesPageElement.filesList().isElementListed(folder, elementType)
return client.assert.ok(
!state, `Error: Resource ${folder} is listed on the filesList`
Expand Down

0 comments on commit fb6fd97

Please sign in to comment.