Skip to content

Commit

Permalink
Review address
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Jan 12, 2023
1 parent b86da0e commit 0d2c911
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
7 changes: 4 additions & 3 deletions tests/e2e/cucumber/features/smoke/share.ocis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ Feature: share
And "Alice" removes following sharee
| resource | recipient |
| folder_to_customShared | Brian |
Then "Brian" should not be able to see the following shares
| resource | owner |
| folder_to_customShared | Alice Hansen |
And "Alice" deletes the following resources
| resource |
| folder_to_shared/lorem_new.txt |
| folder_to_shared |
And "Alice" logs out
Then "Brian" should not be able to see the following shares
| resource | owner |
| folder_to_customShared | Alice Hansen |
| folder_to_shared | Alice Hansen |
And "Brian" logs out


Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/cucumber/steps/ui/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ When(
'{string} removes following sharee(s)',
async function (this: World, stepUser: string, stepTable: DataTable) {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.applicationFiles.page.spaces.Personal({ page })
await pageObject.navigate()
const shareObject = new objects.applicationFiles.Share({ page })
const shareInfo = parseShareTable(stepTable, this.usersEnvironment)

Expand Down
9 changes: 0 additions & 9 deletions tests/e2e/support/objects/app-files/share/actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Page } from 'playwright'
import util from 'util'
import Collaborator, { ICollaborator } from './collaborator'
import { acceptedShareExists } from './utils'
import { sidebar } from '../utils'
import { clickResource } from '../resource/actions'

Expand Down Expand Up @@ -121,14 +120,6 @@ export const checkSharee = async (args: ShareArgs): Promise<void> => {
}
}

export const isAcceptedSharePresent = async (
page: Page,
resource: string,
owner: string
): Promise<boolean> => {
return await acceptedShareExists({ page, resource, owner })
}

export const hasPermissionToShare = async (
args: Omit<ShareArgs, 'recipients'>
): Promise<boolean> => {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/support/objects/app-files/share/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {
acceptShare,
changeShareeRole,
removeShareeArgs,
isAcceptedSharePresent,
removeSharee,
ShareArgs,
ShareStatusArgs,
declineShare,
checkSharee,
hasPermissionToShare
} from './actions'
import { acceptedShareExists } from './utils'

export class Share {
#page: Page
Expand Down Expand Up @@ -57,7 +57,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 acceptedShareExists({ page: this.#page, resource, owner })
}

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

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

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

0 comments on commit 0d2c911

Please sign in to comment.