From 4ef2db10e9dd03a8f4c367ad912266860c3f65ae Mon Sep 17 00:00:00 2001 From: antip00 Date: Fri, 25 Oct 2024 11:50:31 +0300 Subject: [PATCH] Update. --- tests/testflows/regression.py | 2 +- tests/testflows/tests/automated/e2e.py | 20 ++++++----- tests/testflows/tests/automated/sql_editor.py | 35 ++++++++++--------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/tests/testflows/regression.py b/tests/testflows/regression.py index f5ada3295..007436c8b 100755 --- a/tests/testflows/regression.py +++ b/tests/testflows/regression.py @@ -47,7 +47,7 @@ def argparser(parser): (Error, "https://github.com/Altinity/clickhouse-grafana/issues/630") ], "/Grafana Datasource Plugin For Clickhouse/sql editor/extrapolation toggle/":[ - (Error, "Run Query button do not update time ranges") + (Fail, "Run Query button do not update time ranges") ] } diff --git a/tests/testflows/tests/automated/e2e.py b/tests/testflows/tests/automated/e2e.py index de79aa84e..56c646cf7 100644 --- a/tests/testflows/tests/automated/e2e.py +++ b/tests/testflows/tests/automated/e2e.py @@ -22,15 +22,17 @@ def gh_api_check(self): with When("I go to clickhouse dashboard"): dashboards.open_dashboard(dashboard_name="gh-api") - for attempt in retries(delay=5, timeout=50): - with attempt: - with delay(): - with Then("I take screenshot of Pull request events for grafana/grafana panel"): - dashboard.take_screenshot_for_panel(panel_name="Pull request events for grafana/grafana", screenshot_name="gh-api_panel") - - with delay(): - with Then("I check graph contains data"): - assert actions.check_screenshot_contains_green(screenshot_name="gh-api_panel") is True, error() + + with Then("I check gh-api datasource works correctly"): + for attempt in retries(delay=5, timeout=50): + with attempt: + with delay(): + with Then("I take screenshot of Pull request events for grafana/grafana panel"): + dashboard.take_screenshot_for_panel(panel_name="Pull request events for grafana/grafana", screenshot_name="gh-api_panel") + + with delay(): + with Then("I check graph contains data"): + assert actions.check_screenshot_contains_green(screenshot_name="gh-api_panel") is True, error() @TestCheck diff --git a/tests/testflows/tests/automated/sql_editor.py b/tests/testflows/tests/automated/sql_editor.py index 1e52b5210..bd12fd899 100644 --- a/tests/testflows/tests/automated/sql_editor.py +++ b/tests/testflows/tests/automated/sql_editor.py @@ -307,29 +307,30 @@ def extrapolation_toggle(self): with Then("I click on run query button to see results"): with delay(): panel.click_run_query_button() + + with Then("I check extrapolation toggle works correctly"): + for attempt in retries(delay=10, count=12): + with attempt: + with When("I click on run query button to see results with turned on extrapolation"): + panel.click_run_query_button() - for attempt in retries(delay=10, count=12): - with attempt: - with When("I click on run query button to see results with turned on extrapolation"): - panel.click_run_query_button() + with When("I take screenshot with extrapolation"): + panel.take_screenshot_for_visualization(screenshot_name='extrapolation_toggle_on') - with When("I take screenshot with extrapolation"): - panel.take_screenshot_for_visualization(screenshot_name='extrapolation_toggle_on') + with When("I click on the extrapolation toggle to turn extrapolation off"): + sql_editor.click_extrapolation_toggle(query_name='A') - with When("I click on the extrapolation toggle to turn extrapolation off"): - sql_editor.click_extrapolation_toggle(query_name='A') + with When("I click on run query button to see results with turned off extrapolation"): + panel.click_run_query_button() - with When("I click on run query button to see results with turned off extrapolation"): - panel.click_run_query_button() + with When("I take screenshot without extrapolation"): + panel.take_screenshot_for_visualization(screenshot_name='extrapolation_toggle_off') - with When("I take screenshot without extrapolation"): - panel.take_screenshot_for_visualization(screenshot_name='extrapolation_toggle_off') + with When("I click on the extrapolation toggle to turn extrapolation on"): + sql_editor.click_extrapolation_toggle(query_name='A') - with When("I click on the extrapolation toggle to turn extrapolation on"): - sql_editor.click_extrapolation_toggle(query_name='A') - - with Then("I check screenshots are different"): - assert not(actions.compare_screenshots(screenshot_name_1='extrapolation_toggle_on', screenshot_name_2='extrapolation_toggle_off')) + with Then("I check screenshots are different"): + assert not(actions.compare_screenshots(screenshot_name_1='extrapolation_toggle_on', screenshot_name_2='extrapolation_toggle_off')) finally: with Finally("I return Step textfield and Resolution dropdown values back"):