fix(plugin-e2e): handle table-based preview of values in toDisplayPreviews#2760
Merged
Conversation
leventebalogh
previously approved these changes
Jul 8, 2026
| variableEditPage.ctx.selectors.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption | ||
| ) | ||
| ).toContainText(previewTexts, options); | ||
| await expect(previewLabels.first().or(previewTable).first()).toBeVisible({ timeout: options?.timeout }); |
Collaborator
There was a problem hiding this comment.
I think one .first() could be enough here?
Suggested change
| await expect(previewLabels.first().or(previewTable).first()).toBeVisible({ timeout: options?.timeout }); | |
| await expect(previewLabels.or(previewTable).first()).toBeVisible({ timeout: options?.timeout }); |
Collaborator
Author
There was a problem hiding this comment.
Good call, applied.
leventebalogh
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since Grafana 13.1.0 the multiPropsVariables behavior is always on (toggle removed in grafana/grafana#126905). Any variable query result with a data frame field not named
valueortextnow carries that field as an option property, and the variable editor previews the options in a table instead of the label list. That's every SQL-style variable query, sotoDisplayPreviewstimes out waiting for thepreviewOfValuesOptionlocator, which never appears. Reported by the AWS datasources squad after their plugin-e2e variable tests started failing on 13.1.0.The matcher now waits for either presentation and, when the table is shown, asserts against its text column, which holds the same display text the labels used to show. Older Grafana versions still render the labels and keep the old code path.
The new test mocks a variable query response with a
humidityfield. It renders as labels on older versions and as the table on 13.1+, and it fails on 13.1.0 without this fix. Verified locally against grafana-enterprise 11.4.0 and 13.1.0.