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

Full page image: Fix wait condition for dashboard with rows #542

Merged
merged 6 commits into from
Jul 15, 2024
Merged
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
59 changes: 40 additions & 19 deletions scripts/drone/provisioning/dashboards/all-panels.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
"id": 3,
"links": [],
"panels": [
{
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 13,
"title": "Main row",
"type": "row"
},
{
"datasource": {
"type": "grafana-testdata-datasource",
Expand All @@ -30,7 +41,7 @@
"h": 9,
"w": 6,
"x": 0,
"y": 0
"y": 1
},
"id": 12,
"options": {
Expand All @@ -42,7 +53,7 @@
"content": "# Test dashboard\n\nThis dashboard is aiming to test most panels with the grafana-image-renderer.",
"mode": "markdown"
},
"pluginVersion": "10.4.3",
"pluginVersion": "11.2.0-pre",
"title": "Text panel",
"type": "text"
},
Expand Down Expand Up @@ -86,7 +97,7 @@
"h": 9,
"w": 10,
"x": 6,
"y": 0
"y": 1
},
"id": 10,
"options": {
Expand Down Expand Up @@ -136,7 +147,11 @@
"tooltip": false,
"viz": false
},
"lineWidth": 1
"lineWidth": 1,
"stacking": {
"group": "A",
"mode": "none"
}
},
"mappings": [],
"thresholds": {
Expand All @@ -159,7 +174,7 @@
"h": 9,
"w": 8,
"x": 16,
"y": 0
"y": 1
},
"id": 11,
"options": {
Expand All @@ -168,6 +183,10 @@
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
Expand Down Expand Up @@ -208,7 +227,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 9
"y": 10
},
"id": 9,
"options": {
Expand Down Expand Up @@ -245,7 +264,7 @@
"reverse": false
}
},
"pluginVersion": "10.4.3",
"pluginVersion": "11.2.0-pre",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -302,7 +321,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 9
"y": 10
},
"id": 8,
"options": {
Expand Down Expand Up @@ -365,7 +384,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 17
"y": 18
},
"id": 4,
"options": {
Expand All @@ -383,7 +402,7 @@
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "10.4.3",
"pluginVersion": "11.2.0-pre",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -423,7 +442,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 17
"y": 18
},
"id": 5,
"options": {
Expand Down Expand Up @@ -490,7 +509,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 25
"y": 26
},
"id": 7,
"options": {
Expand All @@ -511,7 +530,7 @@
"sizing": "auto",
"valueMode": "color"
},
"pluginVersion": "10.4.3",
"pluginVersion": "11.2.0-pre",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -578,7 +597,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 25
"y": 26
},
"id": 2,
"options": {
Expand Down Expand Up @@ -647,14 +666,15 @@
"h": 8,
"w": 12,
"x": 0,
"y": 33
"y": 34
},
"id": 3,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
Expand All @@ -666,7 +686,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "10.4.3",
"pluginVersion": "11.2.0-pre",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -719,7 +739,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 33
"y": 34
},
"id": 6,
"options": {
Expand All @@ -734,7 +754,7 @@
},
"showHeader": true
},
"pluginVersion": "10.4.3",
"pluginVersion": "11.2.0-pre",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -766,6 +786,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
Expand Down Expand Up @@ -812,7 +833,7 @@
"h": 9,
"w": 24,
"x": 0,
"y": 41
"y": 42
},
"id": 1,
"options": {
Expand Down
3 changes: 2 additions & 1 deletion src/browser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ async function waitForQueriesAndVisualizations(page: puppeteer.Page, options: Im
}
});

const totalPanelsRendered = panelsRenderedCount + document.querySelectorAll('.dashboard-row').length;
const rowCount = document.querySelectorAll('.dashboard-row').length || document.querySelectorAll("[data-testid='dashboard-row-container']").length
const totalPanelsRendered = panelsRenderedCount + rowCount;
return totalPanelsRendered >= panelCount;
}

Expand Down
Binary file modified tests/testdata/full-page-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.