@@ -147,25 +147,12 @@ describe('Check workspace permissions for Viewer, Editor & Validator', () => {
147147 stub . stop ( ) ;
148148 } ) ;
149149
150- it ( 'Check Viewer permissions ' , ( ) => {
150+ it ( 'must show a disabled button when role is Viewer ' , ( ) => {
151151 const scenario = SHARED_SCENARIOS_LIST [ 0 ] ;
152152 ScenarioSelector . selectScenario ( scenario . name , scenario . id , true ) ;
153153
154154 Scenarios . getScenarioValidateButton ( ) . should ( 'not.exist' ) ;
155- RolesEdition . getShareButton ( ) . should ( 'be.visible' ) . should ( 'not.be.disabled' ) . click ( ) ;
156- RolesEdition . getShareDialogAgentsSelect ( ) . should ( 'not.exist' ) ;
157- RolesEdition . getRoleEditorAgentName ( USERS_LIST [ 1 ] . email ) . should ( 'have.text' , USERS_LIST [ 1 ] . email ) ;
158- RolesEdition . getSelectedOptionByAgent ( USERS_LIST [ 1 ] . email ) . should ( 'value' , ROLES . SCENARIO . VIEWER ) ;
159- RolesEdition . isRoleEditorSelectorDisabled ( USERS_LIST [ 1 ] . email ) . should ( 'eq' , 'true' ) ;
160- RolesEdition . getRoleEditorAgentName ( USERS_LIST [ 2 ] . email ) . should ( 'have.text' , USERS_LIST [ 2 ] . email ) ;
161- RolesEdition . getSelectedOptionByAgent ( USERS_LIST [ 2 ] . email ) . should ( 'value' , ROLES . SCENARIO . EDITOR ) ;
162- RolesEdition . isRoleEditorSelectorDisabled ( USERS_LIST [ 2 ] . email ) . should ( 'eq' , 'true' ) ;
163- RolesEdition . getRoleEditorAgentName ( USERS_LIST [ 3 ] . email ) . should ( 'have.text' , USERS_LIST [ 3 ] . email ) ;
164- RolesEdition . getSelectedOptionByAgent ( USERS_LIST [ 3 ] . email ) . should ( 'value' , ROLES . SCENARIO . VALIDATOR ) ;
165- RolesEdition . isRoleEditorSelectorDisabled ( USERS_LIST [ 3 ] . email ) . should ( 'eq' , 'true' ) ;
166- RolesEdition . isRoleEditorSelectorDisabled ( 'Workspace' ) . should ( 'eq' , 'true' ) ;
167- RolesEdition . getShareDialogConfirmAddAccessButton ( ) . should ( 'not.exist' ) ;
168- RolesEdition . getShareDialogFirstCancelButton ( ) . click ( ) ;
155+ RolesEdition . getShareButton ( ) . should ( 'be.visible' ) . should ( 'be.disabled' ) ;
169156
170157 Scenarios . getScenarioValidateButton ( ) . should ( 'not.exist' ) ;
171158 Scenarios . getScenarioRejectButton ( ) . should ( 'not.exist' ) ;
@@ -186,6 +173,21 @@ describe('Check workspace permissions for Viewer, Editor & Validator', () => {
186173 const scenario = SHARED_SCENARIOS_LIST [ 1 ] ;
187174 ScenarioSelector . selectScenario ( scenario . name , scenario . id ) ;
188175
176+ RolesEdition . getShareButton ( ) . should ( 'be.visible' ) . should ( 'not.be.disabled' ) . click ( ) ;
177+ RolesEdition . getShareDialogAgentsSelect ( ) . should ( 'not.exist' ) ;
178+ RolesEdition . getRoleEditorAgentName ( USERS_LIST [ 1 ] . email ) . should ( 'have.text' , USERS_LIST [ 1 ] . email ) ;
179+ RolesEdition . getSelectedOptionByAgent ( USERS_LIST [ 1 ] . email ) . should ( 'value' , ROLES . SCENARIO . VIEWER ) ;
180+ RolesEdition . isRoleEditorSelectorDisabled ( USERS_LIST [ 1 ] . email ) . should ( 'eq' , 'true' ) ;
181+ RolesEdition . getRoleEditorAgentName ( USERS_LIST [ 2 ] . email ) . should ( 'have.text' , USERS_LIST [ 2 ] . email ) ;
182+ RolesEdition . getSelectedOptionByAgent ( USERS_LIST [ 2 ] . email ) . should ( 'value' , ROLES . SCENARIO . EDITOR ) ;
183+ RolesEdition . isRoleEditorSelectorDisabled ( USERS_LIST [ 2 ] . email ) . should ( 'eq' , 'true' ) ;
184+ RolesEdition . getRoleEditorAgentName ( USERS_LIST [ 3 ] . email ) . should ( 'have.text' , USERS_LIST [ 3 ] . email ) ;
185+ RolesEdition . getSelectedOptionByAgent ( USERS_LIST [ 3 ] . email ) . should ( 'value' , ROLES . SCENARIO . VALIDATOR ) ;
186+ RolesEdition . isRoleEditorSelectorDisabled ( USERS_LIST [ 3 ] . email ) . should ( 'eq' , 'true' ) ;
187+ RolesEdition . isRoleEditorSelectorDisabled ( 'Workspace' ) . should ( 'eq' , 'true' ) ;
188+ RolesEdition . getShareDialogConfirmAddAccessButton ( ) . should ( 'not.exist' ) ;
189+ RolesEdition . getShareDialogFirstCancelButton ( ) . click ( ) ;
190+
189191 Scenarios . getScenarioValidateButton ( ) . should ( 'not.exist' ) ;
190192 Scenarios . getScenarioRejectButton ( ) . should ( 'not.exist' ) ;
191193 ScenarioParameters . getLaunchButton ( ) . should ( 'be.visible' ) . should ( 'not.be.disabled' ) ;
0 commit comments