Skip to content

Commit

Permalink
Add remaining steps
Browse files Browse the repository at this point in the history
  • Loading branch information
SwikritiT committed Sep 12, 2022
1 parent 1c5fb91 commit 056d066
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
</div>
<quota-select
v-if="showQuota"
class="oc-mb-s"
:key="'quota-select-' + user.id"
class="oc-mb-s"
:title="$gettext('Personal quota')"
:total-quota="editUser.drive.quota.total || 0"
@selectedOptionChange="changeSelectedQuotaOption"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<UserInfoBox :user="user" />
<div id="user-group-assignment-form" class="oc-background-highlight oc-p-m">
<oc-select
class="oc-mb-s"
v-model="editUser.memberOf"
class="oc-mb-s"
multiple
:options="groups"
option-label="displayName"
Expand Down
28 changes: 19 additions & 9 deletions tests/e2e/cucumber/features/integrations/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Feature: link
| new-lorem-big.txt | Alice | user | viewer |
And "Brian" logs out
When "Alice" logs in
And "Alice" navigates to the shared with me page
And "Alice" accepts the following share
| name |
| folder_from_brian |
| new-lorem-big.txt |
And "Alice" opens the "files" app
And "Alice" creates the following resources
| resource | type |
Expand All @@ -39,13 +44,7 @@ Feature: link
| resource |
| new-lorem.txt |
| .hidden-file.txt |
And "Alice" navigates to the shared with me page
And "Alice" accepts the following share
| name |
| folder_from_brian |
| new-lorem-big.txt |
And "Alice" navigates to the personal space page
When "Alice" searches "new" using the global search
And "Alice" searches "new" using the global search
Then following resources should be displayed in the search list for user "Alice"
| resource |
| new-lorem.txt |
Expand All @@ -66,8 +65,7 @@ Feature: link
| new-lorem.txt |
| new-lorem-big.txt |
| .hidden-file.txt |
When "Alice" opens the "files" app
And "Alice" searches "hidden" using the global search
When "Alice" searches "hidden" using the global search
Then following resources should be displayed in the search list for user "Alice"
| resource |
| .hidden-file.txt |
Expand All @@ -79,3 +77,15 @@ Feature: link
| folder_from_brian |
| new-lorem.txt |
| new-lorem-big.txt |
When "Alice" opens folder "PARENT"
And "Alice" searches "child" using the global search
Then following resources should be displayed in the search list for user "Alice"
| resource |
| child |
| child-one |
When "Alice" opens folder "child-one"
And "Alice" searches "child" using the global search
Then following resources should be displayed in the search list for user "Alice"
| resource |
| child-two |
And "Alice" logs out
1 change: 1 addition & 0 deletions tests/e2e/cucumber/steps/app-files/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ Then(
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
const actualList = await resourceObject.getDisplayedResources()
console.log(actualList)
for (const info of stepTable.hashes()) {
const found = actualList.includes(info.resource)
if (actionType === 'should') expect(found).toBe(true)
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/support/objects/app-files/resource/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const globalSearchInput = '.oc-search-input'
const searchList =
'//div[@id="files-global-search-options"]//li[contains(@class,"preview")]//span[@class="oc-resource-name"]'
const globalSearchOptions = '#files-global-search-options'
const loadingSpinner = '#files-global-search-bar .oc-spinner'
const filesViewOptionButton = '#files-view-options-btn'
const hiddenFilesToggleButton = '//*[@data-testid="files-switch-hidden-files"]//button'

Expand Down Expand Up @@ -432,10 +433,13 @@ export const searchResourceGlobalSearch = async (
const { page, keyword } = args
await page.locator(globalSearchInput).fill(keyword)
await expect(page.locator(globalSearchOptions)).toBeVisible()
await expect(page.locator(loadingSpinner)).not.toBeVisible()
await page.pause()
}

export const getDisplayedResourcesFromSearch = async (page): Promise<string[]> => {
const result = await page.locator(searchList).allInnerTexts()
console.log(result)
// the result has values like `test\n.txt` so remove new line
return result.map((result) => result.replace('\n', ''))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/support/objects/app-files/resource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Resource {
await uploadResource({ ...args, page: this.#page })
await this.#page.goto(startUrl)
// why? o_O
// await this.#page.locator('body').click()
await this.#page.locator('body').click()
}

async download(args: Omit<downloadResourcesArgs, 'page'>): Promise<Download[]> {
Expand Down

0 comments on commit 056d066

Please sign in to comment.