test(e2e): add wizard sentinel waits + tighten audit-link assertion (review fixes)
This commit is contained in:
+8
-2
@@ -98,13 +98,19 @@ public class TransportImportTests
|
|||||||
await page.Locator("button.btn.btn-primary:has-text('Unlock')").ClickAsync();
|
await page.Locator("button.btn.btn-primary:has-text('Unlock')").ClickAsync();
|
||||||
|
|
||||||
// ── STEP 3: Diff ────────────────────────────────────────────────────────────
|
// ── STEP 3: Diff ────────────────────────────────────────────────────────────
|
||||||
|
// Wait for the passphrase input to disappear before asserting the diff
|
||||||
|
// summary — this gives a clearer failure when decrypt/preview is slow and
|
||||||
|
// prevents a race between the decrypt completion and the render of the diff.
|
||||||
|
await Assertions.Expect(page.Locator("#import-passphrase"))
|
||||||
|
.ToBeHiddenAsync(new() { Timeout = 20_000 });
|
||||||
|
|
||||||
// A brand-new template renders as a static Add item with no blocker, so
|
// A brand-new template renders as a static Add item with no blocker, so
|
||||||
// the diff summary appears and the Next button is enabled.
|
// the diff summary appears and the Next button is enabled.
|
||||||
await Assertions.Expect(page.Locator("[data-testid='diff-summary']"))
|
await Assertions.Expect(page.Locator("[data-testid='diff-summary']"))
|
||||||
.ToBeVisibleAsync(new() { Timeout = 15_000 });
|
.ToBeVisibleAsync(new() { Timeout = 15_000 });
|
||||||
|
|
||||||
var diffNext = page.Locator("button.btn.btn-primary:has-text('Next')");
|
var diffNext = page.Locator("button.btn.btn-primary:has-text('Next')");
|
||||||
await Assertions.Expect(diffNext).ToBeEnabledAsync();
|
await Assertions.Expect(diffNext).ToBeEnabledAsync(new() { Timeout = 15_000 });
|
||||||
await diffNext.ClickAsync();
|
await diffNext.ClickAsync();
|
||||||
|
|
||||||
// ── STEP 4: Confirm ──────────────────────────────────────────────────────────
|
// ── STEP 4: Confirm ──────────────────────────────────────────────────────────
|
||||||
@@ -128,7 +134,7 @@ public class TransportImportTests
|
|||||||
await Assertions.Expect(auditLink).ToBeVisibleAsync();
|
await Assertions.Expect(auditLink).ToBeVisibleAsync();
|
||||||
var href = await auditLink.GetAttributeAsync("href");
|
var href = await auditLink.GetAttributeAsync("href");
|
||||||
Assert.NotNull(href);
|
Assert.NotNull(href);
|
||||||
Assert.StartsWith("/audit/configuration?bundleImportId=", href);
|
Assert.Matches(@"^/audit/configuration\?bundleImportId=[0-9a-fA-F\-]{36}$", href);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user