From de08a8e939eade18a6552fcb95d6a9d6275240ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alaksiej=20Miale=C5=A1ka?= Date: Wed, 24 Jun 2020 12:55:50 +0300 Subject: [PATCH] Stabilize ignored tests to fix #62 --- .../Applications/Browser/CachedElementTests.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Aquality.Selenium.Core/tests/Aquality.Selenium.Core.Tests/Applications/Browser/CachedElementTests.cs b/Aquality.Selenium.Core/tests/Aquality.Selenium.Core.Tests/Applications/Browser/CachedElementTests.cs index d4d5575..25200b8 100644 --- a/Aquality.Selenium.Core/tests/Aquality.Selenium.Core.Tests/Applications/Browser/CachedElementTests.cs +++ b/Aquality.Selenium.Core/tests/Aquality.Selenium.Core.Tests/Applications/Browser/CachedElementTests.cs @@ -140,12 +140,11 @@ private void AssertStateConditionAfterReopen(Func s var testElement = new Label(ContentLoc, "Example", ElementState.ExistsInAnyState); testElement.State.WaitForClickable(); AqualityServices.Application.Quit(); + StartLoading(); + ConditionalWait.WaitForTrue(() => testElement.Cache.IsStale, message: "Element should be stale after page is closed."); OpenDynamicContent(); - ConditionalWait.WaitForTrue(() => testElement.Cache.IsStale, message: "Element should be stale after page is reopened."); - AqualityServices.Application.Driver.Navigate().Refresh(); - Assert.IsTrue(testElement.Cache.IsStale, "Element should remain stale after the page refresh."); Assert.AreEqual(expectedValue, stateCondition(testElement.State), - "Element state condition is not expected after refreshing the window"); + "Element state condition is not expected after reopening the window"); } [TearDown]