1- import { expect } from '@playwright/test'
21import { test } from '../../support/test'
3- import { config } from '../../../e2e/config.js'
4- import { ActorsEnvironment , UsersEnvironment } from '../../../e2e/support/environment/index.js'
5- import { setAccessAndRefreshToken } from '../../helpers/setAccessAndRefreshToken.js'
62import * as api from '../../steps/api/api.js'
73import * as ui from '../../steps/ui/index'
84
95// For synchronization-related details, see https://owncloud.dev/services/proxy/#claim-updates
106test . describe ( 'groups management' , ( ) => {
11- let actorsEnvironment
12- const usersEnvironment = new UsersEnvironment ( )
13-
14- test . beforeEach ( async ( { browser } ) => {
15- actorsEnvironment = new ActorsEnvironment ( {
16- context : {
17- acceptDownloads : config . acceptDownloads ,
18- reportDir : config . reportDir ,
19- tracingReportDir : config . tracingReportDir ,
20- reportHar : config . reportHar ,
21- reportTracing : config . reportTracing ,
22- reportVideo : config . reportVideo ,
23- failOnUncaughtConsoleError : config . failOnUncaughtConsoleError
24- } ,
25- browser : browser
26- } )
27-
28- await setAccessAndRefreshToken ( usersEnvironment )
29- } )
30-
317 test ( 'keycloak group sync with oCIS' , async ( { world } ) => {
328 // Given "Admin" creates following user using API
339 // | id |
@@ -76,13 +52,11 @@ test.describe('groups management', () => {
7652 // | security |
7753 // | keycloak sales |
7854 // | keycloak finance |
79- expect (
80- await ui . checkGroupsPresenceById ( {
81- world,
82- stepUser : 'Admin' ,
83- expectedGroupIds : [ 'security' , 'keycloak sales' , 'keycloak finance' ]
84- } )
85- ) . toBeTruthy ( )
55+ await ui . userShouldSeeGroupIds ( {
56+ world,
57+ stepUser : 'Admin' ,
58+ expectedGroupIds : [ 'security' , 'keycloak sales' , 'keycloak finance' ]
59+ } )
8660
8761 // When "Admin" navigates to the users management page
8862 await ui . userNavigatesToUserManagementPage ( { world, stepUser : 'Admin' } )
@@ -113,14 +87,14 @@ test.describe('groups management', () => {
11387 resource : 'shareToSales.txt' ,
11488 recipient : 'keycloak sales' ,
11589 type : 'group' ,
116- role : 'Can edit without versions ' ,
90+ role : 'Can edit with trashbin ' ,
11791 resourceType : 'file'
11892 } ,
11993 {
12094 resource : 'shareToSecurity.txt' ,
12195 recipient : 'security' ,
12296 type : 'group' ,
123- role : 'Can edit without versions ' ,
97+ role : 'Can edit with trashbin ' ,
12498 resourceType : 'file'
12599 }
126100 ]
@@ -138,22 +112,26 @@ test.describe('groups management', () => {
138112 // When "Brian" opens the following file in texteditor
139113 // | resource |
140114 // | shareToSales.txt |
141- await ui . userOpensFileInViewer ( {
115+ await ui . userOpensResourceInViewer ( {
142116 world,
143117 stepUser : 'Brian' ,
144118 resource : 'shareToSales.txt' ,
145- actionType : 'texteditor'
119+ application : 'texteditor'
146120 } )
147121 // And "Brian" closes the file viewer
148122 await ui . userClosesFileViewer ( { world, stepUser : 'Brian' } )
149123 // And "Brian" edits the following resources
150124 // | resource | content |
151125 // | shareToSecurity.txt | new content |
152- await ui . userEditsFile ( {
126+ await ui . userEditsResources ( {
153127 world,
154128 stepUser : 'Brian' ,
155- resource : 'shareToSecurity.txt' ,
156- content : 'new content'
129+ resources : [
130+ {
131+ name : 'shareToSecurity.txt' ,
132+ content : 'new content'
133+ }
134+ ]
157135 } )
158136 // And "Brian" logs out
159137 await ui . userLogsOut ( { world, stepUser : 'Brian' } )
@@ -170,33 +148,32 @@ test.describe('groups management', () => {
170148 // Renaming a Keycloak group results in the creation of a new group on the oCIS server (see https://github.com/owncloud/ocis/issues/10445).
171149 // After renaming a group, it may take up to 5 minutes for the changes to sync, so avoid using the renamed group in the subsequent steps.
172150 // And "Admin" changes displayName to "a renamed group" for group "keycloak finance" using the sidebar panel
173- await ui . userRenamesGroup ( {
151+ await ui . userChangesGroup ( {
174152 world,
175153 stepUser : 'Admin' ,
176154 attribute : 'displayName' ,
155+ key : 'keycloak finance' ,
177156 value : 'a renamed group' ,
178- user : 'keycloak finance '
157+ action : 'context-menu '
179158 } )
180159
181160 // When "Admin" deletes the following group using the context menu
182161 // | group |
183162 // | sales |
184- await ui . userDeletesGroup ( {
163+ await ui . userDeletesGroups ( {
185164 world,
186165 stepUser : 'Admin' ,
187166 actionType : 'context menu' ,
188- group : 'sales'
167+ groupsToBeDeleted : [ 'sales' ]
189168 } )
190169 // Then "Admin" should not see the following group
191170 // | group |
192171 // | sales |
193- expect (
194- await ui . checkGroupsPresenceById ( {
195- world,
196- stepUser : 'Admin' ,
197- expectedGroupIds : [ 'sales' ]
198- } )
199- ) . toBeFalsy ( )
172+ await ui . userShouldNotSeeGroupIds ( {
173+ world,
174+ stepUser : 'Admin' ,
175+ expectedGroupIds : [ 'sales' ]
176+ } )
200177 // And "Admin" logs out
201178 await ui . userLogsOut ( { world, stepUser : 'Admin' } )
202179 } )
0 commit comments