File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/compass-e2e-tests/tests/atlas-cloud Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,10 @@ describe('Collection ai query', function () {
119119 // Click generate.
120120 await browser . clickVisible ( Selectors . GenAIGenerateQueryButton ) ;
121121
122- // Wait for the ipc events to succeed.
123122 await browser . waitUntil ( async function ( ) {
124- const textContent = browser . $ ( Selectors . AggregationAsTextEditor ) ;
125- expect ( await textContent . getText ( ) ) . to . contain ( '$match' ) ;
123+ const textEditor = browser . $ ( Selectors . AggregationAsTextEditor ) ;
124+ const textContent = await textEditor . getText ( ) ;
125+ return textContent . includes ( '$match' ) ;
126126 } ) ;
127127
128128 // Run it and check that the correct documents are shown.
@@ -135,9 +135,12 @@ describe('Collection ai query', function () {
135135 await browser . clickVisible (
136136 Selectors . AggregationResultsJSONListSwitchButton
137137 ) ;
138- const documents = await browser . getCodemirrorEditorTextAll (
138+ const rawDocuments = await browser . getCodemirrorEditorTextAll (
139139 Selectors . DocumentJSONEntry
140140 ) ;
141+ const documents = rawDocuments . map ( ( text ) => {
142+ return JSON . parse ( text ) ;
143+ } ) ;
141144
142145 expect ( documents ) . to . have . lengthOf ( 1 ) ;
143146 expect ( documents [ 0 ] ) . to . have . property ( '_id' ) ;
You can’t perform that action at this time.
0 commit comments