66 screenshotIfFailed ,
77 skipForWeb ,
88 DEFAULT_CONNECTION_NAME_1 ,
9- TEST_COMPASS_WEB ,
109} from '../helpers/compass' ;
1110import type { Compass } from '../helpers/compass' ;
1211import * as Selectors from '../helpers/selectors' ;
@@ -115,12 +114,7 @@ describe('Collection schema tab', function () {
115114 } ) ;
116115 }
117116
118- describe ( 'with the enableExportSchema feature flag enabled' , function ( ) {
119- beforeEach ( async function ( ) {
120- if ( ! TEST_COMPASS_WEB )
121- await browser . setFeature ( 'enableExportSchema' , true ) ;
122- } ) ;
123-
117+ describe ( 'with exporting schema' , function ( ) {
124118 const filename = 'schema-test-numbers-mongoDBJSON.json' ;
125119
126120 before ( ( ) => {
@@ -140,9 +134,6 @@ describe('Collection schema tab', function () {
140134 ) ;
141135 await browser . clickVisible ( Selectors . AnalyzeSchemaButton ) ;
142136
143- const element = browser . $ ( Selectors . SchemaFieldList ) ;
144- await element . waitForDisplayed ( ) ;
145-
146137 await browser . clickVisible ( Selectors . ExportSchemaButton ) ;
147138
148139 const exportModal = browser . $ ( Selectors . ExportSchemaFormatOptions ) ;
@@ -171,58 +162,58 @@ describe('Collection schema tab', function () {
171162 } ,
172163 } ,
173164 } ) ;
174- } ) ;
175-
176- it ( 'can download schema (MongoDB $jsonSchema)' , async function ( ) {
177- await browser . navigateToCollectionTab (
178- DEFAULT_CONNECTION_NAME_1 ,
179- 'test' ,
180- 'numbers' ,
181- 'Schema'
182- ) ;
183- await browser . clickVisible ( Selectors . AnalyzeSchemaButton ) ;
184-
185- const element = browser . $ ( Selectors . SchemaFieldList ) ;
186- await element . waitForDisplayed ( ) ;
187-
188- await browser . clickVisible ( Selectors . ExportSchemaButton ) ;
189165
190- const exportModal = browser . $ ( Selectors . ExportSchemaFormatOptions ) ;
191- await exportModal . waitForDisplayed ( ) ;
192-
193- await browser . clickVisible (
194- Selectors . exportSchemaFormatOption ( 'mongoDBJSON' )
195- ) ;
196-
197- const exportSchemaButton = browser . $ (
198- Selectors . ExportSchemaDownloadButton
199- ) ;
200- await exportSchemaButton . waitForEnabled ( ) ;
201- await exportSchemaButton . click ( ) ;
202-
203- const { fileExists, filePath } = await waitForFileDownload (
204- filename ,
205- browser
206- ) ;
207- expect ( fileExists ) . to . be . true ;
208-
209- const content = readFileSync ( filePath , 'utf-8' ) ;
210- expect ( JSON . parse ( content ) ) . to . deep . equal ( {
211- $jsonSchema : {
212- bsonType : 'object' ,
213- required : [ '_id' , 'i' , 'j' ] ,
214- properties : {
215- _id : {
216- bsonType : 'objectId' ,
217- } ,
218- i : {
219- bsonType : 'int' ,
220- } ,
221- j : {
222- bsonType : 'int' ,
166+ it ( 'can download schema (MongoDB $jsonSchema)' , async function ( ) {
167+ await browser . navigateToCollectionTab (
168+ DEFAULT_CONNECTION_NAME_1 ,
169+ 'test' ,
170+ 'numbers' ,
171+ 'Schema'
172+ ) ;
173+ await browser . clickVisible ( Selectors . AnalyzeSchemaButton ) ;
174+
175+ const element = browser . $ ( Selectors . SchemaFieldList ) ;
176+ await element . waitForDisplayed ( ) ;
177+
178+ await browser . clickVisible ( Selectors . ExportSchemaButton ) ;
179+
180+ const exportModal = browser . $ ( Selectors . ExportSchemaFormatOptions ) ;
181+ await exportModal . waitForDisplayed ( ) ;
182+
183+ await browser . clickVisible (
184+ Selectors . exportSchemaFormatOption ( 'mongoDBJSON' )
185+ ) ;
186+
187+ const exportSchemaButton = browser . $ (
188+ Selectors . ExportSchemaDownloadButton
189+ ) ;
190+ await exportSchemaButton . waitForEnabled ( ) ;
191+ await exportSchemaButton . click ( ) ;
192+
193+ const { fileExists, filePath } = await waitForFileDownload (
194+ filename ,
195+ browser
196+ ) ;
197+ expect ( fileExists ) . to . be . true ;
198+
199+ const content = readFileSync ( filePath , 'utf-8' ) ;
200+ expect ( JSON . parse ( content ) ) . to . deep . equal ( {
201+ $jsonSchema : {
202+ bsonType : 'object' ,
203+ required : [ '_id' , 'i' , 'j' ] ,
204+ properties : {
205+ _id : {
206+ bsonType : 'objectId' ,
207+ } ,
208+ i : {
209+ bsonType : 'int' ,
210+ } ,
211+ j : {
212+ bsonType : 'int' ,
213+ } ,
223214 } ,
224215 } ,
225- } ,
216+ } ) ;
226217 } ) ;
227218 } ) ;
228219 } ) ;
0 commit comments