@@ -36,12 +36,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
3636 await fieldEditor . enableValue ( ) ;
3737 await fieldEditor . typeScript ( "emit('abc')" ) ;
3838 await fieldEditor . save ( ) ;
39+ await fieldEditor . waitUntilClosed ( ) ;
3940 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
4041 } ;
4142
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 ( ) {
43+ describe ( 'discover integration with runtime fields editor' , function describeIndexTests ( ) {
4544 before ( async function ( ) {
4645 await security . testUser . setRoles ( [ 'kibana_admin' , 'test_logstash_reader' ] ) ;
4746 await esArchiver . loadIfNeeded ( 'test/functional/fixtures/es_archiver/logstash_functional' ) ;
@@ -54,7 +53,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
5453 after ( async ( ) => {
5554 await security . testUser . restoreDefaults ( ) ;
5655 await kibanaServer . importExport . unload ( 'test/functional/fixtures/kbn_archiver/discover' ) ;
57- await kibanaServer . savedObjects . clean ( { types : [ 'saved-search' ] } ) ;
56+ await kibanaServer . savedObjects . cleanStandardList ( ) ;
5857 } ) ;
5958
6059 it ( 'allows adding custom label to existing fields' , async function ( ) {
@@ -63,6 +62,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
6362 await fieldEditor . enableCustomLabel ( ) ;
6463 await fieldEditor . setCustomLabel ( customLabel ) ;
6564 await fieldEditor . save ( ) ;
65+ await fieldEditor . waitUntilClosed ( ) ;
6666 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
6767 expect ( ( await PageObjects . unifiedFieldList . getAllFieldNames ( ) ) . includes ( customLabel ) ) . to . be (
6868 true
@@ -72,38 +72,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
7272 } ) ;
7373
7474 it ( 'allows adding custom description to existing fields' , async function ( ) {
75- const customDescription = 'custom bytes description here' ;
75+ const customDescription = 'custom agent description here' ;
7676 const customDescription2 = `${ customDescription } updated` ;
7777 // set a custom description
78- await PageObjects . discover . editField ( 'bytes ' ) ;
78+ await PageObjects . discover . editField ( 'agent ' ) ;
7979 await fieldEditor . enableCustomDescription ( ) ;
8080 await fieldEditor . setCustomDescription ( customDescription ) ;
8181 await fieldEditor . save ( ) ;
82+ await fieldEditor . waitUntilClosed ( ) ;
8283 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
83- await PageObjects . unifiedFieldList . clickFieldListItem ( 'bytes ' ) ;
84+ await PageObjects . unifiedFieldList . clickFieldListItem ( 'agent ' ) ;
8485 await retry . waitFor ( 'field popover text' , async ( ) => {
85- return ( await testSubjects . getVisibleText ( 'fieldDescription-bytes ' ) ) === customDescription ;
86+ return ( await testSubjects . getVisibleText ( 'fieldDescription-agent ' ) ) === customDescription ;
8687 } ) ;
87- await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'bytes ' ) ;
88+ await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'agent ' ) ;
8889
89- // edit the custom description
90- await PageObjects . discover . editField ( 'bytes' ) ;
90+ await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
91+ await PageObjects . discover . waitUntilSearchingHasFinished ( ) ;
92+
93+ // edit the custom description again
94+ await PageObjects . discover . editField ( 'agent' ) ;
9195 await fieldEditor . enableCustomDescription ( ) ;
9296 await fieldEditor . setCustomDescription ( customDescription2 ) ;
9397 await fieldEditor . save ( ) ;
9498 await fieldEditor . waitUntilClosed ( ) ;
9599 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
96- await PageObjects . unifiedFieldList . clickFieldListItem ( 'bytes ' ) ;
100+ await PageObjects . unifiedFieldList . clickFieldListItem ( 'agent ' ) ;
97101 await retry . waitFor ( 'field popover text' , async ( ) => {
98- return ( await testSubjects . getVisibleText ( 'fieldDescription-bytes ' ) ) === customDescription2 ;
102+ return ( await testSubjects . getVisibleText ( 'fieldDescription-agent ' ) ) === customDescription2 ;
99103 } ) ;
100- await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'bytes ' ) ;
104+ await PageObjects . unifiedFieldList . clickFieldListItemToggle ( 'agent ' ) ;
101105
102106 // check it in the doc viewer too
103107 await dataGrid . clickRowToggle ( { rowIndex : 0 } ) ;
104- await testSubjects . click ( 'fieldDescriptionPopoverButton-bytes ' ) ;
108+ await testSubjects . click ( 'fieldDescriptionPopoverButton-agent ' ) ;
105109 await retry . waitFor ( 'doc viewer popover text' , async ( ) => {
106- return ( await testSubjects . getVisibleText ( 'fieldDescription-bytes ' ) ) === customDescription2 ;
110+ return ( await testSubjects . getVisibleText ( 'fieldDescription-agent ' ) ) === customDescription2 ;
107111 } ) ;
108112
109113 await dataGrid . closeFlyout ( ) ;
@@ -125,7 +129,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
125129 it ( 'allows creation of a new field' , async function ( ) {
126130 const field = '_runtimefield' ;
127131 await createRuntimeField ( field ) ;
128- await retry . waitForWithTimeout ( 'fieldNames to include runtimefield' , 5000 , async ( ) => {
132+
133+ await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
134+ await PageObjects . discover . waitForDocTableLoadingComplete ( ) ;
135+ await PageObjects . unifiedFieldList . waitUntilSidebarHasLoaded ( ) ;
136+
137+ await retry . waitFor ( 'fieldNames to include runtimefield' , async ( ) => {
129138 const fieldNames = await PageObjects . unifiedFieldList . getAllFieldNames ( ) ;
130139 return fieldNames . includes ( field ) ;
131140 } ) ;
@@ -139,8 +148,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
139148 await fieldEditor . setName ( newFieldName , true ) ;
140149 await fieldEditor . save ( ) ;
141150 await fieldEditor . confirmSave ( ) ;
151+ await fieldEditor . waitUntilClosed ( ) ;
142152 await PageObjects . header . waitUntilLoadingHasFinished ( ) ;
143153 await PageObjects . discover . waitForDocTableLoadingComplete ( ) ;
154+ await PageObjects . unifiedFieldList . waitUntilSidebarHasLoaded ( ) ;
144155
145156 await retry . waitForWithTimeout ( 'fieldNames to include edits' , 5000 , async ( ) => {
146157 const fieldNames = await PageObjects . unifiedFieldList . getAllFieldNames ( ) ;
0 commit comments