@@ -27,6 +27,7 @@ import {
2727 ensureUserExists ,
2828 ensureUserInGroup ,
2929 setAppConfig ,
30+ setUserLanguage ,
3031} from '../support/nc-provisioning'
3132import {
3233 createAuthenticatedRequestContext ,
@@ -87,6 +88,7 @@ test('group admin can access policies and start creating delegated rule when cus
8788 await ensureGroupExists ( page . request , GROUP_ID )
8889 await ensureUserInGroup ( page . request , GROUP_ADMIN , GROUP_ID )
8990 await ensureSubadminOfGroup ( page . request , GROUP_ADMIN , GROUP_ID )
91+ await setUserLanguage ( page . request , GROUP_ADMIN , 'en' )
9092
9193 // ── 1. Admin: enable delegated customization at system layer ───────────
9294 await setSystemPolicyEntry ( adminRequestContext , POLICY_KEY , FOOTER_ENABLED_VALUE , true )
@@ -111,38 +113,38 @@ test('group admin can access policies and start creating delegated rule when cus
111113
112114 // ── 4. The editable policy card must be visible in the workbench ──────
113115 const configureButton = page
114- . getByRole ( 'button' , { name : / C o n f i g u r e | C o n f i g u r a r / i } )
116+ . getByRole ( 'button' , { name : / ^ C o n f i g u r e (?: s e t t i n g ) ? $ / i } )
115117 . first ( )
116118 await expect ( configureButton , 'At least one Configure button should be visible for the group admin' ) . toBeVisible ( { timeout : 15000 } )
117119
118120 // ── 5. Open the setting dialog ─────────────────────────────────────────
119121 await configureButton . click ( )
120122
121- const settingDialog = page . getByRole ( 'dialog' , { name : / S i g n a t u r e f o o t e r | S i g n i n g o r d e r | R o d a p e d e a s s i n a t u r a | O r d e m d e a s s i n a t u r a / i } )
123+ const settingDialog = page . getByRole ( 'dialog' , { name : / S i g n a t u r e f o o t e r | S i g n i n g o r d e r / i } )
122124 await expect ( settingDialog , 'Policy dialog should open on click' ) . toBeVisible ( { timeout : 10000 } )
123125
124126 // ── 6. "Create rule" button must be available inside the dialog ───────
125- const createRuleButton = settingDialog . getByRole ( 'button' , { name : / C r e a t e r u l e | C r i a r r e g r a / i } )
127+ const createRuleButton = settingDialog . getByRole ( 'button' , { name : / ^ C r e a t e r u l e $ / i } )
126128 await expect ( createRuleButton , '"Create rule" button should be enabled in the policy dialog' ) . toBeVisible ( { timeout : 10000 } )
127129 await expect ( createRuleButton ) . toBeEnabled ( )
128130
129131 // ── 7. Clicking "Create rule" opens the scope-selector ────────────────
130132 await createRuleButton . click ( )
131133
132134 const createPolicyDialog = page
133- . getByRole ( 'dialog' , { name : / W h a t d o y o u w a n t t o c r e a t e \? | C r e a t e r u l e | O q u e v o c e q u e r c r i a r \? | C r i a r r e g r a / i } )
135+ . getByRole ( 'dialog' , { name : / W h a t d o y o u w a n t t o c r e a t e \? | C r e a t e r u l e / i } )
134136 . last ( )
135137 await expect ( createPolicyDialog , 'Create-policy modal should appear after clicking Create rule' ) . toBeVisible ( { timeout : 10000 } )
136138
137139 await createPolicyDialog . getByRole ( 'option' , { name : / ^ G r o u p / } ) . click ( )
138140
139- const targetGroupsField = page . getByLabel ( / T a r g e t g r o u p s | G r u p o s a l v o / i)
141+ const targetGroupsField = page . getByLabel ( / T a r g e t g r o u p s / i)
140142 await expect ( targetGroupsField ) . toBeVisible ( { timeout : 10000 } )
141- await page . getByPlaceholder ( / S e a r c h g r o u p s | P e s q u i s a r g r u p o s / i) . fill ( GROUP_ID )
143+ await page . getByPlaceholder ( / S e a r c h g r o u p s / i) . fill ( GROUP_ID )
142144 await page . getByRole ( 'option' , { name : GROUP_ID } ) . first ( ) . click ( )
143145
144146 await Promise . any ( [
145147 createPolicyDialog . getByRole ( 'option' , { name : / ^ G r o u p / } ) . waitFor ( { state : 'visible' , timeout : 10000 } ) ,
146- page . getByLabel ( / T a r g e t g r o u p s | G r u p o s a l v o / i) . waitFor ( { state : 'visible' , timeout : 10000 } ) ,
148+ page . getByLabel ( / T a r g e t g r o u p s / i) . waitFor ( { state : 'visible' , timeout : 10000 } ) ,
147149 ] )
148150} )
0 commit comments