Skip to content

Commit 2b7ccf2

Browse files
committed
test: standardize playwright step defnitions
1 parent e3b9e6b commit 2b7ccf2

52 files changed

Lines changed: 604 additions & 610 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/e2e-playwright/specs/admin-settings/general.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ test.describe('general management', () => {
2828
})
2929

3030
await setAccessAndRefreshToken(usersEnvironment)
31-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
31+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
3232
})
3333

3434
test('logo can be changed in the admin settings', async () => {
3535
await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Admin', name: 'admin-settings' })
36-
await ui.navigateToGeneralManagementPage({ actorsEnvironment, stepUser: 'Admin' })
37-
await ui.uploadLogoFromLocalPath({
36+
await ui.userNavigatesToGeneralManagementPage({ actorsEnvironment, stepUser: 'Admin' })
37+
await ui.userUploadsLogoFromLocalPath({
3838
actorsEnvironment,
3939
stepUser: 'Admin',
4040
localFile: 'filesForUpload/testavatar.png',
4141
filesEnvironment
4242
})
43-
await ui.navigateToGeneralManagementPage({ actorsEnvironment, stepUser: 'Admin' })
44-
await ui.resetLogo({ actorsEnvironment, stepUser: 'Admin' })
45-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Admin' })
43+
await ui.userNavigatesToGeneralManagementPage({ actorsEnvironment, stepUser: 'Admin' })
44+
await ui.userResetsLogo({ actorsEnvironment, stepUser: 'Admin' })
45+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Admin' })
4646
})
4747
})

tests/e2e-playwright/specs/admin-settings/groups.spec.ts

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expect } from '@playwright/test'
21
import { test } from '../../support/test'
32
import { config } from '../../../e2e/config.js'
43
import { ActorsEnvironment } from '../../../e2e/support/environment'
@@ -24,11 +23,11 @@ test.describe('groups management', () => {
2423
})
2524

2625
await setAccessAndRefreshToken(usersEnvironment)
27-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
26+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
2827
})
2928

3029
test.afterEach(async () => {
31-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Admin' })
30+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Admin' })
3231
})
3332

3433
test('admin creates group', async () => {
@@ -39,13 +38,11 @@ test.describe('groups management', () => {
3938
stepUser: 'Admin',
4039
groupIds: ['sales', 'security']
4140
})
42-
expect(
43-
await ui.checkGroupsPresenceById({
44-
actorsEnvironment,
45-
stepUser: 'Admin',
46-
expectedGroupIds: ['sales', 'security']
47-
})
48-
).toBeTruthy()
41+
await ui.userShouldSeeGroupIds({
42+
actorsEnvironment,
43+
stepUser: 'Admin',
44+
expectedGroupIds: ['sales', 'security']
45+
})
4946
})
5047

5148
test('admin deletes group', async ({ usersEnvironment }) => {
@@ -62,13 +59,12 @@ test.describe('groups management', () => {
6259
groupsToBeDeleted: ['sales']
6360
})
6461

65-
expect(
66-
await ui.checkGroupsPresenceById({
67-
actorsEnvironment,
68-
stepUser: 'Admin',
69-
expectedGroupIds: ['sales']
70-
})
71-
).toBeFalsy()
62+
await ui.userShouldSeeGroupIds({
63+
actorsEnvironment,
64+
stepUser: 'Admin',
65+
expectedGroupIds: ['sales'],
66+
shouldBePresent: false
67+
})
7268

7369
await ui.userDeletesGroups({
7470
actorsEnvironment,
@@ -77,13 +73,12 @@ test.describe('groups management', () => {
7773
groupsToBeDeleted: ['security', 'finance']
7874
})
7975

80-
expect(
81-
await ui.checkGroupsPresenceById({
82-
actorsEnvironment,
83-
stepUser: 'Admin',
84-
expectedGroupIds: ['security', 'finance']
85-
})
86-
).toBeFalsy()
76+
await ui.userShouldSeeGroupIds({
77+
actorsEnvironment,
78+
stepUser: 'Admin',
79+
expectedGroupIds: ['security', 'finance'],
80+
shouldBePresent: false
81+
})
8782
})
8883

8984
test('edit groups', async ({ usersEnvironment }) => {
@@ -101,12 +96,10 @@ test.describe('groups management', () => {
10196
value: 'a renamed group',
10297
action: 'context-menu'
10398
})
104-
expect(
105-
await ui.groupDisplayNameExists({
106-
actorsEnvironment,
107-
stepUser: 'Admin',
108-
groupDisplayName: 'a renamed group'
109-
})
110-
).toBeTruthy()
99+
await ui.userShouldSeeGroupDisplayName({
100+
actorsEnvironment,
101+
stepUser: 'Admin',
102+
groupDisplayName: 'a renamed group'
103+
})
111104
})
112105
})

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expect } from '@playwright/test'
21
import { test } from '../../support/test'
32
import { config } from '../../../e2e/config.js'
43
import { ActorsEnvironment, UsersEnvironment } from '../../../e2e/support/environment'
@@ -29,13 +28,13 @@ test.describe('lock', { tag: '@sse' }, () => {
2928
// | Alice |
3029
// | Brian |
3130
// | Carol |
32-
await api.usersHasBeenCreated({
31+
await api.usersHaveBeenCreated({
3332
usersEnvironment,
3433
stepUser: 'Admin',
3534
users: ['Alice', 'Brian', 'Carol']
3635
})
3736
// And "Alice" logs in
38-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
37+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
3938
})
4039

4140
test('file lock indication', async () => {
@@ -64,13 +63,13 @@ test.describe('lock', { tag: '@sse' }, () => {
6463
]
6564
})
6665
// And "Brian" logs in
67-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Brian' })
66+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Brian' })
6867
// And "Brian" navigates to the shared with me page
69-
await ui.navigateToSharedWithMePage({ actorsEnvironment, stepUser: 'Brian' })
68+
await ui.userNavigatesToSharedWithMePage({ actorsEnvironment, stepUser: 'Brian' })
7069
// When "Brian" opens the following file in Collabora
7170
// | resource |
7271
// | test.odt |
73-
await ui.openResourceInViewer({
72+
await ui.userOpensResourceInViewer({
7473
actorsEnvironment,
7574
stepUser: 'Brian',
7675
resource: 'test.odt',
@@ -100,13 +99,11 @@ test.describe('lock', { tag: '@sse' }, () => {
10099

101100
// checking that user cannot 'move', 'rename', 'delete' locked file
102101
// And "Alice" should not be able to edit file "test.odt"
103-
expect(
104-
await ui.isAbleToEditFileOrFolder({
105-
actorsEnvironment,
106-
stepUser: 'Alice',
107-
resource: 'test.odt'
108-
})
109-
).toBeFalsy()
102+
await ui.userShouldNotBeAbleToEditResource({
103+
actorsEnvironment,
104+
stepUser: 'Alice',
105+
resource: 'test.odt'
106+
})
110107

111108
// checking that user cannot delete or change share of the locked file
112109
// https://github.com/owncloud/web/issues/10507
@@ -123,7 +120,7 @@ test.describe('lock', { tag: '@sse' }, () => {
123120
// And "Alice" creates a public link of following resource using the sidebar panel
124121
// | resource | password |
125122
// | test.odt | %public% |
126-
await ui.createPublicLink({
123+
await ui.userCreatesPublicLink({
127124
actorsEnvironment,
128125
stepUser: 'Alice',
129126
resource: 'test.odt',
@@ -175,8 +172,8 @@ test.describe('lock', { tag: '@sse' }, () => {
175172
recipient: 'Brian'
176173
})
177174
// And "Brian" logs out
178-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Brian' })
175+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Brian' })
179176
// And "Alice" logs out
180-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' })
177+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Alice' })
181178
})
182179
})

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ test.describe('url stability for mobile and desktop client', { tag: '@predefined
3030
// Given "Admin" creates following users using API
3131
// | id |
3232
// | Alice |
33-
await api.usersHasBeenCreated({
33+
await api.usersHaveBeenCreated({
3434
usersEnvironment,
3535
stepUser: 'Admin',
3636
users: ['Alice']
3737
})
3838
// And "Alice" logs in
39-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
39+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
4040
// And "Alice" creates the following files into personal space using API
4141
// | pathToFile | content |
4242
// | OpenDocument.odt | OpenDocument Content |
@@ -138,6 +138,6 @@ test.describe('url stability for mobile and desktop client', { tag: '@predefined
138138
editor: 'OnlyOffice'
139139
})
140140
// And "Alice" logs out
141-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' })
141+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Alice' })
142142
})
143143
})

tests/e2e-playwright/specs/app-store/details.spec.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,50 +28,54 @@ test.describe('details', { tag: '@predefined-users' }, () => {
2828

2929
test('Apps can be viewed and downloaded', async () => {
3030
// When "Admin" logs in
31-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
31+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
3232

3333
// And "Admin" navigates to the app store
34-
await ui.openAppStore({ actorsEnvironment, stepUser: 'Admin' })
34+
await ui.userOpensAppStore({ actorsEnvironment, stepUser: 'Admin' })
3535

3636
// Then "Admin" should see the app store
37-
await ui.waitForAppStoreIsVisible({ actorsEnvironment, stepUser: 'Admin' })
37+
await ui.userShouldSeeAppStore({ actorsEnvironment, stepUser: 'Admin' })
3838

3939
// When "Admin" clicks on the app "Development boilerplate"
40-
await ui.selectApp({ actorsEnvironment, stepUser: 'Admin', app: 'Development boilerplate' })
40+
await ui.userSelectsApp({
41+
actorsEnvironment,
42+
stepUser: 'Admin',
43+
app: 'Development boilerplate'
44+
})
4145

4246
// Then "Admin" should see the app details of "Development boilerplate"
43-
await ui.waitForAppDetailsIsVisible({
47+
await ui.userShouldSeeAppDetails({
4448
actorsEnvironment,
4549
stepUser: 'Admin',
4650
app: 'Development boilerplate'
4751
})
4852

4953
// And "Admin" downloads app version "0.1.0"
50-
const downloadedVersion = await ui.downloadAppVersion({
54+
const downloadedVersion = await ui.userDownloadsAppVersion({
5155
actorsEnvironment,
5256
stepUser: 'Admin',
5357
version: '0.1.0'
5458
})
5559
expect(downloadedVersion).toContain('0.1.0')
5660

5761
// When "Admin" navigates back to the app store overview
58-
await ui.navigateToAppStoreOverview({
62+
await ui.userNavigatesToAppStoreOverview({
5963
actorsEnvironment,
6064
stepUser: 'Admin'
6165
})
6266

6367
// Then "Admin" should see the app store
64-
await ui.waitForAppStoreIsVisible({ actorsEnvironment, stepUser: 'Admin' })
68+
await ui.userShouldSeeAppStore({ actorsEnvironment, stepUser: 'Admin' })
6569

6670
// And "Admin" downloads the latest version of the app "Development boilerplate"
67-
const downloadedApp = await ui.downloadApp({
71+
const downloadedApp = await ui.userDownloadsApp({
6872
actorsEnvironment,
6973
stepUser: 'Admin',
7074
app: 'Development boilerplate'
7175
})
7276
expect(downloadedApp).toBeDefined()
7377

7478
// And "Admin" logs out
75-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Admin' })
79+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Admin' })
7680
})
7781
})

tests/e2e-playwright/specs/app-store/discovery.spec.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,72 +28,77 @@ test.describe('details', { tag: '@predefined-users' }, () => {
2828

2929
test('apps can be searched and downloaded', async () => {
3030
// When "Admin" logs in
31-
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
31+
await ui.userLogsIn({ usersEnvironment, actorsEnvironment, stepUser: 'Admin' })
3232

3333
// And "Admin" navigates to the app store
34-
await ui.openAppStore({ actorsEnvironment, stepUser: 'Admin' })
34+
await ui.userOpensAppStore({ actorsEnvironment, stepUser: 'Admin' })
3535

3636
// Then "Admin" should see the app store
37-
await ui.waitForAppStoreIsVisible({ actorsEnvironment, stepUser: 'Admin' })
37+
await ui.userShouldSeeAppStore({ actorsEnvironment, stepUser: 'Admin' })
3838

3939
// And "Admin" should see the following apps
4040
// | app |
4141
// | Draw.io |
4242
// | JSON Viewer |
4343
// | Unzip |
44-
let apps = await ui.getAppsList({ actorsEnvironment, stepUser: 'Admin' })
44+
let apps = await ui.userShouldSeeApps({ actorsEnvironment, stepUser: 'Admin' })
4545
expect(apps).toContain('Draw.io')
4646
expect(apps).toContain('JSON Viewer')
4747
expect(apps).toContain('Unzip')
4848

4949
// When "Admin" enters the search term "draw"
50-
await ui.setSearchTerm({ actorsEnvironment, stepUser: 'Admin', searchTerm: 'draw' })
50+
await ui.userSetsSearchTerm({ actorsEnvironment, stepUser: 'Admin', searchTerm: 'draw' })
5151

5252
// Then "Admin" should see the following apps
5353
// | app |
5454
// | Draw.io |
5555
apps = []
56-
apps = await ui.getAppsList({ actorsEnvironment, stepUser: 'Admin' })
56+
apps = await ui.userShouldSeeApps({ actorsEnvironment, stepUser: 'Admin' })
5757
expect(apps).toContain('Draw.io')
5858

5959
// When "Admin" clicks on the tag "viewer" of the app "Draw.io"
60-
await ui.selectAppTag({ actorsEnvironment, stepUser: 'Admin', tag: 'viewer', app: 'Draw.io' })
60+
await ui.userSelectsAppTag({
61+
actorsEnvironment,
62+
stepUser: 'Admin',
63+
tag: 'viewer',
64+
app: 'Draw.io'
65+
})
6166

6267
// Then "Admin" should see the following apps
6368
// | app |
6469
// | JSON Viewer |
6570
// | Draw.io |
6671
apps = []
67-
apps = await ui.getAppsList({ actorsEnvironment, stepUser: 'Admin' })
72+
apps = await ui.userShouldSeeApps({ actorsEnvironment, stepUser: 'Admin' })
6873
expect(apps).toContain('Draw.io')
6974
expect(apps).toContain('JSON Viewer')
7075

7176
// When "Admin" clicks on the app "JSON Viewer"
72-
await ui.selectApp({ actorsEnvironment, stepUser: 'Admin', app: 'JSON Viewer' })
77+
await ui.userSelectsApp({ actorsEnvironment, stepUser: 'Admin', app: 'JSON Viewer' })
7378

7479
// Then "Admin" should see the app details of "JSON Viewer"
75-
await ui.waitForAppDetailsIsVisible({
80+
await ui.userShouldSeeAppDetails({
7681
actorsEnvironment,
7782
stepUser: 'Admin',
7883
app: 'JSON Viewer'
7984
})
8085

8186
// When "Admin" clicks on the tag "viewer"
82-
await ui.selectTag({ actorsEnvironment, stepUser: 'Admin', tag: 'viewer' })
87+
await ui.userSelectsTag({ actorsEnvironment, stepUser: 'Admin', tag: 'viewer' })
8388

8489
// Then "Admin" should see the app store
85-
await ui.waitForAppStoreIsVisible({ actorsEnvironment, stepUser: 'Admin' })
90+
await ui.userShouldSeeAppStore({ actorsEnvironment, stepUser: 'Admin' })
8691

8792
// Then "Admin" should see the following apps
8893
// | app |
8994
// | JSON Viewer |
9095
// | Draw.io |
9196
apps = []
92-
apps = await ui.getAppsList({ actorsEnvironment, stepUser: 'Admin' })
97+
apps = await ui.userShouldSeeApps({ actorsEnvironment, stepUser: 'Admin' })
9398
expect(apps).toContain('Draw.io')
9499
expect(apps).toContain('JSON Viewer')
95100

96101
// And "Admin" logs out
97-
await ui.logOutUser({ actorsEnvironment, stepUser: 'Admin' })
102+
await ui.userLogsOut({ actorsEnvironment, stepUser: 'Admin' })
98103
})
99104
})

0 commit comments

Comments
 (0)