33 * or more contributor license agreements. Licensed under the Elastic License;
44 * you may not use this file except in compliance with the Elastic License.
55 */
6- import { delay } from 'bluebird' ;
76import expect from '@kbn/expect' ;
87import { WebElementWrapper } from '../../../../../test/functional/services/lib/web_element_wrapper' ;
98
109import { FtrProviderContext } from '../../ftr_provider_context' ;
10+ import { panAnimationDuration } from '../../../../plugins/security_solution/public/resolver/store/camera/scaling_constants' ;
1111
1212const expectedDifference = 0.09 ;
1313
14+ const waitForPanAnimationToFinish = ( ) =>
15+ new Promise ( ( resolve ) => setTimeout ( resolve , panAnimationDuration + 1 ) ) ;
16+
1417export default function ( {
1518 getPageObjects,
1619 getService,
@@ -21,7 +24,6 @@ export default function ({
2124 const screenshot = getService ( 'screenshots' ) ;
2225 const find = getService ( 'find' ) ;
2326 const browser = getService ( 'browser' ) ;
24- const panningDuration = 1000 ;
2527
2628 describe ( 'Resolver test app' , function ( ) {
2729 this . tags ( 'ciGroup7' ) ;
@@ -105,7 +107,7 @@ export default function ({
105107 // select the node
106108 await button . click ( ) ;
107109 // Wait for the pan to center the node
108- await delay ( panningDuration ) ;
110+ await waitForPanAnimationToFinish ( ) ;
109111 } ) ;
110112 it ( 'should render as expected' , async ( ) => {
111113 expect (
@@ -160,7 +162,7 @@ export default function ({
160162 await ( await firstPill ( ) ) . click ( ) ;
161163
162164 // Wait for the pan to center the node
163- await delay ( panningDuration ) ;
165+ await waitForPanAnimationToFinish ( ) ;
164166 } ) ;
165167 it ( 'should render as expected' , async ( ) => {
166168 expect (
0 commit comments