test(editor): remote source, export sync, saved copies and hero frame
The remote source loads, saves with the settings version, merges a 409, posts one server job per preset and follows the server's job events; Export "Sync" gating and the send it queues; "Save both" copies listed and restored through undo; Set hero reaches the index. A smoke test opens the sample server's proxied sequence in the real window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
8 files changed
+681
-1
No files matched your search
@@ -9,8 +9,10 @@ using Titano.App.Infrastructure;
|
||||
using Titano.App.Sections;
|
||||
using Titano.App.Shell;
|
||||
using Titano.App.Tests.Windows;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Testing;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Theming;
|
||||
using Titano.Ui.Visuals;
|
||||
|
||||
@@ -138,6 +140,74 @@ public sealed class EditorSmokeTests
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// A server sequence opened with this PC's proxies (the sample server's Sunrise over Superga): the header names the
|
||||
/// server, the preview shows a proxy, Save to and Sync wait for the server, and Render posts a server job.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public Task AServerSequenceOpensWithItsProxies() => ScreenHost.RunAsync(async () =>
|
||||
{
|
||||
var environment = AppEnvironment.ForCapture();
|
||||
UiLanguage.Apply("en");
|
||||
ThemeManager.Apply(AppTheme.Dark);
|
||||
var services = new AppServices(environment, new AppSettings { Language = "en", FirstRunCompleted = true }, () => { }, new NoDialogs());
|
||||
var sample = SampleData.Configure(services);
|
||||
var shell = new ShellViewModel(services);
|
||||
var window = new MainWindow(shell)
|
||||
{
|
||||
WindowStartupLocation = WindowStartupLocation.Manual,
|
||||
Left = -20000,
|
||||
Top = -20000,
|
||||
Width = 1200,
|
||||
Height = 788,
|
||||
ShowActivated = false,
|
||||
ShowInTaskbar = false,
|
||||
};
|
||||
window.Show();
|
||||
try
|
||||
{
|
||||
await sample.OpenEmptyAsync();
|
||||
await shell.StartAsync();
|
||||
await sample.FillAsync();
|
||||
await services.Server.RestoreAsync();
|
||||
await services.Sync.RefreshAsync();
|
||||
await sample.CacheProxiesAsync();
|
||||
var id = sample.ProxiedSequenceId;
|
||||
shell.OpenSequence(id);
|
||||
await shell.Sequence.OpenAsync(id);
|
||||
var editor = Assert.NotNull(shell.Sequence.Editor);
|
||||
Assert.True(editor.IsRemote);
|
||||
Assert.Equal("Studio NAS", editor.RemoteText);
|
||||
Assert.Equal(3, editor.FrameCount);
|
||||
Assert.True(await editor.WhenIdleAsync(TimeSpan.FromSeconds(60)), "the editor settled");
|
||||
await SettleAsync(window);
|
||||
Assert.NotNull(editor.PreviewImage, "the preview shows a proxy");
|
||||
var view = Find<SequenceView>(window).Single(v => v.IsVisible);
|
||||
Assert.True(Find<StatusGlyph>(view).Any(g => g is { Kind: StatusKind.Remote, IsVisible: true, Text: "Studio NAS" }), "the header names the server");
|
||||
Assert.Greater(Distinct(Render(window)), 40, "the remote editor drew almost nothing");
|
||||
|
||||
var export = editor.Tabs.OfType<ExportTab>().Single();
|
||||
editor.SelectedTab = export;
|
||||
await SettleAsync(window);
|
||||
Assert.Equal(ExportSyncGate.Remote, editor.SyncGate);
|
||||
Assert.False(Find<CheckBox>(view).Single(c => ReferenceEquals(c.DataContext, export) && c.IsVisible).IsEnabled, "Sync: the server's renders stay there");
|
||||
Assert.False(Find<ComboBox>(view).Single(c => ReferenceEquals(c.ItemsSource, export.SaveChoices)).IsEnabled, "Save to: the server's exports folder");
|
||||
|
||||
Assert.True(editor.CanRender, editor.RenderBlockedReason ?? "renderable");
|
||||
await editor.RenderAsync(JobPriority.User, batch: false);
|
||||
var queued = Assert.Contains(await editor.Session.Source.ListJobsAsync(CancellationToken.None), _ => true);
|
||||
Assert.Equal(JobKind.Render, queued.Kind);
|
||||
}
|
||||
finally
|
||||
{
|
||||
window.Close();
|
||||
await shell.Sequence.CloseAsync();
|
||||
shell.Dispose();
|
||||
await services.DisposeAsync();
|
||||
environment.DeleteCaptureData();
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>The measuring tool of each section has content.</summary>
|
||||
private static void ExpectMeasure(SequenceView view, EditorTab tab)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user