feat(centralui): Topology 'Deploy all…' on site and area nodes with confirm dialog, Force and summary toast (Gitea #40)

This commit is contained in:
Joseph Doherty
2026-10-22 14:16:08 -04:00
parent d71f61e71b
commit bcd087efe8
6 changed files with 314 additions and 4 deletions
@@ -302,6 +302,42 @@ public class TopologyAreaTests : IClassFixture<DeploymentFixture>
}
}
/// <summary>Verifies that right-click area, Deploy all, confirm raises the summary toast (Gitea #40).</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[SkippableFact]
public async Task DeployAll_OnArea_ShowsSummaryToast()
{
Skip.IfNot(_cluster.Available, ClusterAvailability.SkipReason);
var areaName = CliRunner.UniqueName("dpall");
var areaId = await CliRunner.CreateAreaAsync(_cluster.SiteAId, areaName);
var instanceId = await CliRunner.CreateInstanceAsync(
CliRunner.UniqueName("zztest-inst-dpall"), _cluster.TemplateId, _cluster.SiteAId, areaId);
try
{
var page = await OpenStableTopologyAsync(_pw);
var row = page.Locator("div.tv-row", new() { HasText = areaName });
await Assertions.Expect(row.First).ToBeVisibleAsync(new() { Timeout = 10_000 });
await row.First.ClickAsync(new() { Button = MouseButton.Right });
await page.Locator(".dropdown-menu.show button.dropdown-item:has-text('Deploy all')").ClickAsync();
var dialog = page.Locator(".modal.show:has([data-test='deploy-all-body'])");
await Assertions.Expect(dialog).ToBeVisibleAsync(new() { Timeout = 10_000 });
await Assertions.Expect(dialog.Locator("[data-test='deploy-all-counts']")).ToContainTextAsync("1 instance");
await dialog.Locator("[data-test='deploy-all-confirm']").ClickAsync();
var toast = page.Locator(".toast", new() { HasText = $"Deploy all under '{areaName}'" });
await Assertions.Expect(toast).ToBeVisibleAsync(new() { Timeout = 60_000 });
await Assertions.Expect(toast).ToContainTextAsync("deployed");
}
finally
{
await CliRunner.DeleteInstanceAsync(instanceId);
await CliRunner.DeleteAreaAsync(areaId);
}
}
private static Task<IPage> OpenStableTopologyAsync(PlaywrightFixture pw) =>
TopologyPageHelper.OpenStableTopologyAsync(pw);
}