Skip to content

Commit

Permalink
Rebase conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Jan 17, 2023
1 parent ecd6ee1 commit 8130a01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
12 changes: 5 additions & 7 deletions tests/e2e/cucumber/features/smoke/share.ocis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ Feature: share
| name |
| folder_to_shared |
| folder_to_customShared |
| shared_folder |
And "Alice" logs in
And "Alice" opens the "files" app
And "Alice" creates the following resources
| resource | type |
| folder_to_shared | folder |
And "Alice" uploads the following resource
| resource | to |
| lorem.txt | folder_to_shared |
Expand All @@ -33,9 +31,9 @@ Feature: share
| folder_to_shared |
| folder_to_customShared |
Then "Brian" should not be able to open the folder "shared_folder"
When "Brian" accepts the following share
| name |
| folder_to_shared |
When "Brian" accepts the following share from the context menu
| name |
| shared_folder |
And "Brian" declines the following share
| name |
| shared_folder |
Expand Down Expand Up @@ -98,7 +96,7 @@ Feature: share
| testavatar.jpeg | Brian | user | viewer |
| simple.pdf | Brian | user | viewer |
| sharedFile.txt | Brian | user | editor |
When "Brian" logs in
And "Brian" logs in
And "Brian" opens the "files" app
And "Brian" navigates to the shared with me page
Then "Brian" should not be able to open the file "shareToBrian.txt"
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/support/objects/app-files/share/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
acceptShare,
changeShareeRole,
removeShareeArgs,
isAcceptedSharePresent,
removeSharee,
ShareArgs,
ShareStatusArgs,
Expand All @@ -14,7 +13,7 @@ import {
hasPermissionToShare,
copyQuickLink
} from './actions'
import { resourceIsNotOpenable } from './utils'
import { resourceIsNotOpenable, isAcceptedSharePresent } from './utils'
import { copyLinkArgs } from '../link/actions'

export class Share {
Expand Down Expand Up @@ -60,7 +59,7 @@ export class Share {

async isAcceptedSharePresent(resource: string, owner: string): Promise<boolean> {
await this.#page.reload()
return await isAcceptedSharePresent(this.#page, resource, owner)
return await isAcceptedSharePresent({ page: this.#page, resource, owner })
}

async hasPermissionToShare(resource: string): Promise<boolean> {
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/support/objects/app-files/share/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import util from 'util'
import { resourceNameSelector, fileRow } from '../resource/actions'

const acceptedShareItem =
'//*[@data-test-resource-name="%s"]/ancestor::tr//span[@data-test-user-name="%s"]'
'//*[@data-test-resource-name="%s"]/ancestor::tr//span[@data-test-user-name="%s"]'

export const resourceIsNotOpenable = async ({
page,
Expand All @@ -17,10 +17,10 @@ export const resourceIsNotOpenable = async ({
await Promise.all([
page.waitForResponse((resp) => {
return (
(resp.url().endsWith(encodeURIComponent(resource)) ||
resp.url().endsWith(encodeURIComponent(itemId))) &&
resp.status() === 404 &&
resp.request().method() === 'PROPFIND'
(resp.url().endsWith(encodeURIComponent(resource)) ||
resp.url().endsWith(encodeURIComponent(itemId))) &&
resp.status() === 404 &&
resp.request().method() === 'PROPFIND'
)
}),
resourceLocator.click()
Expand All @@ -30,7 +30,7 @@ export const resourceIsNotOpenable = async ({
return true
}

export const acceptedShareExists = async ({
export const isAcceptedSharePresent = async ({
page,
resource,
owner,
Expand Down

0 comments on commit 8130a01

Please sign in to comment.