2024-05-31 11:01:10 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/ *  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   Copyright  2024  Collate . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   Licensed  under  the  Apache  License ,  Version  2.0  ( the  "License" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   you  may  not  use  this  file  except  in  compliance  with  the  License . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   You  may  obtain  a  copy  of  the  License  at 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   http : //www.apache.org/licenses/LICENSE-2.0
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   Unless  required  by  applicable  law  or  agreed  to  in  writing ,  software 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   distributed  under  the  License  is  distributed  on  an  "AS IS"  BASIS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   WITHOUT  WARRANTIES  OR  CONDITIONS  OF  ANY  KIND ,  either  express  or  implied . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   See  the  License  for  the  specific  language  governing  permissions  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   limitations  under  the  License . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * / 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-10 11:41:48 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Browser ,  expect ,  Page ,  request  }  from  '@playwright/test' ;  
						 
					
						
							
								
									
										
										
										
											2024-05-31 11:01:10 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  {  randomUUID  }  from  'crypto' ;  
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  SidebarItem  }  from  '../constant/sidebar' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  {  adjectives ,  nouns  }  from  '../constant/user' ;  
						 
					
						
							
								
									
										
										
										
											2024-08-21 21:51:32 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Domain  }  from  '../support/domain/Domain' ;  
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  sidebarClick  }  from  './sidebar' ;  
						 
					
						
							
								
									
										
										
										
											2024-05-31 11:01:10 +05:30 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  uuid  =  ( )  = >  randomUUID ( ) . split ( '-' ) [ 0 ] ;  
						 
					
						
							
								
									
										
										
										
											2024-06-01 22:18:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-27 20:57:37 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  descriptionBox  =  '.om-block-editor[contenteditable="true"]' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  descriptionBoxReadOnly  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  '.om-block-editor[contenteditable="false"]' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-24 17:41:28 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  INVALID_NAMES  =  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  MAX_LENGTH : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    'a87439625b1c2d3e4f5061728394a5b6c7d8e90a1b2c3d4e5f67890aba87439625b1c2d3e4f5061728394a5b6c7d8e90a1b2c3d4e5f67890abName can be a maximum of 128 characters' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  WITH_SPECIAL_CHARS :  '::normalName::' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  NAME_VALIDATION_ERROR  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  'Name must contain only letters, numbers, underscores, hyphens, periods, parenthesis, and ampersands.' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  NAME_MIN_MAX_LENGTH_VALIDATION_ERROR  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  'Name size must be between 2 and 64' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  NAME_MAX_LENGTH_VALIDATION_ERROR  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  'Name can be a maximum of 128 characters' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-01 22:18:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  getToken  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  page . evaluate ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ( )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-20 23:31:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      JSON . parse ( localStorage . getItem ( 'om-session' )  ? ?  '{}' ) ? . oidcIdToken  ? ?  '' 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-01 22:18:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  getAuthContext  =  async  ( token : string )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  await  request . newContext ( { 
							 
						 
					
						
							
								
									
										
										
										
											2025-03-15 00:28:25 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    // Default timeout is 30s making it to 1m for AUTs
 
							 
						 
					
						
							
								
									
										
										
										
											2025-03-13 21:24:49 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    timeout : 60000 , 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-01 22:18:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    extraHTTPHeaders :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      Authorization :  ` Bearer  ${ token } ` , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  redirectToHomePage  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . goto ( '/' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . waitForURL ( '**/my-data' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-09-12 23:42:20 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  removeLandingBanner  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  widgetResponse  =  page . waitForResponse ( '/api/v1/search/query?q=**' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . click ( '[data-testid="welcome-screen-close-btn"]' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  widgetResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-01 22:18:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  createNewPage  =  async  ( browser : Browser )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  // create a new page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  page  =  await  browser . newPage ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  redirectToHomePage ( page ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  // get the token from localStorage
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  token  =  await  getToken ( page ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  // create a new context with the token
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  apiContext  =  await  getAuthContext ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  afterAction  =  async  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    await  apiContext . dispose ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    await  page . close ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  {  page ,  apiContext ,  afterAction  } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-06-14 11:55:59 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/ * *  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Retrieves  the  API  context  for  the  given  page . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @param  page  The  Playwright  page  object . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @returns  An  object  containing  the  API  context  and  a  cleanup  function . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  getApiContext  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  token  =  await  getToken ( page ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  apiContext  =  await  getAuthContext ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  afterAction  =  async  ( )  = >  await  apiContext . dispose ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  {  apiContext ,  afterAction  } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-06-24 17:41:28 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-27 15:32:58 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  getEntityTypeSearchIndexMapping  =  ( entityType : string )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  entityMapping  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Table :  'table_search_index' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Topic :  'topic_search_index' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Dashboard :  'dashboard_search_index' , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-01 20:16:54 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Pipeline :  'pipeline_search_index' , 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-27 15:32:58 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    MlModel :  'mlmodel_search_index' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Container :  'container_search_index' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SearchIndex :  'search_entity_search_index' , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-26 14:31:17 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ApiEndpoint :  'api_endpoint_search_index' , 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-15 23:06:31 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Metric :  'metric_search_index' , 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-27 15:32:58 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-05 17:53:14 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  return  entityMapping [ entityType  as  keyof  typeof  entityMapping ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-27 15:32:58 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-10 11:41:48 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  toastNotification  =  async  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  page : Page , 
							 
						 
					
						
							
								
									
										
										
										
											2024-11-27 16:43:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  message : string  |  RegExp 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-10 11:41:48 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								)  = >  {  
						 
					
						
							
								
									
										
										
										
											2025-02-03 10:18:16 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  expect ( page . getByTestId ( 'alert-bar' ) ) . toHaveText ( message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  expect ( page . getByTestId ( 'alert-icon' ) ) . toBeVisible ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  expect ( page . getByTestId ( 'alert-icon-close' ) ) . toBeVisible ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-10 11:41:48 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-09 17:49:10 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  clickOutside  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . locator ( 'body' ) . click ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    position :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      x : 0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      y : 0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ;  // with this action left menu bar is getting opened
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . mouse . move ( 1280 ,  0 ) ;  // moving out side left menu bar to avoid random failure due to left menu bar
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-07-15 15:37:41 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 10:43:33 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  visitOwnProfilePage  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
									
										
										
										
											2024-07-31 15:24:17 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page . locator ( '[data-testid="dropdown-profile"] svg' ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-22 12:45:07 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page . waitForSelector ( '[role="menu"].profile-dropdown' ,  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-15 15:37:41 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    state :  'visible' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  userResponse  =  page . waitForResponse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    '/api/v1/users/name/*?fields=*&include=all' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-31 15:24:17 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page . getByTestId ( 'user-name' ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-15 15:37:41 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  userResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  clickOutside ( page ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  assignDomain  =  async  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  page : Page , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  domain :  {  name : string ;  displayName : string ;  fullyQualifiedName? : string  } 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								)  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByTestId ( 'add-domain' ) . click ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . waitForSelector ( '[data-testid="loader"]' ,  {  state :  'detached'  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-13 18:43:03 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  const  searchDomain  =  page . waitForResponse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ` /api/v1/search/query?q=* ${ encodeURIComponent ( domain . name ) } * ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    . getByTestId ( 'domain-selectable-tree' ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    . getByTestId ( 'searchbar' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    . fill ( domain . name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-13 18:43:03 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  searchDomain ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByTestId ( ` tag- ${ domain . fullyQualifiedName } ` ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  expect ( page . getByTestId ( 'domain-link' ) ) . toContainText ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    domain . displayName 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  updateDomain  =  async  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  page : Page , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  domain :  {  name : string ;  displayName : string ;  fullyQualifiedName? : string  } 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								)  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByTestId ( 'add-domain' ) . click ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . waitForSelector ( '[data-testid="loader"]' ,  {  state :  'detached'  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    . getByTestId ( 'domain-selectable-tree' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    . getByTestId ( 'searchbar' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-13 18:43:03 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  const  searchDomain  =  page . waitForResponse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ` /api/v1/search/query?q=* ${ encodeURIComponent ( domain . name ) } * ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    . getByTestId ( 'domain-selectable-tree' ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    . getByTestId ( 'searchbar' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    . fill ( domain . name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-13 18:43:03 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  searchDomain ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByTestId ( ` tag- ${ domain . fullyQualifiedName } ` ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  expect ( page . getByTestId ( 'domain-link' ) ) . toContainText ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    domain . displayName 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  removeDomain  =  async  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  page : Page , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  domain :  {  name : string ;  displayName : string ;  fullyQualifiedName? : string  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								)  = >  {  
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page . getByTestId ( 'add-domain' ) . click ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . waitForSelector ( '[data-testid="loader"]' ,  {  state :  'detached'  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-27 15:43:42 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page . getByTestId ( ` tag- ${ domain . fullyQualifiedName } ` ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  expect ( page . getByTestId ( 'no-domain-text' ) ) . toContainText ( 'No Domain' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  visitGlossaryPage  =  async  ( page : Page ,  glossaryName : string )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  redirectToHomePage ( page ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  glossaryResponse  =  page . waitForResponse ( '/api/v1/glossaries?fields=*' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  sidebarClick ( page ,  SidebarItem . GLOSSARY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  glossaryResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByRole ( 'menuitem' ,  {  name : glossaryName  } ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-03-26 01:49:12 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  await  page . waitForLoadState ( 'networkidle' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . waitForSelector ( '[data-testid="loader"]' ,  {  state :  'detached'  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  getRandomFirstName  =  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  ` ${ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    adjectives [ Math . floor ( Math . random ( )  *  adjectives . length ) ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } $ { uuid ( ) } ` ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  getRandomLastName  =  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  ` ${ nouns [ Math . floor ( Math . random ( )  *  nouns . length ) ] } ${ uuid ( ) } ` ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-28 04:42:27 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  const  generateRandomUsername  =  ( prefix  =  '' )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  firstName  =  ` ${ prefix } ${ getRandomFirstName ( ) } ` ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  lastName  =  ` ${ prefix } ${ getRandomLastName ( ) } ` ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-30 15:05:56 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    firstName , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    lastName , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    email :  ` ${ firstName } . ${ lastName } @example.com ` , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    password :  'User@OMD123' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-08-21 21:51:32 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  verifyDomainPropagation  =  async  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  page : Page , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  domain : Domain [ 'responseData' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  childFqnSearchTerm : string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								)  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByTestId ( 'searchBox' ) . fill ( childFqnSearchTerm ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  page . getByTestId ( 'searchBox' ) . press ( 'Enter' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  await  expect ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    page 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      . getByTestId ( ` table-data-card_ ${ childFqnSearchTerm } ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      . getByTestId ( 'domain-link' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) . toContainText ( domain . displayName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-08-31 16:35:26 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  replaceAllSpacialCharWith_  =  ( text : string )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  text . replaceAll ( /[&/\\#, +()$~%.'":*?<>{}]/g ,  '_' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2024-12-05 17:53:14 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// Since the tests run in parallel sometimes the error toast alert pops up
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// Stating the domain or glossary does not exist since it's deleted in other test
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// This error toast blocks the buttons at the top
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// Below logic closes the alert if it's present to avoid flakiness in tests
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								export  const  closeFirstPopupAlert  =  async  ( page : Page )  = >  {  
						 
					
						
							
								
									
										
										
										
											2025-02-03 10:18:16 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  const  toastElement  =  page . getByTestId ( 'alert-bar' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  if  ( ( await  toastElement . count ( ) )  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    await  page . getByTestId ( 'alert-icon-close' ) . first ( ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-05 17:53:14 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;