@@ -57,74 +57,73 @@ class TraceViewerPage {
5757 this . actionTitles = page . locator ( '.action-title' ) ;
5858 this . actionsTree = page . getByTestId ( 'actions-tree' ) ;
5959 this . callLines = page . locator ( '.call-tab .call-line' ) ;
60- this . logLines = page . getByTestId ( 'log- list') . locator ( '.list-view-entry ') ;
61- this . consoleLines = page . locator ( '.console-line ') ;
60+ this . logLines = page . getByRole ( ' list', { name : 'Log entries' } ) . getByRole ( 'listitem ') ;
61+ this . consoleLines = page . getByRole ( 'tabpanel' , { name : 'Console' } ) . getByRole ( 'listitem ') ;
6262 this . consoleLineMessages = page . locator ( '.console-line-message' ) ;
6363 this . errorMessages = page . locator ( '.error-message' ) ;
6464 this . consoleStacks = page . locator ( '.console-stack' ) ;
65- this . stackFrames = page . getByTestId ( 'stack-trace- list') . locator ( '.list-view-entry ') ;
66- this . networkRequests = page . getByTestId ( 'network- list') . locator ( '.list-view-entry ') ;
65+ this . stackFrames = page . getByRole ( ' list', { name : 'Stack trace' } ) . getByRole ( 'listitem ') ;
66+ this . networkRequests = page . getByRole ( ' list', { name : 'Network requests' } ) . getByRole ( 'listitem ') ;
6767 this . snapshotContainer = page . locator ( '.snapshot-container iframe.snapshot-visible[name=snapshot]' ) ;
68- this . metadataTab = page . getByTestId ( 'metadata-view' ) ;
69- this . sourceCodeTab = page . getByTestId ( 'source-code' ) ;
68+ this . metadataTab = page . getByRole ( 'tabpanel' , { name : 'Metadata' } ) ;
69+ this . sourceCodeTab = page . getByRole ( 'tabpanel' , { name : 'Source' } ) ;
7070
7171 this . settingsDialog = page . getByTestId ( 'settings-toolbar-dialog' ) ;
7272 this . darkModeSetting = page . locator ( '.setting' ) . getByText ( 'Dark mode' ) ;
7373 this . displayCanvasContentSetting = page . locator ( '.setting' ) . getByText ( 'Display canvas content' ) ;
7474 }
7575
76- async actionIconsText ( action : string ) {
77- const entry = await this . page . waitForSelector ( `.tree-view-entry:has-text("${ action } ")` ) ;
78- await entry . waitForSelector ( '.action-icon-value:visible' ) ;
79- return await entry . $$eval ( '.action-icon-value:visible' , ee => ee . map ( e => e . textContent ) ) ;
76+ actionIconsText ( action : string ) {
77+ const entry = this . actionsTree . getByRole ( 'treeitem' , { name : action } ) ;
78+ return entry . locator ( '.action-icon-value' ) . filter ( { visible : true } ) ;
8079 }
8180
82- async actionIcons ( action : string ) {
83- return await this . page . waitForSelector ( `.tree-view-entry:has-text(" ${ action } ") . action-icons` ) ;
81+ actionIcons ( action : string ) {
82+ return this . actionsTree . getByRole ( 'treeitem' , { name : action } ) . locator ( '. action-icons' ) . filter ( { visible : true } ) ;
8483 }
8584
8685 @step
87- async expandAction ( title : string , ordinal : number = 0 ) {
88- await this . actionsTree . locator ( '.tree-view-entry ', { hasText : title } ) . nth ( ordinal ) . locator ( '.codicon-chevron-right' ) . click ( ) ;
86+ async expandAction ( title : string ) {
87+ await this . actionsTree . getByRole ( 'treeitem ', { name : title } ) . locator ( '.codicon-chevron-right' ) . click ( ) ;
8988 }
9089
9190 @step
9291 async selectAction ( title : string , ordinal : number = 0 ) {
93- await this . page . locator ( `.action- title:has-text(" ${ title } ")` ) . nth ( ordinal ) . click ( ) ;
92+ await this . actionsTree . getByTitle ( title ) . nth ( ordinal ) . click ( ) ;
9493 }
9594
9695 @step
9796 async hoverAction ( title : string , ordinal : number = 0 ) {
98- await this . page . locator ( `.action-title:has-text(" ${ title } ")` ) . nth ( ordinal ) . hover ( ) ;
97+ await this . actionTitles . filter ( { hasText : title } ) . nth ( ordinal ) . hover ( ) ;
9998 }
10099
101100 @step
102101 async selectSnapshot ( name : string ) {
103- await this . page . click ( `.snapshot- tab .tabbed-pane-tab-label:has-text(" ${ name } ")` ) ;
102+ await this . page . getByRole ( ' tab' , { name } ) . click ( ) ;
104103 }
105104
106105 async showErrorsTab ( ) {
107- await this . page . click ( 'text=" Errors"' ) ;
106+ await this . page . getByRole ( 'tab' , { name : ' Errors' } ) . click ( ) ;
108107 }
109108
110109 async showConsoleTab ( ) {
111- await this . page . click ( 'text=" Console"' ) ;
110+ await this . page . getByRole ( 'tab' , { name : ' Console' } ) . click ( ) ;
112111 }
113112
114113 async showSourceTab ( ) {
115- await this . page . click ( 'text=" Source"' ) ;
114+ await this . page . getByRole ( 'tab' , { name : ' Source' } ) . click ( ) ;
116115 }
117116
118117 async showNetworkTab ( ) {
119- await this . page . click ( 'text=" Network"' ) ;
118+ await this . page . getByRole ( 'tab' , { name : ' Network' } ) . click ( ) ;
120119 }
121120
122121 async showMetadataTab ( ) {
123- await this . page . click ( 'text=" Metadata"' ) ;
122+ await this . page . getByRole ( 'tab' , { name : ' Metadata' } ) . click ( ) ;
124123 }
125124
126125 async showSettings ( ) {
127- await this . page . locator ( '.settings-gear' ) . click ( ) ;
126+ await this . page . getByRole ( 'button' , { name : 'Settings' } ) . click ( ) ;
128127 }
129128
130129 @step
0 commit comments