microsoft / microsoft/aspire

Improve CheckDashboardHasResourcesAsync in workload tests

Open
#4,834 6 comments 0 reactions 0 assignees View on GitHub
area-dashboard testing ☑️
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### 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

* Asserts are hardcoded to cell position and number. The test will break if the number or order of columns changes. I'd like the test to get cells using something other than position. Perhaps we can give each cell a class to look up. Or if that isn't possible, then embed content in divs with classes. I think it's ok to make some modest changes to the generated HTML to make testing better.
* If a row's content doesn't match the expected content, then the test doesn't match the row and skips adding it to found rows. But that means the error message just says that the resource wasn't found. It doesn't say exactly what didn't match for the row (e.g. the wrong number of endpoints). Knowing why it didn't match would be useful.

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version info

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.