Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
antip00 committed Oct 25, 2024
1 parent 5812dc9 commit 4ef2db1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tests/testflows/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
]
}

Expand Down
20 changes: 11 additions & 9 deletions tests/testflows/tests/automated/e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 18 additions & 17 deletions tests/testflows/tests/automated/sql_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 4ef2db1

Please sign in to comment.