-
-
{{ results.status | status_icon }}
+
+ {% capture status_icon %}
+ {% if results.stats.unexpected > 0 %}
+
+ {% else %}
+
+ {% endif %}
+ {% endcapture %}
+
{{ status_icon }}
- {% if results.status == "warn" %}
+ {% if status == "warn" %}
{% for error in results.errors %}
@@ -31,11 +46,11 @@
{% else %}
- {% 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 %}
{% endif %}
diff --git a/_layouts/page.html b/_layouts/page.html
index 156621f..2486cdc 100644
--- a/_layouts/page.html
+++ b/_layouts/page.html
@@ -1,6 +1,7 @@
---
layout: default
---
+
diff --git a/_layouts/playwright-branch.html b/_layouts/playwright-branch.html
index e555cb0..42f1480 100644
--- a/_layouts/playwright-branch.html
+++ b/_layouts/playwright-branch.html
@@ -2,8 +2,13 @@
layout: page
---
-
-{% assign run_ids = site.data.playwright-reports.branches[page.branch] | key_list | reverse %}
+
+{% 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 %}
{% assign data = site.data.playwright-reports.branches[page.branch][run_id] %}
diff --git a/_layouts/post.html b/_layouts/post.html
index 39526d2..946da3d 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -1,6 +1,7 @@
---
layout: default
---
+
diff --git a/_plugins/coverage-results-filter.rb b/_plugins/coverage-results-filter.rb
deleted file mode 100644
index 49e02f8..0000000
--- a/_plugins/coverage-results-filter.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Jekyll
- module CoverageResultFilter
- def coverage_status(input, name)
- if input >= @context.registers[:site].data["coverage"]["thresholds"]["pass"][name]
- "pass"
- elsif input >= @context.registers[:site].data["coverage"]["thresholds"]["fail"][name]
- "warn"
- else
- "fail"
- end
- end
- end
-end
-
-Liquid::Template.register_filter(Jekyll::CoverageResultFilter)
diff --git a/_plugins/icon-filter.rb b/_plugins/icon-filter.rb
deleted file mode 100644
index 7b8dd51..0000000
--- a/_plugins/icon-filter.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Jekyll
- module IconFilter
- def status_icon(input)
- case input
- when "pass"
- ""
- when "fail"
- ""
- when "warn"
- ""
- end
- end
- end
-end
-
-Liquid::Template.register_filter(Jekyll::IconFilter)
diff --git a/_plugins/key-list-filter.rb b/_plugins/key-list-filter.rb
deleted file mode 100644
index 743cff9..0000000
--- a/_plugins/key-list-filter.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module Jekyll
- module KeyFilter
- def key_list(input)
- return if input.nil?
- keys = []
- input.each_key do |key|
- keys.push(key)
- end
- keys
- end
- end
-end
-
-Liquid::Template.register_filter(Jekyll::KeyFilter)
diff --git a/_plugins/playwright-branch-index-generator.rb b/_plugins/playwright-branch-index-generator.rb
index 9acffdb..c9658d4 100644
--- a/_plugins/playwright-branch-index-generator.rb
+++ b/_plugins/playwright-branch-index-generator.rb
@@ -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
diff --git a/_plugins/playwright-results-filter.rb b/_plugins/playwright-results-filter.rb
deleted file mode 100644
index 87bd36b..0000000
--- a/_plugins/playwright-results-filter.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module Jekyll
- module PlaywrightResultFilter
- def normalize_playwright(input)
- status = playwright_status(input)
- total = playwright_total(input)
- stats = input["stats"]
- stats["errors"] = input["errors"]
- stats["total"] = total
- stats["status"] = status
- stats
- end
-
- def playwright_total(input)
- if input["errors"].size > 0
- 0
- else
- input["stats"]["expected"] + input["stats"]["unexpected"] + input["stats"]["skipped"] + input["stats"]["flaky"]
- end
- end
-
- def playwright_status(input)
- if input["stats"]["unexpected"] > 0
- # if the unexpected results is greater than one, return fail
- "fail"
- elsif input["errors"].size == 0
- # if there are no unexpected results and no errors, return pass
- "pass"
- else
- # otherwise if there are errors, return error
- "warn"
- end
- end
- end
-end
-
-Liquid::Template.register_filter(Jekyll::PlaywrightResultFilter)
diff --git a/assets/css/styles.css b/assets/css/styles.css
index 4e8957a..f3b42b9 100644
--- a/assets/css/styles.css
+++ b/assets/css/styles.css
@@ -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 */
@@ -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;
diff --git a/playwright-branches.markdown b/playwright-branches.markdown
index f91bbd3..fe83e1e 100644
--- a/playwright-branches.markdown
+++ b/playwright-branches.markdown
@@ -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/