Skip to content

Commit 4552a4d

Browse files
anon-pradipnirajacharya2
authored andcommitted
test: use existing userDropUploadsResources function instead of new userDropsResources
1 parent d021594 commit 4552a4d

3 files changed

Lines changed: 6 additions & 40 deletions

File tree

tests/e2e-playwright/specs/spaces/project.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ test.describe('spaces.personal', () => {
103103
newName: 'team.1'
104104
})
105105
// And "Alice" sets the expiration date of the public link named "team.1" of resource "folderPublic" to "+5 days"
106-
await ui.userSetsExperationDateOfPublicLink({
106+
await ui.userSetsExpirationDateOfThePublicLinkOfResource({
107107
world,
108108
stepUser: 'Alice',
109109
linkName: 'team.1',
@@ -187,7 +187,7 @@ test.describe('spaces.personal', () => {
187187
newRole: 'Secret File Drop'
188188
})
189189
// And "Alice" sets the expiration date of the public link named "team.2" of resource "folderPublic" to "+5 days"
190-
await ui.userSetsExperationDateOfPublicLink({
190+
await ui.userSetsExpirationDateOfThePublicLinkOfResource({
191191
world,
192192
stepUser: 'Alice',
193193
linkName: 'team.2',
@@ -219,10 +219,10 @@ test.describe('spaces.personal', () => {
219219
// And "Anonymous" drop uploads following resources
220220
// | resource |
221221
// | textfile.txt |
222-
await ui.userDropsResources({
222+
await ui.userDropUploadsResources({
223223
world,
224224
stepUser: 'Anonymous',
225-
resources: [{ name: 'textfile.txt' }]
225+
resources: ['textfile.txt']
226226
})
227227

228228
// borrowed from share.feature
@@ -317,10 +317,10 @@ test.describe('spaces.personal', () => {
317317
// And "Anonymous" drop uploads following resources
318318
// | resource |
319319
// | textfile.txt |
320-
await ui.userDropsResources({
320+
await ui.userDropUploadsResources({
321321
world,
322322
stepUser: 'Anonymous',
323-
resources: [{ name: 'textfile.txt' }]
323+
resources: ['textfile.txt']
324324
})
325325
})
326326

tests/e2e-playwright/steps/ui/links.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -282,23 +282,6 @@ export async function userCopiesLinkOfResource({
282282
const linkObject = new objects.applicationFiles.Link({ page })
283283
await linkObject.copyLinkToClipboard({ resource })
284284
}
285-
export async function userSetsExperationDateOfPublicLink({
286-
world,
287-
stepUser,
288-
linkName,
289-
resource,
290-
expireDate
291-
}: {
292-
world: World
293-
stepUser: string
294-
linkName: string
295-
resource: string
296-
expireDate: string
297-
}): Promise<void> {
298-
const { page } = world.actorsEnvironment.getActor({ key: stepUser })
299-
const linkObject = new objects.applicationFiles.Link({ page })
300-
await linkObject.addExpiration({ resource, linkName, expireDate })
301-
}
302285

303286
export async function userChangesThePasswordOfPublicLink({
304287
world,

tests/e2e-playwright/steps/ui/public.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -241,20 +241,3 @@ export async function userRenamesPublicLinkResources({
241241
await pageObject.rename({ resource: resource.resource, newName: resource.newName })
242242
}
243243
}
244-
export async function userDropsResources({
245-
world,
246-
stepUser,
247-
resources
248-
}: {
249-
world: World
250-
stepUser: string
251-
resources: { name: string }[]
252-
}): Promise<void> {
253-
const { page } = world.actorsEnvironment.getActor({ key: stepUser })
254-
const pageObject = new objects.applicationFiles.page.Public({ page })
255-
256-
for (const resource of resources) {
257-
const file = world.filesEnvironment.getFile({ name: resource.name })
258-
await pageObject.dropUpload({ resources: [file] })
259-
}
260-
}

0 commit comments

Comments
 (0)