Skip to content

Commit

Permalink
fixing absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
T0ine34 committed Apr 21, 2024
1 parent 72fc2ae commit a46fc1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
14 changes: 8 additions & 6 deletions tests-exporter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def build_index(summary : Summary):
details=details_html
)

header = load_template("resources/common/header.template.html")
header = load_template("resources/common/header.template.html", pathToRoot = ".")
footer = load_template("resources/common/footer.template.html",
datetime=datetime.now(UTC).strftime("%Y-%m-%d %H:%M:%S %Z")
)
Expand Down Expand Up @@ -227,7 +227,7 @@ def build_suite_index(suite : Suite):
specList=specs
)

header = load_template("resources/common/header.template.html")
header = load_template("resources/common/header.template.html", pathToRoot="..")
footer = load_template("resources/common/footer.template.html")

#load the main template
Expand Down Expand Up @@ -262,13 +262,14 @@ def build_suite_list(suites : list[Suite]):
fileName=suite.filename,
duration=build_durations_list(suite.duration),
bars = bars,
details=f"/suites/{suite.id}.html"
details=f"suites/{suite.id}.html",
pathToRoot=".."
)
suiteList += suite_html

suiteListPage = load_template("resources/suiteslist/page.template.html", suiteList=suiteList)

header = load_template("resources/common/header.template.html")
header = load_template("resources/common/header.template.html", pathToRoot="..")
footer = load_template("resources/common/footer.template.html",
datetime=datetime.now().strftime("%Y-%m-%d %H:%M:%S %Z")
)
Expand All @@ -283,7 +284,8 @@ def build_spec_inline(spec : Spec):
suite=spec.parentSuite.fullName if spec.parentSuite.id != "orphans" else "",
name=spec.fullName,
statusBadge=build_status_badge(getStatusTotal(spec.status)),
details="/suites/" + spec.parentSuite.id + ".html#" + spec.id
details="suites/" + spec.parentSuite.id + ".html#" + spec.id,
pathToRoot=".."
)
return spec_html

Expand All @@ -294,7 +296,7 @@ def build_spec_list(specs : list[Spec]):

specListPage = load_template("resources/specslist/page.template.html", specList=specList)

header = load_template("resources/common/header.template.html")
header = load_template("resources/common/header.template.html", pathToRoot="..")
footer = load_template("resources/common/footer.template.html",
datetime=datetime.now().strftime("%Y-%m-%d %H:%M:%S %Z")
)
Expand Down
6 changes: 3 additions & 3 deletions tests-exporter/resources/common/header.template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="navbar rounded-lg bg-base-100 shadow-lg bg-opacity-60 backdrop-blur-md">
<div class="flex-1">
<a class="btn btn-ghost text-xl" href="/index.html">Home</a>
<a class="btn btn-ghost text-xl" href="/suites/index.html">Suites List</a>
<a class="btn btn-ghost text-xl" href="/specs/index.html">Specs List</a>
<a class="btn btn-ghost text-xl" href="{{pathToRoot}}/index.html">Home</a>
<a class="btn btn-ghost text-xl" href="{{pathToRoot}}/suites/index.html">Suites List</a>
<a class="btn btn-ghost text-xl" href="{{pathToRoot}}/specs/index.html">Specs List</a>
</div>
</div>
2 changes: 1 addition & 1 deletion tests-exporter/resources/specslist/spec.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<td>{{suite}}</td>
<td>{{name}}</td>
<td>{{statusBadge}}</td>
<td><a class="btn btn-outline btn-info" href="{{details}}">Details</a></td>
<td><a class="btn btn-outline btn-info" href="{{pathToRoot}}/{{details}}">Details</a></td>
</tr>
2 changes: 1 addition & 1 deletion tests-exporter/resources/suiteslist/suite.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
{{bars}}
</div>
<a class="btn btn-outline btn-info" href="{{details}}">Details</a>
<a class="btn btn-outline btn-info" href="{{pathToRoot}}/{{details}}">Details</a>
</div>
</div>
</details>

0 comments on commit a46fc1b

Please sign in to comment.