Skip to content

Commit

Permalink
Merge pull request #665 from antip00/fixing-extrapolation-test
Browse files Browse the repository at this point in the history
Fixing tests for extrapolation toggle to be stable.
  • Loading branch information
Slach authored Nov 18, 2024
2 parents e4fad2e + c8500db commit e4ce5f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 0 additions & 3 deletions tests/testflows/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ def argparser(parser):
"/Grafana Datasource Plugin For Clickhouse/data source setup/check default values datetime64/": [
(Error, "https://github.com/Altinity/clickhouse-grafana/issues/630")
],
"/Grafana Datasource Plugin For Clickhouse/sql editor/extrapolation toggle/":[
(Fail, "Run Query button do not update time ranges")
],
"/Grafana Datasource Plugin For Clickhouse/functions/rate function/rate_space_in_variable/*": [
(Fail, "Functions do not support escaping")
]
Expand Down
5 changes: 5 additions & 0 deletions tests/testflows/steps/panel/locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,10 @@ def query_inspector_close_button(self):
driver: WebDriver = current().context.driver
return driver.find_element(SelectBy.CSS_SELECTOR, f'[data-testid="data-testid Drawer close"]')

@property
def refresh_button(self):
driver: WebDriver = current().context.driver
return driver.find_element(SelectBy.CSS_SELECTOR, f'[data-testid="data-testid RefreshPicker run button"]')


locators = Locators()
6 changes: 6 additions & 0 deletions tests/testflows/steps/panel/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ def click_save_confirmation_button(self):
locators.save_confirmations_button(grafana_version=self.context.grafana_version).click()


@TestStep(When)
def click_refresh_button(self):
"""Click refresh button."""

locators.refresh_button.click()

@TestStep(When)
def save_dashboard(self):
"""Save dashboard from panel view."""
Expand Down
2 changes: 1 addition & 1 deletion tests/testflows/tests/automated/sql_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def extrapolation_toggle(self):
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()
panel.click_refresh_button()

with When("I take screenshot with extrapolation"):
panel.take_screenshot_for_visualization(screenshot_name='extrapolation_toggle_on')
Expand Down

0 comments on commit e4ce5f1

Please sign in to comment.