Repository navigation
Expand file tree
/
Copy pathdashboard_filters.yaml
More file actions
254 lines (212 loc) · 7.44 KB
/
Copy pathdashboard_filters.yaml
File metadata and controls
254 lines (212 loc) · 7.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# Superset Dashboard Filter Test
#
# This test validates dashboard filter functionality in Apache Superset.
# It demonstrates a real-world Preset use case for testing PR changes.
#
# Scenario: A PR claims to fix dashboard filter application issues.
# This test verifies that:
# 1. Users can login to Superset
# 2. Dashboard loads correctly with filter components
# 3. Filters can be applied and charts update accordingly
# 4. URL parameters reflect the applied filter state
#
# Reference: https://docs.preset.io/docs/managing-filters
#
# Usage:
# uitestflow run examples/basic/dashboard_filters.yaml --profile staging
version: "1.0"
name: "Superset Dashboard Filter Test"
description: "Verify dashboard filter functionality works correctly"
# Target Superset instance
# This example uses the URL from the project spec
url: "http://35.85.221.158:8080"
# Authentication for Superset
auth:
type: "form"
username: "admin"
password: "admin"
# Browser configuration
browser:
headless: false
viewport:
width: 1920
height: 1080
device: "Desktop"
# Test steps
steps:
# ============================================
# Phase 1: Authentication
# ============================================
- name: "Navigate to Superset login page"
action: "goto"
url: "{{ base_url }}/login/"
screenshot: true
- name: "Wait for login form to be visible"
action: "wait_for"
selector: 'input[name="username"]'
timeout: 5000
- name: "Enter admin username"
action: "fill"
selector: 'input[name="username"]'
value: "{{ auth.username }}"
- name: "Enter admin password"
action: "fill"
selector: 'input[name="password"]'
value: "{{ auth.password }}"
- name: "Submit login form"
action: "click"
selector: 'button[type="submit"]'
- name: "Wait for successful login redirect"
action: "wait_for"
# Wait for any of these selectors that indicate we're logged in
selector: '.dashboard-list, .welcome-page, [data-test="dashboard-list"]'
timeout: 10000
screenshot: true
# ============================================
# Phase 2: Navigate to Dashboard
# ============================================
- name: "Navigate to dashboards list"
action: "goto"
url: "{{ base_url }}/dashboard/list/"
- name: "Wait for dashboard list to load"
action: "wait_for"
selector: '[data-test="dashboard-list"], .dashboard-list-view'
timeout: 10000
# Click the first dashboard in the list
- name: "Open first dashboard with filters"
action: "click"
# This selector may need adjustment based on actual Superset DOM structure
selector: '[data-test="dashboard-list-item"]:first-child a, .dashboard-list-view tbody tr:first-child a'
screenshot: true
# ============================================
# Phase 3: Wait for Dashboard to Load
# ============================================
- name: "Wait for dashboard content to load"
action: "wait_for"
selector: '.dashboard-content, [data-test="dashboard-content"]'
timeout: 15000
- name: "Wait for dashboard filters to appear"
action: "wait_for"
selector: '.dashboard-filters, [data-test="dashboard-filters"], .filter-container'
timeout: 10000
screenshot: true
# Wait for network to settle (all charts loaded)
- name: "Wait for all charts to load"
action: "wait_for_network_idle"
timeout: 20000
# ============================================
# Phase 4: Interact with Filters
# ============================================
- name: "Capture dashboard state before filter"
action: "screenshot"
name: "before_filter_application"
# Click on a filter dropdown
- name: "Click filter dropdown"
action: "click"
selector: '.filter-dropdown, [data-test="filter-select"], .Select__control'
# Note: This selector may need adjustment based on the filter component used
- name: "Wait for filter options to appear"
action: "wait_for"
selector: '.Select__menu, .filter-options, [data-test="filter-options"]'
timeout: 5000
# Select the first filter option
- name: "Select first filter option"
action: "click"
selector: '.Select__option:first-child, .filter-option:first-child'
- name: "Apply filter"
action: "click"
selector: 'button:has-text("Apply"), [data-test="apply-filter"]'
# Some Superset versions auto-apply, this may be optional
# ============================================
# Phase 5: Verify Filter Applied
# ============================================
# Wait for charts to update after filter application
- name: "Wait for charts to update"
action: "wait_for_network_idle"
timeout: 15000
- name: "Capture dashboard state after filter"
action: "screenshot"
name: "after_filter_application"
# Verify URL contains filter parameters
- name: "Verify URL contains filter parameters"
action: "expect"
assertion: "url_contains"
value: "preselect_filters"
# Verify dashboard still shows content (no errors)
- name: "Verify dashboard content still visible"
action: "expect"
assertion: "element_visible"
selector: '.dashboard-content, [data-test="dashboard-content"]'
# Verify at least one chart is visible
- name: "Verify charts are visible"
action: "expect"
assertion: "element_visible"
selector: '.chart-container, [data-test="chart-container"]'
# Optional: Verify filter badge shows applied filter
- name: "Verify filter badge appears"
action: "expect"
assertion: "element_visible"
selector: '.filter-badge, [data-test="filter-badge"]'
# This step may fail if implementation doesn't use badges
# Evaluators - comprehensive validation
evaluators:
# Basic execution success
- name: "all_steps_completed"
type: "execution_successful"
description: "All test steps executed without errors"
# No JavaScript errors
- name: "no_console_errors"
type: "console_errors"
max_errors: 0
description: "No console errors during test execution"
# Note: Some Superset versions may have non-critical warnings
# You may want to set max_errors: 5 for warnings
# URL validation
- name: "url_has_filter_params"
type: "url_pattern"
pattern: "preselect_filters|native_filters"
description: "URL contains filter parameters after applying filters"
# Performance check
- name: "dashboard_load_performance"
type: "performance"
max_load_time: 10000
description: "Dashboard loads within 10 seconds"
# Network requests validation
- name: "api_calls_successful"
type: "network_requests"
expected_status: 200
pattern: "/api/v1/chart/data"
description: "Chart data API calls return 200 OK"
# Visual validation (optional - requires baseline)
# - name: "dashboard_visual_regression"
# type: "screenshot_comparison"
# baseline: "dashboard_filters_baseline.png"
# threshold: 0.05 # 5% difference allowed
# description: "Dashboard appearance matches baseline"
# Retry configuration
# Dashboard tests can be flaky due to network/loading times
retry:
max_attempts: 2
delay: 2000
exponential_backoff: true
# Tags for organization
tags:
- "superset"
- "dashboard"
- "filters"
- "critical"
- "preset"
- "e2e"
# Metadata
metadata:
author: "Preset QA Team"
related_pr: "#35152"
related_docs: "https://docs.preset.io/docs/managing-filters"
test_type: "functional"
priority: "high"
# Notifications (optional)
# Can be configured to alert on failure
notifications:
on_failure:
- slack: "#qa-alerts"
- email: "qa-team@preset.io"