dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.83k stars 457 forks source link

Improve CheckDashboardHasResourcesAsync in workload tests #4834

Open JamesNK opened 4 months ago

JamesNK commented 4 months ago

Is there an existing issue for this?

Describe the bug

CheckDashboardHasResourcesAsync has some improvements I'd like to see to make it less brittle to changes and improve the error message output.

Expected Behavior

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

JamesNK commented 4 months ago

cc @radical

radical commented 4 months ago

@adamint would you be interested in taking this up, since you recently worked on dashboard playwright tests?

adamint commented 4 months ago

@radical sure!

JamesNK commented 3 months ago

Also, queries such as //fluent-data-grid-row[@class='resource-row'] require the exact classes to match the query. It would be better if the query returned elements named fluent-data-grid-row with the class resource-row and any other classes.

Is there a better way to write this kind of query that isn't so brittle to HTML changes?

See https://github.com/dotnet/aspire/pull/4892#discussion_r1680435584

adamint commented 3 months ago

Also, queries such as //fluent-data-grid-row[@class='resource-row'] require the exact classes to match the query. It would be better if the query returned elements named fluent-data-grid-row with the class resource-row and any other classes.

Is there a better way to write this kind of query that isn't so brittle to HTML changes?

See #4892 (comment)

Yes, it is recommended not to use css classes or html elements where possible

JamesNK commented 3 months ago

What's the alternative?