@@ -36,6 +36,7 @@ describe('MaestroOptions', () => {
3636 geoCountryCode : 'DE' ,
3737 env : { API_URL : 'https://api.example.com' , API_KEY : 'secret' } ,
3838 maestroVersion : '2.0.10' ,
39+ groups : [ 'smoke' , 'critical' ] ,
3940 quiet : true ,
4041 async : true ,
4142 } ) ;
@@ -58,6 +59,7 @@ describe('MaestroOptions', () => {
5859 API_KEY : 'secret' ,
5960 } ) ;
6061 expect ( options . maestroVersion ) . toBe ( '2.0.10' ) ;
62+ expect ( options . groups ) . toEqual ( [ 'smoke' , 'critical' ] ) ;
6163 expect ( options . quiet ) . toBe ( true ) ;
6264 expect ( options . async ) . toBe ( true ) ;
6365 } ) ;
@@ -232,6 +234,32 @@ describe('MaestroOptions', () => {
232234 expect ( caps . tunnelIdentifier ) . toBe ( 'my-tunnel' ) ;
233235 } ) ;
234236
237+ it ( 'should include groups in capabilities when set' , ( ) => {
238+ const options = new MaestroOptions ( 'app.apk' , './flows' , 'Pixel 6' , {
239+ platformName : 'Android' ,
240+ groups : [ 'smoke' , 'critical' ] ,
241+ } ) ;
242+ const caps = options . getCapabilities ( ) ;
243+ expect ( caps . groups ) . toEqual ( [ 'smoke' , 'critical' ] ) ;
244+ } ) ;
245+
246+ it ( 'should omit groups from capabilities when not set' , ( ) => {
247+ const options = new MaestroOptions ( 'app.apk' , './flows' , 'Pixel 6' , {
248+ platformName : 'Android' ,
249+ } ) ;
250+ const caps = options . getCapabilities ( ) ;
251+ expect ( caps ) . not . toHaveProperty ( 'groups' ) ;
252+ } ) ;
253+
254+ it ( 'should omit groups from capabilities when empty array' , ( ) => {
255+ const options = new MaestroOptions ( 'app.apk' , './flows' , 'Pixel 6' , {
256+ platformName : 'Android' ,
257+ groups : [ ] ,
258+ } ) ;
259+ const caps = options . getCapabilities ( ) ;
260+ expect ( caps ) . not . toHaveProperty ( 'groups' ) ;
261+ } ) ;
262+
235263 it ( 'should not include includeTags and excludeTags in capabilities' , ( ) => {
236264 const options = new MaestroOptions ( 'app.apk' , './flows' , 'Pixel 8' , {
237265 includeTags : [ 'smoke' , 'regression' ] ,
0 commit comments