Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ protected virtual IShellObservableFragment GetOrCreateFragmentForTab(ShellSectio

protected virtual Task<bool> HandleFragmentUpdate(ShellNavigationSource navSource, ShellSection shellSection, Page page, bool animated)
{
TaskCompletionSource<bool> result = new TaskCompletionSource<bool>();
// We're using RunContinuationsAsynchronously because we don't want a subsequent navigation
// to start until the current one has finished.
// The AnimationFinished event is used to signal when the animation has completed,
// but that doesn't mean the fragment transaction has completed.
var result = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);

bool isForCurrentTab = shellSection == ShellSection;
bool initialUpdate = _fragmentMap.Count == 0;
if (!_fragmentMap.ContainsKey(ShellSection))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,34 @@ public Bugzilla42329(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.ListView)]
public void MemoryLeakB42329()
public async Task MemoryLeakB42329()
{
App.WaitForElement(LabelPage1);
App.Tap(LabelPage1);

await WaitForFlyoutAnimation();
App.WaitForElement(Page2Title);
App.Tap(Page2Title);

await WaitForFlyoutAnimation();
App.WaitForElement(LabelPage2);
App.Tap(LabelPage2);

await WaitForFlyoutAnimation();
App.WaitForElement(Page3Title);
App.Tap(Page3Title);

#if ANDROID || WINDOWS //In random scenario, the destructor called upon the fourth navigation. So added one more navigation for Android and Windows to make this test work.
App.TapInFlyoutPageFlyout(Page2Title);
App.TapInFlyoutPageFlyout(Page3Title);
#endif
App.WaitForElement("Destructor called");
}

static async Task WaitForFlyoutAnimation()
{
// give it time to complete flyout animation
// sometimes the test runner is too fast and taps on wrong coordinates
await Task.Delay(100);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using System.Globalization;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
Expand Down Expand Up @@ -39,6 +40,6 @@ public void WhenChangingBoxViewOpacityThenValueIsCorrectlySet()

string? GetCurrentOpacityStatus() => App.FindElement("CurrentOpacity").GetText();

string GetExpectedCurrentOpacityStatus(double expectedOpacity) => $"Current opacity is {expectedOpacity}";
string GetExpectedCurrentOpacityStatus(double expectedOpacity) => $"Current opacity is {expectedOpacity.ToString(CultureInfo.InvariantCulture)}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void ValidateEntryClearButtonVisibilityBehavior()
App.Click("AddEntry");

// Click the new entry to see if there is the clear button or not. No such button should be present.
App.WaitForElement("Entry3");
App.Tap("Entry3");

VerifyScreenshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public void FlyoutMenuShouldNotDisappearWhenNavigateUsingServices()
App.Tap("BackButton");
App.WaitForElement("Login");
App.Tap("Login");
#if ANDROID
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for cleaning this one up!

App.Tap(AppiumQuery.ByXPath("//android.widget.ImageButton[@content-desc='Open navigation drawer']"));
#else
App.Tap(FlyoutIconAutomationId);
#endif
App.TapShellFlyoutIcon();
VerifyScreenshot();
}

Expand Down