Skip to content

Commit

Permalink
Use a class instead of id for metadata tab of new report (#31780)
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal authored Dec 16, 2024
2 parents 44f2d7d + 614a236 commit a85bf44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public ForMetadata(String rootName, MetadataRendererRegistry metadataRendererReg

@Override
protected void render(TestTreeModel.PerRootInfo info, SimpleHtmlWriter htmlWriter) throws IOException {
htmlWriter.startElement("div").attribute("id", "metadata");
htmlWriter.startElement("div").attribute("class", "metadata");
renderMetadataTable(info, htmlWriter);
htmlWriter.endElement();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ ul.linkList li {
margin-bottom: 5px;
}

#metadata tr.odd {
.metadata tr.odd {
background-color: #f7f7f7;
border: solid 1px #d0d0d0;
}

#metadata tr.even {
.metadata tr.even {
border: solid 1px #d0d0d0;
}

#metadata th, #metadata td {
.metadata th, .metadata td {
padding: 10px;
text-align: left;
}

#metadata a {
.metadata a {
color: blue;
}

#metadata .unrenderable {
.metadata .unrenderable {
color: darkred;
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ class GenericHtmlTestExecutionResult implements GenericTestExecutionResult {

@Override
TestPathExecutionResult assertMetadata(List<String> expectedKeys) {
def metadataKeys = html.select('#metadata td.key').collect() { it.text() }
def metadataKeys = html.select('.metadata td.key').collect() { it.text() }
assertThat(metadataKeys, equalTo(expectedKeys))
return this
}

@Override
TestPathExecutionResult assertMetadata(LinkedHashMap<String, String> expectedMetadata) {
def metadataKeys = html.select('#metadata td.key').collect() { it.text() }
def metadataRenderedValues = html.select('#metadata td.value').collect { it.html()}
def metadataKeys = html.select('.metadata td.key').collect() { it.text() }
def metadataRenderedValues = html.select('.metadata td.value').collect { it.html()}
def metadata = [metadataKeys, metadataRenderedValues].transpose().collectEntries { key, value -> [key, value] }
assertThat(metadata, equalTo(expectedMetadata))
return this
Expand Down

0 comments on commit a85bf44

Please sign in to comment.