Skip to content

Commit de1a986

Browse files
committed
update functional test
1 parent 5e82862 commit de1a986

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • x-pack/test/plugin_functional/test_suites/resolver

x-pack/test/plugin_functional/test_suites/resolver/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
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';
76
import expect from '@kbn/expect';
87
import { WebElementWrapper } from '../../../../../test/functional/services/lib/web_element_wrapper';
98

109
import { FtrProviderContext } from '../../ftr_provider_context';
10+
import { panAnimationDuration } from '../../../../plugins/security_solution/public/resolver/store/camera/scaling_constants';
1111

1212
const expectedDifference = 0.09;
1313

14+
const waitForPanAnimationToFinish = () =>
15+
new Promise((resolve) => setTimeout(resolve, panAnimationDuration + 1));
16+
1417
export 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

Comments
 (0)