@@ -39,9 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
3939 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
4040 } ;
4141
42- // Failing: See https://github.com/elastic/kibana/issues/179297
43- // FLAKY: https://github.com/elastic/kibana/issues/179310
44- describe . skip ( 'discover integration with runtime fields editor' , function describeIndexTests ( ) {
42+ describe ( 'discover integration with runtime fields editor' , function describeIndexTests ( ) {
4543 before ( async function ( ) {
4644 await security . testUser . setRoles ( [ 'kibana_admin' , 'test_logstash_reader' ] ) ;
4745 await esArchiver . loadIfNeeded ( 'test/functional/fixtures/es_archiver/logstash_functional' ) ;
@@ -54,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
5452 after ( async ( ) => {
5553 await security . testUser . restoreDefaults ( ) ;
5654 await kibanaServer . importExport . unload ( 'test/functional/fixtures/kbn_archiver/discover' ) ;
57- await kibanaServer . savedObjects . clean ( { types : [ 'saved-search' ] } ) ;
55+ await kibanaServer . savedObjects . cleanStandardList ( ) ;
5856 } ) ;
5957
6058 it ( 'allows adding custom label to existing fields' , async function ( ) {
@@ -72,38 +70,41 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
7270 } ) ;
7371
7472 it ( 'allows adding custom description to existing fields' , async function ( ) {
75- const customDescription = 'custom bytes description here' ;
73+ const customDescription = 'custom agent description here' ;
7674 const customDescription2 = `${ customDescription } updated` ;
7775 // set a custom description
78- await PageObjects . discover . editField ( 'bytes ' ) ;
76+ await PageObjects . discover . editField ( 'agent ' ) ;
7977 await fieldEditor . enableCustomDescription ( ) ;
8078 await fieldEditor . setCustomDescription ( customDescription ) ;
8179 await fieldEditor . save ( ) ;
8280 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
83- await PageObjects . unifiedFieldList . clickFieldListItem ( 'bytes ' ) ;
81+ await PageObjects . unifiedFieldList . clickFieldListItem ( 'agent ' ) ;
8482 await retry . waitFor ( 'field popover text' , async ( ) => {
85- return ( await testSubjects . getVisibleText ( 'fieldDescription-bytes ' ) ) === customDescription ;
83+ return ( await testSubjects . getVisibleText ( 'fieldDescription-agent ' ) ) === customDescription ;
8684 } ) ;
87- await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'bytes ' ) ;
85+ await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'agent ' ) ;
8886
89- // edit the custom description
90- await PageObjects . discover . editField ( 'bytes' ) ;
87+ await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
88+ await PageObjects . discover . waitUntilSearchingHasFinished ( ) ;
89+
90+ // edit the custom description again
91+ await PageObjects . discover . editField ( 'agent' ) ;
9192 await fieldEditor . enableCustomDescription ( ) ;
9293 await fieldEditor . setCustomDescription ( customDescription2 ) ;
9394 await fieldEditor . save ( ) ;
9495 await fieldEditor . waitUntilClosed ( ) ;
9596 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
96- await PageObjects . unifiedFieldList . clickFieldListItem ( 'bytes ' ) ;
97+ await PageObjects . unifiedFieldList . clickFieldListItem ( 'agent ' ) ;
9798 await retry . waitFor ( 'field popover text' , async ( ) => {
98- return ( await testSubjects . getVisibleText ( 'fieldDescription-bytes ' ) ) === customDescription2 ;
99+ return ( await testSubjects . getVisibleText ( 'fieldDescription-agent ' ) ) === customDescription2 ;
99100 } ) ;
100- await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'bytes ' ) ;
101+ await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'agent ' ) ;
101102
102103 // check it in the doc viewer too
103104 await dataGrid . clickRowToggle ( { rowIndex : 0 } ) ;
104- await testSubjects . click ( 'fieldDescriptionPopoverButton-bytes ' ) ;
105+ await testSubjects . click ( 'fieldDescriptionPopoverButton-agent ' ) ;
105106 await retry . waitFor ( 'doc viewer popover text' , async ( ) => {
106- return ( await testSubjects . getVisibleText ( 'fieldDescription-bytes ' ) ) === customDescription2 ;
107+ return ( await testSubjects . getVisibleText ( 'fieldDescription-agent ' ) ) === customDescription2 ;
107108 } ) ;
108109
109110 await dataGrid . closeFlyout ( ) ;
@@ -125,7 +126,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
125126 it ( 'allows creation of a new field' , async function ( ) {
126127 const field = '_runtimefield' ;
127128 await createRuntimeField ( field ) ;
128- await retry . waitForWithTimeout ( 'fieldNames to include runtimefield' , 5000 , async ( ) => {
129+
130+ await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
131+ await PageObjects . discover . waitForDocTableLoadingComplete ( ) ;
132+ await PageObjects . unifiedFieldList . waitUntilSidebarHasLoaded ( ) ;
133+
134+ await retry . waitFor ( 'fieldNames to include runtimefield' , async ( ) => {
129135 const fieldNames = await PageObjects . unifiedFieldList . getAllFieldNames ( ) ;
130136 return fieldNames . includes ( field ) ;
131137 } ) ;
@@ -141,6 +147,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
141147 await fieldEditor . confirmSave ( ) ;
142148 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
143149 await PageObjects . discover . waitForDocTableLoadingComplete ( ) ;
150+ await PageObjects . unifiedFieldList . waitUntilSidebarHasLoaded ( ) ;
144151
145152 await retry . waitForWithTimeout ( 'fieldNames to include edits' , 5000 , async ( ) => {
146153 const fieldNames = await PageObjects . unifiedFieldList . getAllFieldNames ( ) ;
0 commit comments