@@ -10,20 +10,20 @@ import { mockBFFResponse } from '~/__mocks__/utils';
1010// Helper function to validate the content of a single workspace row in the table
1111const validateWorkspaceRow = ( workspace : any , index : number ) => {
1212 // Validate the workspace name
13- cy . getDataTest ( `workspace-row-${ index } ` )
14- . find ( '[data-test ="workspace-name"]' )
13+ cy . findByTestId ( `workspace-row-${ index } ` )
14+ . find ( '[data-testid ="workspace-name"]' )
1515 . should ( 'have.text' , workspace . name ) ;
1616
1717 // Map workspace state to the expected label
1818 const expectedLabel = WorkspaceState [ workspace . status . state ] ;
1919
2020 // Validate the state label and pod configuration
21- cy . getDataTest ( `workspace-row-${ index } ` )
22- . find ( '[data-test ="state-label"]' )
21+ cy . findByTestId ( `workspace-row-${ index } ` )
22+ . find ( '[data-testid ="state-label"]' )
2323 . should ( 'have.text' , expectedLabel ) ;
2424
25- cy . getDataTest ( `workspace-row-${ index } ` )
26- . find ( '[data-test ="pod-config"]' )
25+ cy . findByTestId ( `workspace-row-${ index } ` )
26+ . find ( '[data-testid ="pod-config"]' )
2727 . should ( 'have.text' , workspace . options . podConfig ) ;
2828} ;
2929
@@ -38,7 +38,7 @@ describe('Workspaces Tests', () => {
3838 } ) ;
3939
4040 it ( 'should display the correct number of workspaces' , ( ) => {
41- cy . getDataTest ( 'workspaces-table' )
41+ cy . findByTestId ( 'workspaces-table' )
4242 . find ( 'tbody tr' )
4343 . should ( 'have.length' , mockWorkspaces . length ) ;
4444 } ) ;
@@ -54,7 +54,7 @@ describe('Workspaces Tests', () => {
5454 cy . intercept ( 'GET' , '/api/v1/workspaces' , { statusCode : 200 , body : { data : [ ] } } ) ;
5555 cy . visit ( '/' ) ;
5656
57- cy . getDataTest ( 'workspaces-table' ) . find ( 'tbody tr' ) . should ( 'not.exist' ) ;
57+ cy . findByTestId ( 'workspaces-table' ) . find ( 'tbody tr' ) . should ( 'not.exist' ) ;
5858 } ) ;
5959} ) ;
6060
@@ -81,7 +81,7 @@ describe('Workspace by namespace functionality', () => {
8181 it ( 'should update workspaces when namespace changes' , ( ) => {
8282 // Verify initial state (default namespace)
8383 cy . wait ( '@getWorkspaces' ) ;
84- cy . getDataTest ( 'workspaces-table' )
84+ cy . findByTestId ( 'workspaces-table' )
8585 . find ( 'tbody tr' )
8686 . should ( 'have.length' , mockWorkspaces . length ) ;
8787
@@ -95,7 +95,7 @@ describe('Workspace by namespace functionality', () => {
9595 . should ( 'include' , '/api/v1/workspaces/kubeflow' ) ;
9696
9797 // Verify the length of workspaces list is updated
98- cy . getDataTest ( 'workspaces-table' )
98+ cy . findByTestId ( 'workspaces-table' )
9999 . find ( 'tbody tr' )
100100 . should ( 'have.length' , mockWorkspacesByNS . length ) ;
101101 } ) ;
0 commit comments