From 9bf66d3ab510cbb22ee79c4b16eff7891f31f02d Mon Sep 17 00:00:00 2001 From: Aliaksej Mialeshka Date: Wed, 16 Oct 2024 11:45:13 +0200 Subject: [PATCH] Add waiting to stabilize testHiddenElementsNotDisplayed --- .../java/tests/integration/elements/HiddenElementsTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/tests/integration/elements/HiddenElementsTests.java b/src/test/java/tests/integration/elements/HiddenElementsTests.java index bebe1e8..c2f0414 100644 --- a/src/test/java/tests/integration/elements/HiddenElementsTests.java +++ b/src/test/java/tests/integration/elements/HiddenElementsTests.java @@ -1,5 +1,6 @@ package tests.integration.elements; +import aquality.selenium.browser.AqualityServices; import aquality.selenium.core.elements.ElementState; import aquality.selenium.core.elements.ElementsCount; import aquality.selenium.elements.interfaces.ILabel; @@ -56,7 +57,7 @@ public void testHiddenElementsExist(Function> elemen public void testHiddenElementsNotDisplayed(Function> elementsListProvider) { List listElements = elementsListProvider.apply(ElementsCount.MORE_THAN_ZERO); Assert.assertFalse(listElements.isEmpty()); - Assert.assertTrue(listElements.stream().noneMatch(el -> el.state().isDisplayed())); + Assert.assertTrue(AqualityServices.getConditionalWait().waitFor(() -> listElements.stream().noneMatch(el -> el.state().isDisplayed()))); } @Test