From 978026b488778cb24dc23c1a2512531b7e9fede4 Mon Sep 17 00:00:00 2001 From: Sergej Herbert Date: Tue, 26 Dec 2023 12:04:24 +0100 Subject: [PATCH] test: add e2e tests for the annotations --- grafana_config/dashboards/alert.json | 622 +++++++++--------- .../dashboards/graph_and_variables.json | 22 +- .../dashboards/query_and_repitition.json | 589 ++++++----------- selenium/query_and_repetition.test.ts | 12 +- 4 files changed, 532 insertions(+), 713 deletions(-) diff --git a/grafana_config/dashboards/alert.json b/grafana_config/dashboards/alert.json index 8c42a90..0cd6a43 100644 --- a/grafana_config/dashboards/alert.json +++ b/grafana_config/dashboards/alert.json @@ -1,337 +1,321 @@ { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 2, - "links": [], - "panels": [ + "annotations": { + "list": [ { - "alert": { - "alertRuleTags": {}, - "conditions": [ - { - "evaluator": { - "params": [ - 0 - ], - "type": "gt" - }, - "operator": { - "type": "and" - }, - "query": { - "params": [ - "A", - "48h", - "now" - ] - }, - "reducer": { - "params": [], - "type": "avg" - }, - "type": "query" - } - ], - "executionErrorState": "alerting", - "for": "5m", - "frequency": "1m", - "handler": 1, - "name": "Old (not in range) alert alert", - "noDataState": "no_data", - "notifications": [] - }, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.3.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "queryText": "WITH base(time, value) AS (Values(11111,2), (33333,4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", - "queryType": "time series", - "rawQueryText": "WITH base(time, value) AS (Values(11111,2), (33333,4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", - "refId": "A", - "timeColumns": [ - "time" - ] - } - ], - "thresholds": [ + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "alert": { + "alertRuleTags": {}, + "conditions": [ { - "colorMode": "critical", - "fill": true, - "line": true, - "op": "gt", - "value": 0 + "evaluator": { + "params": [0], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": ["A", "48h", "now"] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" } ], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Old (not in range) alert", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" + "executionErrorState": "alerting", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Old (not in range) alert alert", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {} }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.3.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "queryText": "WITH base(time, value) AS (Values(11111,2), (33333,4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", + "queryType": "time series", + "rawQueryText": "WITH base(time, value) AS (Values(11111,2), (33333,4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", + "refId": "A", + "timeColumns": ["time"] + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 0 + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Old (not in range) alert", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "evaluator": { + "params": [1], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": ["A", "48h", "now"] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" } ], - "yaxis": { - "align": false, - "alignLevel": null - } + "executionErrorState": "alerting", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "New (in range) alert alert", + "noDataState": "no_data", + "notifications": [] }, - { - "alert": { - "alertRuleTags": {}, - "conditions": [ - { - "evaluator": { - "params": [ - 1 - ], - "type": "gt" - }, - "operator": { - "type": "and" - }, - "query": { - "params": [ - "A", - "48h", - "now" - ] - }, - "reducer": { - "params": [], - "type": "avg" - }, - "type": "query" - } - ], - "executionErrorState": "alerting", - "for": "5m", - "frequency": "1m", - "handler": 1, - "name": "New (in range) alert alert", - "noDataState": "no_data", - "notifications": [] - }, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fieldConfig": { - "defaults": { - "custom": { - "align": null, - "filterable": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null, + "filterable": false }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "hiddenSeries": false, - "id": 3, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.3.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "queryText": "WITH base(time, value) AS (Values(11111,2), (cast(strftime('%s','now', '-5 minutes') as integer),4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", - "queryType": "time series", - "rawQueryText": "WITH base(time, value) AS (Values(11111,2), (cast(strftime('%s','now', '-5 minutes') as integer),4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", - "refId": "A", - "timeColumns": [ - "time" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } ] } - ], - "thresholds": [ - { - "colorMode": "critical", - "fill": true, - "line": true, - "op": "gt", - "value": 1 - } - ], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "New (in range) alert", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.3.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "queryText": "WITH base(time, value) AS (Values(11111,2), (cast(strftime('%s','now', '-5 minutes') as integer),4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", + "queryType": "time series", + "rawQueryText": "WITH base(time, value) AS (Values(11111,2), (cast(strftime('%s','now', '-5 minutes') as integer),4))\nSELECT * FROM base\nWHERE time > $__from / 1000 AND time <= $__to / 1000", + "refId": "A", + "timeColumns": ["time"] + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 1 + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "New (in range) alert", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true } + ], + "yaxis": { + "align": false, + "alignLevel": null } - ], - "refresh": false, - "schemaVersion": 26, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Alert Test", - "uid": "y7EuI6m7z", - "version": 3 - } \ No newline at end of file + } + ], + "refresh": false, + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Alert Test", + "uid": "y7EuI6m7z", + "version": 3 +} diff --git a/grafana_config/dashboards/graph_and_variables.json b/grafana_config/dashboards/graph_and_variables.json index 44ec60e..abb3ca7 100644 --- a/grafana_config/dashboards/graph_and_variables.json +++ b/grafana_config/dashboards/graph_and_variables.json @@ -88,9 +88,7 @@ "queryType": "table", "rawQueryText": "SELECT $__unixEpochGroupSeconds(time, $intervalS) as window, avg(value)\nFROM sine_wave\nWHERE time > $__from / 1000 and time <= $__to / 1000\nGROUP BY 1\nORDER BY 1 asc", "refId": "A", - "timeColumns": [ - "window" - ] + "timeColumns": ["window"] } ], "thresholds": [], @@ -175,9 +173,7 @@ "queryText": "SELECT 1 as time, 4 as value where time >= 1234 and time < 134567", "rawQueryText": "SELECT avg(value), max(value), min(value) from sine_wave where time >= $__from / 1000 and time < $__to / 1000", "refId": "A", - "timeColumns": [ - "time" - ] + "timeColumns": ["time"] } ], "timeFrom": null, @@ -220,20 +216,10 @@ "to": "1992-12-13T01:00:00.000Z" }, "timepicker": { - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] + "refresh_intervals": ["10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"] }, "timezone": "", "title": "Sine Wave Example", "uid": "U6rjzWDMz", "version": 2 -} \ No newline at end of file +} diff --git a/grafana_config/dashboards/query_and_repitition.json b/grafana_config/dashboards/query_and_repitition.json index 368fd8f..db36196 100644 --- a/grafana_config/dashboards/query_and_repitition.json +++ b/grafana_config/dashboards/query_and_repitition.json @@ -1,388 +1,227 @@ { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 3, - "iteration": 1626602396963, - "links": [], - "panels": [ + "annotations": { + "list": [ { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.3.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "queryText": "with data(time, temperature, city) AS (VALUES\n(724125600, 10, 'London'), (724161600, 11, 'London'),\n(724161600, 20, 'New York'), (724197600, 21, 'New York'),\n(724125600, 25, 'Washington'), (724197600, 26, 'Washington')\n) SELECT * from data\nWHERE city in ('London','New York','Washington')\norder by time", - "queryType": "time series", - "rawQueryText": "with data(time, temperature, city) AS (VALUES\n(724125600, 10, 'London'), (724161600, 11, 'London'),\n(724161600, 20, 'New York'), (724197600, 21, 'New York'),\n(724125600, 25, 'Washington'), (724197600, 26, 'Washington')\n) SELECT * from data\nWHERE city in (${cities:singlequote})\norder by time", - "refId": "A", - "timeColumns": [ - "time" - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Time Series With Query Variable", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] + "builtIn": 1, + "datasource": "sqlite", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "queryText": "with data(time, text, city) AS (VALUES\n(724125600, 'annotation London', 'London'),\n(724161600, 'annotation New York', 'New York'),\n(724197600, 'annotation Washington', 'Washington')\n) SELECT * from data\nWHERE city in (${cities:singlequote})\norder by time", + "queryType": "table", + "rawQueryText": "with data(time, text, city) AS (VALUES\n(724125600, 'annotation London', 'London'),\n(724161600, 'annotation New York', 'New York'),\n(724197600, 'annotation Washington', 'Washington')\n) SELECT * from data\nWHERE city in (${cities:singlequote})\norder by time", + "tags": [], + "timeColumns": ["time"], + "type": "dashboard" }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 3, + "iteration": 1703583147864, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.0", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "queryText": "with data(time, temperature, city) AS (VALUES\n(724125600, 10, 'London'), (724161600, 11, 'London'),\n(724161600, 20, 'New York'), (724197600, 21, 'New York'),\n(724125600, 25, 'Washington'), (724197600, 26, 'Washington')\n) SELECT * from data\nWHERE city in (${cities:singlequote})\norder by time", + "queryType": "time series", + "rawQueryText": "with data(time, temperature, city) AS (VALUES\n(724125600, 10, 'London'), (724161600, 11, 'London'),\n(724161600, 20, 'New York'), (724197600, 21, 'New York'),\n(724125600, 25, 'Washington'), (724197600, 26, 'Washington')\n) SELECT * from data\nWHERE city in (${cities:singlequote})\norder by time", + "refId": "A", + "timeColumns": ["time"] } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time Series With Query Variable", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {}, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 0, - "y": 10 - }, - "id": 8, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^data$/", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "7.3.3", - "repeat": "cities", - "repeatDirection": "h", - "scopedVars": { - "cities": { - "selected": true, - "text": "London", - "value": "London" - } - }, - "targets": [ - { - "queryText": "\n SELECT CAST(strftime('%s', 'now', '-1 minute') as INTEGER) as time, 4 as value\n WHERE time >= 1234 and time < 134567\n ", - "queryType": "table", - "rawQueryText": "SELECT '$cities' as data ", - "refId": "A", - "timeColumns": [] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "$cities", - "type": "stat" + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {}, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 8, - "y": 10 - }, - "id": 9, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^data$/", - "values": false - }, - "textMode": "auto" + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true }, - "pluginVersion": "7.3.3", - "repeatDirection": "h", - "repeatIteration": 1626602396963, - "repeatPanelId": 8, - "scopedVars": { - "cities": { - "selected": true, - "text": "New York", - "value": "New York" + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } }, - "targets": [ - { - "queryText": "\n SELECT CAST(strftime('%s', 'now', '-1 minute') as INTEGER) as time, 4 as value\n WHERE time >= 1234 and time < 134567\n ", - "queryType": "table", - "rawQueryText": "SELECT '$cities' as data ", - "refId": "A", - "timeColumns": [] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "$cities", - "type": "stat" + "overrides": [] }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {}, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 16, - "y": 10 - }, - "id": 10, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^data$/", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "7.3.3", - "repeatDirection": "h", - "repeatIteration": 1626602396963, - "repeatPanelId": 8, - "scopedVars": { - "cities": { - "selected": true, - "text": "Washington", - "value": "Washington" - } + "gridPos": { + "h": 4, + "w": 8, + "x": 0, + "y": 10 + }, + "id": 8, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^data$/", + "values": false }, - "targets": [ - { - "queryText": "\n SELECT CAST(strftime('%s', 'now', '-1 minute') as INTEGER) as time, 4 as value\n WHERE time >= 1234 and time < 134567\n ", - "queryType": "table", - "rawQueryText": "SELECT '$cities' as data ", - "refId": "A", - "timeColumns": [] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "$cities", - "type": "stat" - } - ], - "refresh": false, - "schemaVersion": 26, - "style": "dark", - "tags": [], - "templating": { - "list": [ + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.1.0", + "repeat": "cities", + "repeatDirection": "h", + "targets": [ { - "allValue": null, - "current": { - "selected": true, - "text": [ - "London", - "New York", - "Washington" - ], - "value": [ - "London", - "New York", - "Washington" - ] - }, - "datasource": "sqlite", - "definition": "SELECT * FROM (VALUES ('London'), ('New York'), ('Washington'))", - "error": null, - "hide": 0, - "includeAll": false, - "label": "Cities", - "multi": true, - "name": "cities", - "options": [], - "query": "SELECT * FROM (VALUES ('London'), ('New York'), ('Washington'))", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + "queryText": "\n SELECT CAST(strftime('%s', 'now', '-1 minute') as INTEGER) as time, 4 as value\n WHERE time >= 1234 and time < 134567\n ", + "queryType": "table", + "rawQueryText": "SELECT '$cities' as data ", + "refId": "A", + "timeColumns": [] } - ] - }, - "time": { - "from": "1992-12-11T21:00:00.000Z", - "to": "1992-12-13T01:00:00.000Z" - }, - "timepicker": { - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Query Variables and Repetition", - "uid": "jng4Dei7k", - "version": 2 - } \ No newline at end of file + ], + "timeFrom": null, + "timeShift": null, + "title": "$cities", + "type": "stat" + } + ], + "refresh": false, + "schemaVersion": 30, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": false, + "text": ["Washington", "London", "New York"], + "value": ["Washington", "London", "New York"] + }, + "datasource": "sqlite", + "definition": "SELECT * FROM (VALUES ('London'), ('New York'), ('Washington'))", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Cities", + "multi": true, + "name": "cities", + "options": [], + "query": "SELECT * FROM (VALUES ('London'), ('New York'), ('Washington'))", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "1992-12-11T21:00:00.000Z", + "to": "1992-12-13T01:00:00.000Z" + }, + "timepicker": { + "refresh_intervals": ["10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"] + }, + "timezone": "", + "title": "Query Variables and Repetition", + "uid": "jng4Dei7k", + "version": 5 +} diff --git a/selenium/query_and_repetition.test.ts b/selenium/query_and_repetition.test.ts index f1279fb..ee27796 100644 --- a/selenium/query_and_repetition.test.ts +++ b/selenium/query_and_repetition.test.ts @@ -50,7 +50,17 @@ describe('query variables and repetition', () => { await driver.findElement(By.xpath(`//div[contains(@class, 'refresh-picker')]//button`)).click(); cityPanels = await driver.findElements(By.xpath(`(${v7_3_panel_aria_label} | ${v8_1_panel_aria_label})`)); - expect(cityPanels).toHaveLength(2); + }) + ); + + it( + 'shows annotations', + saveTestState(testStatus, async () => { + const annotationMarker = await driver.findElement( + By.css(`div.graph-panel__chart div.events_line.flot-temp-elem div`) + ); + await driver.actions({ async: true }).move({ origin: annotationMarker }).perform(); + await driver.findElement(By.css(`div.drop-popover--annotation`)); }) ); });