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

Fixing tests for extrapolation toggle to be stable. #665

Merged
merged 1 commit into from
Nov 18, 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
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
Loading