I am trying to find a button on page following the documentation here https://playwright.dev/dotnet/docs/locators#locating-elements
The issue is the button will show the size of the file "Download (300KB)" and under testing it cannot find the button to click it and produce an action This is my current code which is just timing out
var download1 = await Page.RunAndWaitForDownloadAsync(async () =>
{
await Page.GetByRole(AriaRole.Button, new()
{
NameRegex = new Regex("\\W*((?i)Download(?-i))\\W*", RegexOptions.IgnoreCase)
}).ClickAsync();
});