test(playwright): key the Configure bulk-Apply click by data-test (strict-mode collision with the grouped 'Apply to n' button)
The grouped Connection Bindings panel (77f4af0d) added a per-group
'Apply to n' button, so InstanceConfigureTests' Name = "Apply" role
locator started matching two elements and failing Playwright's strict
mode. Adds data-test="binding-bulk-apply" alongside the existing
binding-bulk-select / binding-group-apply keys and clicks that instead.
Claude-Session: https://claude.ai/code/session_01G2GHPnbbKGvyyfbr2XBRVH
This commit is contained in:
+2
-1
@@ -142,7 +142,8 @@
|
|||||||
<option value="@c.Id">@c.Name (@c.Protocol)</option>
|
<option value="@c.Id">@c.Name (@c.Protocol)</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<button class="btn btn-outline-primary btn-sm" @onclick="ApplyBulkBinding"
|
<button class="btn btn-outline-primary btn-sm" data-test="binding-bulk-apply"
|
||||||
|
@onclick="ApplyBulkBinding"
|
||||||
disabled="@(_bulkConnectionId == 0)">Apply connection</button>
|
disabled="@(_bulkConnectionId == 0)">Apply connection</button>
|
||||||
</label>
|
</label>
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -55,7 +55,10 @@ public sealed class InstanceConfigureTests : IClassFixture<InstanceConfigureFixt
|
|||||||
// Bulk-assign every bindable attribute to the fixture connection, then Apply + Save.
|
// Bulk-assign every bindable attribute to the fixture connection, then Apply + Save.
|
||||||
// Select by VALUE (the connection id) — most robust, since the select binds _bulkConnectionId.
|
// Select by VALUE (the connection id) — most robust, since the select binds _bulkConnectionId.
|
||||||
await bulkSelect.SelectOptionAsync(new SelectOptionValue { Value = _cfg.ConnectionId.ToString() });
|
await bulkSelect.SelectOptionAsync(new SelectOptionValue { Value = _cfg.ConnectionId.ToString() });
|
||||||
await page.GetByRole(AriaRole.Button, new() { Name = "Apply" }).ClickAsync();
|
// Keyed, not by accessible name: the grouped-bindings panel (77f4af0d) added a
|
||||||
|
// per-group "Apply to n" button, so a Name = "Apply" role locator now matches two
|
||||||
|
// elements and fails Playwright's strict mode.
|
||||||
|
await page.Locator("[data-test='binding-bulk-apply']").ClickAsync();
|
||||||
await page.GetByRole(AriaRole.Button, new() { Name = "Save Bindings" }).ClickAsync();
|
await page.GetByRole(AriaRole.Button, new() { Name = "Save Bindings" }).ClickAsync();
|
||||||
|
|
||||||
await Assertions.Expect(page.Locator(".toast")).ToHaveCountAsync(1, new() { Timeout = 15_000 });
|
await Assertions.Expect(page.Locator(".toast")).ToHaveCountAsync(1, new() { Timeout = 15_000 });
|
||||||
|
|||||||
Reference in New Issue
Block a user