Skip to content

Commit 8e2fa10

Browse files
committed
test: fix function names
1 parent aa4aec1 commit 8e2fa10

5 files changed

Lines changed: 144 additions & 160 deletions

File tree

tests/e2e-playwright/specs/app-provider/officeSuites.spec.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,18 @@ test.describe('Integrate with online office suites like Collabora and OnlyOffice
208208
// When "Alice" updates following sharee role
209209
// | resource | recipient | type | role | resourceType |
210210
// | OpenDocument.odt | Brian | user | Can edit with trashbin | file |
211-
await ui.userUpdatesShareeRole({
211+
await ui.userUpdatesShareeRoles({
212212
world,
213213
stepUser: 'Alice',
214-
resource: 'OpenDocument.odt',
215-
recipient: 'Brian',
216-
type: 'user',
217-
role: 'Can edit with trashbin',
218-
resourceType: 'file'
214+
roleUpdates: [
215+
{
216+
resource: 'OpenDocument.odt',
217+
recipient: 'Brian',
218+
type: 'user',
219+
role: 'Can edit with trashbin',
220+
resourceType: 'file'
221+
}
222+
]
219223
})
220224

221225
// And "Alice" opens the following file in Collabora
@@ -509,14 +513,18 @@ test.describe('Integrate with online office suites like Collabora and OnlyOffice
509513
// When "Alice" updates following sharee role
510514
// | resource | recipient | type | role | resourceType |
511515
// | MicrosoftWord.docx | Brian | user | Can edit with trashbin | file |
512-
await ui.userUpdatesShareeRole({
516+
await ui.userUpdatesShareeRoles({
513517
world,
514518
stepUser: 'Alice',
515-
resource: 'MicrosoftWord.docx',
516-
recipient: 'Brian',
517-
type: 'user',
518-
role: 'Can edit with trashbin',
519-
resourceType: 'file'
519+
roleUpdates: [
520+
{
521+
resource: 'MicrosoftWord.docx',
522+
recipient: 'Brian',
523+
type: 'user',
524+
role: 'Can edit with trashbin',
525+
resourceType: 'file'
526+
}
527+
]
520528
})
521529

522530
// And "Alice" opens the following file in OnlyOffice

tests/e2e-playwright/specs/journeys/kindergarten.spec.ts

Lines changed: 59 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,16 @@
11
import { test } from '../../support/test'
2-
import { config } from '../../../e2e/config.js'
3-
import {
4-
ActorsEnvironment,
5-
UsersEnvironment,
6-
FilesEnvironment
7-
} from '../../../e2e/support/environment/index.js'
8-
import { setAccessAndRefreshToken } from '../../helpers/setAccessAndRefreshToken.js'
92
import * as api from '../../steps/api/api.js'
103
import * as ui from '../../steps/ui/index'
114

125
test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-users' }, () => {
13-
let actorsEnvironment
14-
const usersEnvironment = new UsersEnvironment()
15-
const filesEnvironment = new FilesEnvironment()
16-
17-
test.beforeEach(async ({ browser }) => {
18-
actorsEnvironment = new ActorsEnvironment({
19-
context: {
20-
acceptDownloads: config.acceptDownloads,
21-
reportDir: config.reportDir,
22-
tracingReportDir: config.tracingReportDir,
23-
reportHar: config.reportHar,
24-
reportTracing: config.reportTracing,
25-
reportVideo: config.reportVideo,
26-
failOnUncaughtConsoleError: config.failOnUncaughtConsoleError
27-
},
28-
browser: browser
29-
})
30-
31-
await setAccessAndRefreshToken(usersEnvironment)
32-
6+
test.beforeEach(async ({ world }) => {
337
// Given "Admin" creates following users using API
348
// | id |
359
// | Alice |
3610
// | Brian |
3711
// | Carol |
38-
await api.usersHasBeenCreated({
39-
usersEnvironment,
12+
await api.usersHaveBeenCreated({
13+
world,
4014
stepUser: 'Admin',
4115
users: ['Alice', 'Brian', 'Carol']
4216
})
@@ -46,36 +20,35 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
4620
// | sales |
4721
// | security |
4822
await api.groupsHaveBeenCreated({
23+
world,
4924
groupIds: ['sales', 'security'],
50-
admin: usersEnvironment.getUser({ key: 'Admin' })
25+
stepUser: 'Admin'
5126
})
5227

5328
// And "Admin" adds user to the group using API
5429
// | user | group |
5530
// | Brian | sales |
56-
await api.addUserToGroup({
57-
usersEnvironment,
31+
await api.usersHaveBeenAddedToGroup({
32+
world,
5833
stepUser: 'Admin',
59-
userToAdd: [{ user: 'Brian', group: 'sales' }]
34+
usersToAdd: [{ user: 'Brian', group: 'sales' }]
6035
})
61-
62-
await setAccessAndRefreshToken(usersEnvironment)
6336
})
6437

65-
test('Alice can share this weeks meal plan with all parents', async () => {
38+
test('Alice can share this weeks meal plan with all parents', async ({ world }) => {
6639
// When "Alice" logs in
67-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
40+
await ui.userLogsIn({ world, stepUser: 'Alice' })
6841

6942
// And "Alice" navigates to the personal space page
70-
await ui.navigateToPersonalSpacePage({ actorsEnvironment, stepUser: 'Alice' })
43+
await ui.userNavigatesToPersonalSpacePage({ world, stepUser: 'Alice' })
7144

7245
// And "Alice" creates the following resources
7346
// | resource | type |
7447
// | groups/Kindergarten Koalas/meal plan | folder |
7548
// | groups/Pre-Schools Pirates/meal plan | folder |
7649
// | groups/Teddy Bear Daycare/meal plan | folder |
7750
await ui.userCreatesResources({
78-
actorsEnvironment,
51+
world,
7952
stepUser: 'Alice',
8053
resources: [
8154
{ name: 'groups/Kindergarten Koalas/meal plan', type: 'folder' },
@@ -95,9 +68,8 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
9568
// | data.zip | groups/Teddy Bear Daycare/meal plan |
9669
// | lorem.txt | groups/Teddy Bear Daycare/meal plan |
9770
// | lorem-big.txt | groups/Teddy Bear Daycare/meal plan |
98-
await ui.uploadResource({
99-
actorsEnvironment,
100-
filesEnvironment,
71+
await ui.userUploadsResources({
72+
world,
10173
stepUser: 'Alice',
10274
resources: [
10375
{ name: 'PARENT/parent.txt', to: 'groups/Kindergarten Koalas/meal plan' },
@@ -127,8 +99,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
12799
// | groups/Teddy Bear Daycare/meal plan/data.zip | Brian | user | Can edit with trashbin | file |
128100
// | groups/Teddy Bear Daycare/meal plan/data.zip | Carol | user | Can edit with trashbin | file |
129101
await ui.userSharesResources({
130-
actorsEnvironment,
131-
usersEnvironment,
102+
world,
132103
actionType: 'SIDEBAR_PANEL',
133104
stepUser: 'Alice',
134105
shares: [
@@ -226,58 +197,52 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
226197
// | groups/Pre-Schools Pirates/meal plan/lorem-big.txt | sales | group | Can edit with trashbin | file |
227198
// | groups/Kindergarten Koalas/meal plan | sales | group | Can edit with trashbin | folder |
228199
// | groups/Teddy Bear Daycare/meal plan/data.zip | Carol | user | Can edit with trashbin | file |
229-
await ui.updateShareeRole({
230-
usersEnvironment,
231-
actorsEnvironment,
232-
stepUser: 'Alice',
233-
resource: 'groups/Pre-Schools Pirates/meal plan',
234-
recipient: 'Carol',
235-
type: 'user',
236-
role: 'Can view',
237-
resourceType: 'folder'
238-
})
239-
await ui.updateShareeRole({
240-
usersEnvironment,
241-
actorsEnvironment,
242-
stepUser: 'Alice',
243-
resource: 'groups/Pre-Schools Pirates/meal plan/lorem-big.txt',
244-
recipient: 'sales',
245-
type: 'group',
246-
role: 'Can edit with trashbin',
247-
resourceType: 'file'
248-
})
249-
await ui.updateShareeRole({
250-
usersEnvironment,
251-
actorsEnvironment,
252-
stepUser: 'Alice',
253-
resource: 'groups/Kindergarten Koalas/meal plan',
254-
recipient: 'sales',
255-
type: 'group',
256-
role: 'Can edit with trashbin',
257-
resourceType: 'folder'
258-
})
259-
await ui.updateShareeRole({
260-
usersEnvironment,
261-
actorsEnvironment,
200+
await ui.userUpdatesShareeRoles({
201+
world,
262202
stepUser: 'Alice',
263-
resource: 'groups/Teddy Bear Daycare/meal plan/data.zip',
264-
recipient: 'Carol',
265-
type: 'user',
266-
role: 'Can edit with trashbin',
267-
resourceType: 'file'
203+
roleUpdates: [
204+
{
205+
resource: 'groups/Pre-Schools Pirates/meal plan',
206+
recipient: 'Carol',
207+
type: 'user',
208+
role: 'Can view',
209+
resourceType: 'folder'
210+
},
211+
{
212+
resource: 'groups/Pre-Schools Pirates/meal plan/lorem-big.txt',
213+
recipient: 'sales',
214+
type: 'group',
215+
role: 'Can edit with trashbin',
216+
resourceType: 'file'
217+
},
218+
{
219+
resource: 'groups/Kindergarten Koalas/meal plan',
220+
recipient: 'sales',
221+
type: 'group',
222+
role: 'Can edit with trashbin',
223+
resourceType: 'folder'
224+
},
225+
{
226+
resource: 'groups/Teddy Bear Daycare/meal plan/data.zip',
227+
recipient: 'Carol',
228+
type: 'user',
229+
role: 'Can edit with trashbin',
230+
resourceType: 'file'
231+
}
232+
]
268233
})
269234
// Then what do we check for to be confident that the above things done by Alice have worked?
270235
// When "Brian" logs in
271-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Brian' })
236+
await ui.userLogsIn({ world, stepUser: 'Brian' })
272237

273238
// And "Brian" navigates to the shared with me page
274-
await ui.navigateToSharedWithMePage({ actorsEnvironment, stepUser: 'Brian' })
239+
await ui.userNavigatesToSharedWithMePage({ world, stepUser: 'Brian' })
275240

276241
// And "Brian" downloads the following resources using the sidebar panel
277242
// | resource | from | type |
278243
// | data.zip | meal plan | file |
279244
await ui.userDownloadsResource({
280-
actorsEnvironment,
245+
world,
281246
stepUser: 'Brian',
282247
resourceToDownload: [{ resource: 'data.zip', from: 'meal plan', type: 'file' }],
283248
actionType: 'SIDEBAR_PANEL'
@@ -286,10 +251,10 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
286251
// Then what do we check for to be confident that the above things done by Brian have worked?
287252
// Then the downloaded zip should contain... ?
288253
// When "Carol" logs in
289-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Carol' })
254+
await ui.userLogsIn({ world, stepUser: 'Carol' })
290255

291256
// And "Carol" navigates to the shared with me page
292-
await ui.navigateToSharedWithMePage({ actorsEnvironment, stepUser: 'Carol' })
257+
await ui.userNavigatesToSharedWithMePage({ world, stepUser: 'Carol' })
293258
// And "Carol" downloads the following resources using the sidebar panel
294259
// | resource | from | type |
295260
// | data.zip | meal plan | file |
@@ -299,7 +264,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
299264
// Then what do we check for to be confident that the above things done by Carol have worked?
300265
// Then the downloaded files should have content "abc..."
301266
await ui.userDownloadsResource({
302-
actorsEnvironment,
267+
world,
303268
stepUser: 'Carol',
304269
resourceToDownload: [
305270
{ resource: 'data.zip', from: 'meal plan', type: 'file' },
@@ -310,7 +275,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
310275
actionType: 'SIDEBAR_PANEL'
311276
})
312277
// And "Carol" logs out
313-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Carol' })
278+
await ui.userLogsOut({ world, stepUser: 'Carol' })
314279

315280
// When "Brian" downloads the following resources using the sidebar panel
316281
// | resource | from | type |
@@ -320,7 +285,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
320285
// Then what do we check for to be confident that the above things done by Brian have worked?
321286
// Then the downloaded files should have content "abc..."
322287
await ui.userDownloadsResource({
323-
actorsEnvironment,
288+
world,
324289
stepUser: 'Brian',
325290
resourceToDownload: [
326291
{ resource: 'lorem.txt', from: 'meal plan', type: 'file' },
@@ -331,7 +296,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
331296
})
332297

333298
// And "Brian" logs out
334-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Brian' })
299+
await ui.userLogsOut({ world, stepUser: 'Brian' })
335300
// And "Alice" downloads the following resources using the sidebar panel
336301
// | resource | from | type |
337302
// | parent.txt | groups/Kindergarten Koalas/meal plan | file |
@@ -351,7 +316,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
351316
// | Teddy Bear Daycare | groups | folder |
352317
// | groups | | folder |
353318
await ui.userDownloadsResource({
354-
actorsEnvironment,
319+
world,
355320
stepUser: 'Alice',
356321
resourceToDownload: [
357322
{
@@ -452,7 +417,7 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
452417
// # Then what do we check for to be confident that the above things done by Alice have worked?
453418
// # Then the downloaded files should have content "abc..."
454419
await ui.userDeletesResources({
455-
actorsEnvironment,
420+
world,
456421
stepUser: 'Alice',
457422
actionType: 'SIDEBAR_PANEL',
458423
resources: [
@@ -470,6 +435,6 @@ test.describe('Kindergarten can use web to organize a day', { tag: '@predefined-
470435
]
471436
})
472437
// And "Alice" logs out
473-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' })
438+
await ui.userLogsOut({ world, stepUser: 'Alice' })
474439
})
475440
})

tests/e2e-playwright/specs/shares/internalLink.spec.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,18 @@ test.describe('internal link share', () => {
4949
stepUser: 'Brian',
5050
resources: [{ name: 'simple.pdf', to: 'myfolder' }]
5151
})
52-
await ui.userUpdatesShareeRole({
52+
await ui.userUpdatesShareeRoles({
5353
world,
5454
stepUser: 'Alice',
55-
resource: 'myfolder',
56-
recipient: 'Brian',
57-
type: 'user',
58-
role: 'Can view',
59-
resourceType: 'folder'
55+
roleUpdates: [
56+
{
57+
resource: 'myfolder',
58+
recipient: 'Brian',
59+
type: 'user',
60+
role: 'Can view',
61+
resourceType: 'folder'
62+
}
63+
]
6064
})
6165
await ui.userLogsOut({ world, stepUser: 'Alice' })
6266

0 commit comments

Comments
 (0)