@@ -9,6 +9,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat';
99import dayjs from 'dayjs' ;
1010import { BASE_PATH } from '../../../utils/constants' ;
1111import { CURRENT_TENANT } from '../../../utils/commands' ;
12+ import { devToolsRequest } from '../../../utils/helpers' ;
1213
1314dayjs . extend ( customParseFormat ) ;
1415
@@ -20,7 +21,15 @@ const DEFAULT_SIZE = 10;
2021
2122describe ( 'Dump test data' , ( ) => {
2223 it ( 'Indexes test data for gantt chart' , ( ) => {
23- CURRENT_TENANT . newTenant = 'global' ;
24+ if ( Cypress . env ( 'SECURITY_ENABLED' ) ) {
25+ // Set default tenant to private to avoid tenant popup
26+ cy . changeDefaultTenant ( {
27+ multitenancy_enabled : true ,
28+ private_tenant_enabled : true ,
29+ default_tenant : 'private' ,
30+ } ) ;
31+ }
32+ CURRENT_TENANT . newTenant = 'private' ;
2433 const dumpDataSet = ( ndjson , index ) =>
2534 cy . request ( {
2635 method : 'POST' ,
@@ -52,13 +61,11 @@ describe('Dump test data', () => {
5261 } ,
5362 body : JSON . stringify ( { attributes : { title : 'jaeger' } } ) ,
5463 } ) ;
64+ devToolsRequest ( '.kibana*/_refresh' , 'POST' ) ;
5565 } ) ;
5666} ) ;
5767
5868describe ( 'Save a gantt chart' , { defaultCommandTimeout : 20000 } , ( ) => {
59- before ( ( ) => {
60- CURRENT_TENANT . newTenant = 'global' ;
61- } ) ;
6269 beforeEach ( ( ) => {
6370 cy . visit ( `${ BASE_PATH } /app/visualize#` ) ;
6471 } ) ;
@@ -83,13 +90,18 @@ describe(
8390 'Render and configure a gantt chart' ,
8491 { defaultCommandTimeout : 20000 } ,
8592 ( ) => {
86- before ( ( ) => {
87- CURRENT_TENANT . newTenant = 'global' ;
88- } ) ;
8993 beforeEach ( ( ) => {
94+ CURRENT_TENANT . newTenant = 'private' ;
9095 cy . visit ( `${ BASE_PATH } /app/visualize#` ) ;
96+ cy . intercept ( '**' ) . as ( 'searchRequest' ) ;
9197 cy . get ( '.euiFieldSearch' ) . focus ( ) . type ( GANTT_VIS_NAME ) ;
92- cy . contains ( GANTT_VIS_NAME ) . click ( { force : true } ) ;
98+ cy . wait ( '@searchRequest' ) ;
99+ cy . wait ( 5000 ) ;
100+ cy . get ( '[data-test-subj="itemsInMemTable"]' )
101+ . contains ( GANTT_VIS_NAME )
102+ . click ( {
103+ force : true ,
104+ } ) ;
93105 } ) ;
94106
95107 it ( 'Renders no data message' , ( ) => {
@@ -125,13 +137,13 @@ describe(
125137) ;
126138
127139describe ( 'Configure panel settings' , { defaultCommandTimeout : 20000 } , ( ) => {
128- before ( ( ) => {
129- CURRENT_TENANT . newTenant = 'global' ;
130- } ) ;
131140 beforeEach ( ( ) => {
132141 cy . visit ( `${ BASE_PATH } /app/visualize#` ) ;
142+ cy . intercept ( '**' ) . as ( 'searchRequest' ) ;
133143 cy . get ( '.euiFieldSearch' ) . focus ( ) . type ( GANTT_VIS_NAME ) ;
134- cy . contains ( GANTT_VIS_NAME ) . click ( { force : true } ) ;
144+ cy . wait ( '@searchRequest' ) ;
145+ cy . wait ( 5000 ) ;
146+ cy . contains ( GANTT_VIS_NAME ) . should ( 'exist' ) . click ( ) ;
135147 cy . contains ( 'Panel settings' ) . click ( { force : true } ) ;
136148 } ) ;
137149
@@ -251,9 +263,6 @@ describe(
251263 'Add gantt chart to dashboard' ,
252264 { defaultCommandTimeout : 20000 } ,
253265 ( ) => {
254- before ( ( ) => {
255- CURRENT_TENANT . newTenant = 'global' ;
256- } ) ;
257266 it ( 'Adds gantt chart to dashboard' , ( ) => {
258267 cy . visit ( `${ BASE_PATH } /app/dashboards#/create` ) ;
259268 cy . contains ( 'Add an existing' ) . click ( { force : true } ) ;
0 commit comments