Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test-case-reporting] Make test run list page prettier with CSS #965

Merged
merged 16 commits into from
Aug 10, 2020
Merged
10 changes: 8 additions & 2 deletions test-case-reporting/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ app.get('/test-results/build/:buildNumber', async (req, res) => {
res.send(
render('test-run-list', {
title: `Test Runs for Build #${buildNumber}`,
testRuns,
testRuns: testRuns.map((testRun, index) => ({
testRun,
index,
})),
})
);
}
Expand All @@ -128,7 +131,10 @@ app.get('/test-results/history/:testCaseId', async (req, res) => {
res.send(
render('test-run-list', {
title: `Test Runs for test case "${testCaseName}"`,
testRuns,
testRuns: testRuns.map((testRun, index) => ({
testRun,
index,
})),
Rafer45 marked this conversation as resolved.
Show resolved Hide resolved
})
);
}
Expand Down
30 changes: 17 additions & 13 deletions test-case-reporting/static/build-list.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- Surface style taken from https://github.com/niutech/amp-surface -->
<link rel="stylesheet" type="text/css" href="/surface.min.css"/>
</head>
<body>
<h1>{{title}}</h1>
<ul>
{{#builds}}
<li>
<a href="/test-results/build/{{buildNumber}}">Build {{buildNumber}}</a>, started at {{startedAt}}
</li>
{{/builds}}
{{^builds}}
<li>
There are no builds.
</li>
{{/builds}}
</ul>
<div class="g--10 m--1">
<div class="g--8 g-s--12 center">
<h1>{{title}}</h1>
{{#builds}}
<div class="tile">
<a href="/test-results/build/{{buildNumber}}">Build {{buildNumber}}</a>, started at {{startedAt}}
</div>
{{/builds}}
{{^builds}}
There are no builds.
{{/builds}}
</div>
</div>
</body>
</html>
8 changes: 4 additions & 4 deletions test-case-reporting/static/test-run-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<h1>{{title}}</h1>
{{#testRuns}}
<div class="collapsible-wrap card no-pad">
<input type="checkbox" id="collapsible-{{testCase.id}}-{{build.buildNumber}}">
<label for="collapsible-{{testCase.id}}-{{build.buildNumber}}"><a href="/test-results/history/{{testCase.id}}">{{testCase.name}}</a>&nbsp;had status {{status}}</label>
<div class="collapsible-{{testCase.id}}-{{build.buildNumber}}-area">
<input type="checkbox" id="collapsible-{{index}}">
<label for="collapsible-{{index}}"><a href="/test-results/history/{{testRun.testCase.id}}">{{testRun.testCase.name}}</a>&nbsp;had status {{testRun.status}}</label>
<div class="collapsible-{{index}}-area">
<p>Job num is {{job.jobNumber}}</p>
<p>Build num is <a href="/test-results/build/{{job.build.buildNumber}}">{{job.build.buildNumber}}</a></p>
<p>Build num is <a href="/test-results/build/{{testRun.job.build.buildNumber}}">{{testRun.job.build.buildNumber}}</a></p>
</div>
</div>
{{/testRuns}}
Expand Down