5
5
6
6
/// <reference types="cypress" />
7
7
8
- import { setTimeFilter , SPAN_ID , TRACE_ID , SPAN_ID_TREE_VIEW } from '../../utils/constants' ;
8
+ import { setTimeFilter , SPAN_ID , TRACE_ID , SPAN_ID_TREE_VIEW , INVALID_URL } from '../../utils/constants' ;
9
9
10
10
describe ( 'Testing traces table empty state' , ( ) => {
11
11
beforeEach ( ( ) => {
@@ -124,6 +124,32 @@ describe('Testing trace view', () => {
124
124
} ) ;
125
125
} ) ;
126
126
127
+ describe ( 'Testing trace view invalid url' , ( ) => {
128
+ beforeEach ( ( ) => {
129
+ cy . visit ( `app/observability-traces#/traces?traceId=${ INVALID_URL } ` , {
130
+ onBeforeLoad : ( win ) => {
131
+ win . sessionStorage . clear ( ) ;
132
+ } ,
133
+ } ) ;
134
+ } ) ;
135
+
136
+ it ( 'Handles a invalid trace url' , ( ) => {
137
+ cy . get ( '[data-test-subj="globalLoadingIndicator"]' ) . should ( 'not.exist' ) ;
138
+ cy . contains ( `${ INVALID_URL } ` ) . should ( 'exist' ) ;
139
+ cy . get ( '.euiCallOut.euiCallOut--danger' )
140
+ . should ( 'exist' )
141
+ . within ( ( ) => {
142
+ cy . get ( '.euiCallOutHeader__title' )
143
+ . should ( 'contain.text' , `Error loading Trace Id: ${ INVALID_URL } ` ) ;
144
+ cy . get ( 'p' )
145
+ . should (
146
+ 'contain.text' ,
147
+ 'The Trace Id is invalid or could not be found. Please check the URL or try again.'
148
+ ) ;
149
+ } ) ;
150
+ } ) ;
151
+ } ) ;
152
+
127
153
describe ( 'Testing traces table' , ( ) => {
128
154
beforeEach ( ( ) => {
129
155
cy . visit ( 'app/observability-traces#/traces' , {
@@ -137,7 +163,7 @@ describe('Testing traces table', () => {
137
163
} ) ;
138
164
139
165
it ( 'Renders the traces table and verify Table Column, Pagination and Rows Data ' , ( ) => {
140
- cy . get ( '.euiTableCellContent__text' ) . contains ( 'Trace ID ' ) . should ( 'exist' ) ;
166
+ cy . get ( '.euiTableCellContent__text' ) . contains ( 'Trace Id ' ) . should ( 'exist' ) ;
141
167
cy . get ( '.euiTableCellContent__text' ) . contains ( 'Trace group' ) . should ( 'exist' ) ;
142
168
cy . get ( '.euiTableCellContent__text' ) . contains ( 'Duration (ms)' ) . should ( 'exist' ) ;
143
169
cy . get ( '.euiTableCellContent__text' ) . contains ( 'Percentile in trace group' ) . should ( 'exist' ) ;
@@ -287,7 +313,7 @@ describe('Testing switch mode to jaeger', () => {
287
313
cy . contains ( 'No' ) . should ( 'exist' ) ;
288
314
cy . contains ( '01/24/2023 08:33:35' ) . should ( 'exist' ) ;
289
315
cy . contains ( 'Latency (ms)' ) . should ( 'exist' ) ;
290
- cy . contains ( 'Trace ID ' ) . should ( 'exist' ) ;
316
+ cy . contains ( 'Trace Id ' ) . should ( 'exist' ) ;
291
317
cy . contains ( 'Errors' ) . should ( 'exist' ) ;
292
318
cy . contains ( 'Last updated' ) . should ( 'exist' ) ;
293
319
} ) ;
@@ -372,7 +398,7 @@ describe('Testing traces Custom source', () => {
372
398
cy . get ( '.euiSelectableListItem' ) . contains ( 'Traces' ) . click ( ) ;
373
399
cy . get ( '[data-test-subj="globalLoadingIndicator"]' ) . should ( 'not.exist' ) ;
374
400
375
- cy . get ( '.euiDataGridHeaderCell__content' ) . contains ( 'Trace ID ' ) . should ( 'exist' ) ;
401
+ cy . get ( '.euiDataGridHeaderCell__content' ) . contains ( 'Trace Id ' ) . should ( 'exist' ) ;
376
402
cy . get ( '.euiDataGridHeaderCell__content' ) . contains ( 'Trace group' ) . should ( 'exist' ) ;
377
403
cy . get ( '.euiDataGridHeaderCell__content' ) . contains ( 'Duration (ms)' ) . should ( 'exist' ) ;
378
404
cy . get ( '.euiDataGridHeaderCell__content' ) . contains ( 'Percentile in trace group' ) . should ( 'exist' ) ;
0 commit comments