@@ -144,16 +144,16 @@ test('should render console', async ({ showTraceViewer, browserName }) => {
144
144
await expect ( traceViewer . consoleLineMessages . nth ( 1 ) ) . toHaveText ( 'Warning' ) ;
145
145
await expect ( traceViewer . consoleLineMessages . nth ( 2 ) ) . toHaveText ( 'Error' ) ;
146
146
await expect ( traceViewer . consoleLineMessages . nth ( 3 ) ) . toHaveText ( 'Unhandled exception' ) ;
147
- // Firefox can insert layout error here .
148
- await expect ( traceViewer . consoleLineMessages . last ( ) ) . toHaveText ( 'Cheers!' ) ;
147
+ // Browsers can insert more messages between these two .
148
+ await expect ( traceViewer . consoleLineMessages . filter ( { hasText : 'Cheers!' } ) ) . toBeVisible ( ) ;
149
149
150
150
const icons = traceViewer . consoleLines . locator ( '.codicon' ) ;
151
151
await expect . soft ( icons . nth ( 0 ) ) . toHaveClass ( 'codicon codicon-browser status-none' ) ;
152
152
await expect . soft ( icons . nth ( 1 ) ) . toHaveClass ( 'codicon codicon-browser status-warning' ) ;
153
153
await expect . soft ( icons . nth ( 2 ) ) . toHaveClass ( 'codicon codicon-browser status-error' ) ;
154
154
await expect . soft ( icons . nth ( 3 ) ) . toHaveClass ( 'codicon codicon-browser status-error' ) ;
155
- // Firefox can insert layout error here .
156
- await expect . soft ( icons . last ( ) ) . toHaveClass ( 'codicon codicon-browser status-none' ) ;
155
+ // Browsers can insert more messages between these two .
156
+ await expect . soft ( traceViewer . consoleLines . filter ( { hasText : 'Cheers!' } ) . locator ( '.codicon' ) ) . toHaveClass ( 'codicon codicon-browser status-none' ) ;
157
157
await expect ( traceViewer . consoleStacks . first ( ) ) . toContainText ( 'Error: Unhandled exception' ) ;
158
158
159
159
await traceViewer . selectAction ( 'page.evaluate' ) ;
@@ -163,8 +163,8 @@ test('should render console', async ({ showTraceViewer, browserName }) => {
163
163
await expect ( listViews . nth ( 1 ) ) . toHaveClass ( 'list-view-entry warning' ) ;
164
164
await expect ( listViews . nth ( 2 ) ) . toHaveClass ( 'list-view-entry error' ) ;
165
165
await expect ( listViews . nth ( 3 ) ) . toHaveClass ( 'list-view-entry error' ) ;
166
- // Firefox can insert layout error here .
167
- await expect ( listViews . last ( ) ) . toHaveClass ( 'list-view-entry' ) ;
166
+ // Browsers can insert more messages between these two .
167
+ await expect ( listViews . filter ( { hasText : 'Cheers!' } ) ) . toHaveClass ( 'list-view-entry' ) ;
168
168
} ) ;
169
169
170
170
test ( 'should open console errors on click' , async ( { showTraceViewer, browserName } ) => {
0 commit comments