Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ gem "jekyll", "~> 4.4.1"

gem "jekyll-report-dashboard"

group :jekyll_plugins do
gem "jekyll-tailwindcss"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
Expand Down
17 changes: 9 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ GEM
ffi (1.17.1-x86_64-linux-gnu)
ffi (1.17.1-x86_64-linux-musl)
forwardable-extended (2.6.0)
google-protobuf (4.30.1)
google-protobuf (4.30.2)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-aarch64-linux)
google-protobuf (4.30.2-aarch64-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-arm64-darwin)
google-protobuf (4.30.2-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-x86-linux)
google-protobuf (4.30.2-x86-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-x86_64-darwin)
google-protobuf (4.30.2-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-x86_64-linux)
google-protobuf (4.30.2-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
Expand All @@ -64,7 +64,9 @@ GEM
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-report-dashboard (0.1.0)
jekyll-report-dashboard (0.1.7)
jekyll (~> 4.4.1)
jekyll-tailwindcss
jekyll-sass-converter (3.1.0)
sass-embedded (~> 1.75)
jekyll-tailwindcss (0.6.2)
Expand Down Expand Up @@ -162,7 +164,6 @@ DEPENDENCIES
http_parser.rb (~> 0.6.0)
jekyll (~> 4.4.1)
jekyll-report-dashboard
jekyll-tailwindcss
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1)
Expand Down
14 changes: 13 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ github_username: thetif
github_url: "https://github.com/FearlessSolutions/publish-playwright"

# Build settings
# theme:
theme: jekyll-report-dashboard
# plugins:

coverage:
pass:
lines: 90
functions: 85
statements: 90
branches: 80
fail:
lines: 70
functions: 65
statements: 70
branches: 60

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
Expand Down
11 changes: 0 additions & 11 deletions _data/coverage/thresholds.yml

This file was deleted.

11 changes: 10 additions & 1 deletion _includes/coverage-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@
<!-- Liquid provides a helper method to capitalize text -->
{{ name | capitalize }}
</div>
{%- capture status -%}
{%- if values.pct >= site.coverage.pass.[name] -%}
text-pass
{%- elsif values.pct > site.coverage.fail.[name] -%}
text-warn
{%- else -%}
text-fail
{%- endif -%}
{%- endcapture -%}
<!-- use the custom coverage_status filter with the stat name to get the correct styling for the percent -->
<div class="font-bold text-xl @sm:text-2xl @md:text-3xl @lg:text-4xl {{ values.pct | coverage_status: name }}">
<div class="font-bold text-xl @sm:text-2xl @md:text-3xl @lg:text-4xl {{ status }}">
<!-- Liquid provides a helper method for rounding floats to a number -->
{{ values.pct | round: 1 }}%
</div>
Expand Down
9 changes: 7 additions & 2 deletions _includes/playwright-branch-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ <h3 class="mb-0">{{ branch_name }}</h3>
<a href="{{ branch_link | relative_url }}">View Previous Runs</a>
</div>

<!-- use the custom key_list filter to get all of the run_ids in the branch, then reverse the list and get the first one -->
{% assign latest_run_id = site.data.playwright-reports.branches[branch_name] | key_list | reverse | first %}
<!-- get all of the run_ids in the branch, then reverse the list and get the first one -->
{% assign runs = "" | split: ',' %}
{% for run_id in site.data.playwright-reports.branches[branch_name] %}
{% assign runs = runs | push: run_id %}
{% endfor %}

{% assign latest_run_id = runs | reverse | first %}
{% assign data = site.data.playwright-reports.branches[branch_name][latest_run_id] %}
<!-- capture creates a link to the actual report file-->
{% capture report_link %}/playwright-reports/branches/{{branch_name}}/{{latest_run_id}}.html{% endcapture %}
Expand Down
37 changes: 26 additions & 11 deletions _includes/playwright-summary.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if include.data %}
<!-- use the custom normalize_playwright filter to get the status, total number of tests, errors, and test statistics from the data -->
{% assign results = include.data | normalize_playwright %}
<!-- if the data was included, display the summary -->
{% assign results = include.data %}
{% assign total = results.stats.expected + results.stats.unexpected + results.stats.skipped + results.stats.flaky %}
<div class="@container flex flex-col mb-8">
<div class="mt-4 py-1 @sm:py-2 px-2 @sm:px-4 font-light text-[0.6rem] @sm:text-xs text-tertiary border border-outline border-b-0 rounded-t-md bg-highlight flex flex-row justify-between">
<!-- if the run_id was included, display it in the header of the summary -->
Expand All @@ -14,13 +14,28 @@
<span></span>
{% endif %}
<!-- Liquid provides a helper method for formatting dates -->
<span>Run At: {{ results.startTime | date: "%Y-%m-%d %H:%M %Z" }}</span>
<span>Run At: {{ results.stats.startTime | date: "%Y-%m-%d %H:%M %Z" }}</span>
</div>
<div class="pt-2 @sm:pt-4 pb-1 @sm:pb-2 text-xs @sm:text-sm leading-normal border border-outline rounded-b-md flex items-center justify-around">
<!-- style the icon according to the report status and use the custom status_icon filter to return the correct svg -->
<span class="w-10 @sm:w-12 h-10 @sm:h-12 {{results.status}}">{{ results.status | status_icon }}</span>
<!-- style the icon according to the report status and use the correct svg -->
{% capture status_icon %}
{% if results.stats.unexpected > 0 %}
<svg aria-hidden='true' class="fill-fail' height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
<path fillRule='evenodd' d='M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z'></path>
</svg>
{% elsif results.errors.size == 0 %}
<svg aria-hidden='true' class="fill-pass" height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
<path fillRule='evenodd' d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'></path>
</svg>
{% else %}
<svg aria-hidden='true' class="fill-warn" height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
<path fillRule='evenodd' d='M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z'></path>
</svg>
{% endif %}
{% endcapture %}
<span class="w-10 @sm:w-12 h-10 @sm:h-12">{{ status_icon }}</span>
<div class="py-1 @md:py-2 w-2/3 @sm:w-4/5">
{% if results.status == "warn" %}
{% if status == "warn" %}
<!-- if there are errors, there won't be any test statistics, so only display the errors -->
<div class="py-1 @md:py-2 px-0 font-mono flex flex-col gap-4">
{% for error in results.errors %}
Expand All @@ -31,11 +46,11 @@
{% else %}
<!-- if there are no errors, display the test statistics -->
<div class="min-w-full font-medium leading-8 grid grid-cols-1 grid-rows-5 @lg:grid-cols-5 @lg:grid-rows-1 justify-center">
{% include playwright-stat.html label="All" value=results.total %}
{% include playwright-stat.html label="Passed" value=results.expected %}
{% include playwright-stat.html label="Failed" value=results.unexpected %}
{% include playwright-stat.html label="Flaky" value=results.flaky %}
{% include playwright-stat.html label="Skipped" value=results.skipped %}
{% include playwright-stat.html label="All" value=total %}
{% include playwright-stat.html label="Passed" value=results.stats.expected %}
{% include playwright-stat.html label="Failed" value=results.stats.unexpected %}
{% include playwright-stat.html label="Flaky" value=results.stats.flaky %}
{% include playwright-stat.html label="Skipped" value=results.stats.skipped %}
</div>
{% endif %}

Expand Down
1 change: 1 addition & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: default
---

<article>

<header class="mb-8">
Expand Down
9 changes: 7 additions & 2 deletions _layouts/playwright-branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
layout: page
---

<!-- use the custom key_list filter to get the run ids for the branch and sort them by newest to oldest -->
{% assign run_ids = site.data.playwright-reports.branches[page.branch] | key_list | reverse %}
<!-- get the run ids for the branch and sort them by newest to oldest -->
{% assign unsorted_runs = "" | split: ',' %}
{% for run_id in site.data.playwright-reports.branches[page.branch] %}
{% assign unsorted_runs = unsorted_runs | push: run_id %}
{% endfor %}

{% assign run_ids = unsorted_runs | reverse %}
{% for run_id in run_ids %}
<!-- loop through the run ids -->
{% assign data = site.data.playwright-reports.branches[page.branch][run_id] %}
Expand Down
1 change: 1 addition & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: default
---

<article>

<header class="mb-8">
Expand Down
15 changes: 0 additions & 15 deletions _plugins/coverage-results-filter.rb

This file was deleted.

22 changes: 0 additions & 22 deletions _plugins/icon-filter.rb

This file was deleted.

14 changes: 0 additions & 14 deletions _plugins/key-list-filter.rb

This file was deleted.

10 changes: 7 additions & 3 deletions _plugins/playwright-branch-index-generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ def initialize(site, base, dir, branch)
@dir = dir
@name = 'index.html'

self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'playwright-branch.html')
self.data['branch'] = branch
process(@name)

@data = site.layouts['playwright-branch'].data
@content = site.layouts['playwright-branch'].content

@data['branch'] = branch
@data['title'] = branch
end
end

Expand Down
36 changes: 0 additions & 36 deletions _plugins/playwright-results-filter.rb

This file was deleted.

16 changes: 4 additions & 12 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
--color-highlight: var(--color-gray-100);
--color-outline: var(--color-gray-300);

--color-pass: var(--color-green-700);
--color-fail: var(--color-red-600);
--color-warn: var(--color-amber-400);

--breakpoint-sm: 40rem; /* 640px */
--breakpoint-md: 48rem; /* 768px */
--breakpoint-lg: 64rem; /* 1024px */
Expand Down Expand Up @@ -214,18 +218,6 @@
}
}

.pass {
color: var(--color-green-700);
}

.fail {
color: var(--color-red-600);
}

.warn {
color: var(--color-amber-400);
}

.gh-markdown-content {
width: 100%;
overflow-x: auto;
Expand Down
1 change: 1 addition & 0 deletions playwright-branches.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: page
# the header for the page
title: "Playwright Reports for Branches"
# the link to page https://jekyllrb.com/docs/permalinks/
Expand Down