|
14 | 14 | */ |
15 | 15 |
|
16 | 16 | import { test, expect, getTestMode, getApiUrl, dismissWhatsNewModal } from './fixtures' |
| 17 | +import type { Locator } from '@playwright/test' |
| 18 | + |
| 19 | +// Per-stream toggles only render inside an expanded sensor module |
| 20 | +async function expandSensorModules(deviceCard: Locator) { |
| 21 | + const headers = deviceCard.locator('button[aria-expanded]') |
| 22 | + for (let i = 0; i < await headers.count(); i++) { |
| 23 | + const header = headers.nth(i) |
| 24 | + if (await header.getAttribute('aria-expanded') === 'false') await header.click() |
| 25 | + } |
| 26 | +} |
17 | 27 |
|
18 | 28 | // Skip entire file in mock mode |
19 | 29 | test.beforeEach(async ({ testMode, page }) => { |
@@ -72,6 +82,9 @@ test.describe('@real-device Real Device Tests', () => { |
72 | 82 | // Wait for device to finish loading sensors |
73 | 83 | await expect(page.locator('[title="Loading..."]')).not.toBeVisible({ timeout: 10000 }) |
74 | 84 |
|
| 85 | + // Sensor modules are collapsed by default; expand them to reveal the stream toggles |
| 86 | + await expandSensorModules(deviceCard) |
| 87 | + |
75 | 88 | // Enable depth stream |
76 | 89 | const depthToggle = page.locator('[data-testid="toggle-stream-depth"]').first() |
77 | 90 | await depthToggle.check() |
@@ -102,6 +115,8 @@ test.describe('@real-device Real Device Tests', () => { |
102 | 115 | // Wait for device to finish loading sensors |
103 | 116 | await expect(page.locator('[title="Loading..."]')).not.toBeVisible({ timeout: 10000 }) |
104 | 117 |
|
| 118 | + await expandSensorModules(deviceCard) |
| 119 | + |
105 | 120 | const depthToggle = page.locator('[data-testid="toggle-stream-depth"]').first() |
106 | 121 | await depthToggle.check() |
107 | 122 |
|
@@ -196,6 +211,8 @@ test.describe('@real-device Performance Tests', () => { |
196 | 211 | // Wait for device to finish loading sensors |
197 | 212 | await expect(page.locator('[title="Loading..."]')).not.toBeVisible({ timeout: 10000 }) |
198 | 213 |
|
| 214 | + await expandSensorModules(deviceCard) |
| 215 | + |
199 | 216 | const depthToggle = page.locator('[data-testid="toggle-stream-depth"]').first() |
200 | 217 | await depthToggle.check() |
201 | 218 |
|
|
0 commit comments