Skip to content

Commit

Permalink
Merge pull request #8587 from workgroupengineering/fixes/SamplesApp/I…
Browse files Browse the repository at this point in the history
…ssue_8585-RecordAllTests

fix: The parent of FrameworkElement is always null in GenerateBitmap
  • Loading branch information
jeromelaban authored Apr 21, 2022
2 parents 6b8defa + 9f890c9 commit 9dc4fac
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public partial class SampleChooserViewModel

private Section _lastSection = Section.Library;
private readonly Stack<Section> _previousSections = new Stack<Section>();
private bool _isRecordAllTests = false;

// A static instance used during UI Testing automation
public static SampleChooserViewModel Instance { get; private set; }
Expand Down Expand Up @@ -267,6 +268,7 @@ internal async Task RecordAllTests(CancellationToken ct, string screenShotPath =
{
try
{
_isRecordAllTests = true;
IsSplitVisible = false;

var folderName = Path.Combine(screenShotPath, "UITests-" + DateTime.Now.ToString("yyyyMMdd-hhmmssfff", CultureInfo.InvariantCulture));
Expand All @@ -277,7 +279,12 @@ await Window.Current.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
async () =>
{
await RecordAllTestsInner(folderName, ct, doneAction);
try {
await RecordAllTestsInner(folderName, ct, doneAction);
}
finally {
_isRecordAllTests = false;
}
});
}
catch (Exception e)
Expand Down Expand Up @@ -467,6 +474,10 @@ private void ObserveChanges()
void Update(SampleChooserContent newContent)
{
if (_isRecordAllTests)
{
return;
}
var unused = Window.Current.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
async () =>
Expand Down

0 comments on commit 9dc4fac

Please sign in to comment.