@@ -31,6 +31,13 @@ const TESTCAFE_CONFIG: Partial<TestCafeConfigurationOptions> = {
3131 port2 : 1438 ,
3232} ;
3333
34+ const getCurrentTheme = async ( t : TestController ) : Promise < string > => {
35+ // eslint-disable-next-line @stylistic/max-len
36+ const currentTheme = await ClientFunction ( ( ) => ( window as any ) . DevExpress . ui . themes . current ( ) ) . with ( { boundTestRun : t } ) ( ) ;
37+
38+ return currentTheme ;
39+ } ;
40+
3441const changeTheme = async ( t : TestController , themeName : string ) : Promise < void > => {
3542 const changeThemeClientFn = ClientFunction ( ( ) => new Promise < void > ( ( resolve ) => {
3643 ( window as any ) . DevExpress . ui . themes . ready ( resolve ) ;
@@ -237,7 +244,8 @@ createTestCafe(TESTCAFE_CONFIG)
237244 }
238245
239246 const runOptions : RunOptions = {
240- quarantineMode : { successThreshold : 1 , attemptLimit : 10 } ,
247+ quarantineMode : { successThreshold : 1 , attemptLimit : 5 } ,
248+ disableNativeAutomation : true ,
241249 // @ts -expect-error ts-error
242250 hooks : {
243251 test : {
@@ -251,12 +259,17 @@ createTestCafe(TESTCAFE_CONFIG)
251259 await addShadowRootTree ( t ) ;
252260 }
253261
254- if ( args . theme ) {
255- await changeTheme ( t , args . theme ) ;
262+ if ( ! componentFolder . includes ( 'dataGrid' ) ) {
263+ const currentTheme = await getCurrentTheme ( t ) || 'generic.light' ;
264+ const newTheme = args . theme || 'generic.light' ;
265+
266+ if ( currentTheme !== newTheme ) {
267+ await changeTheme ( t , newTheme ) ;
268+ }
256269 }
257270 } ,
258- after : async ( ) => {
259- await testPageUtils . clearTestPage ( ) ;
271+ after : async ( t : TestController ) => {
272+ await testPageUtils . clearTestPage ( t ) ;
260273 } ,
261274 } ,
262275 } ,
0 commit comments