Skip to content

Commit 82a60d4

Browse files
author
Mohammod Al Amin Ashik
committed
fix(e2e): add testids for FeatureSet panel close button and overlay
- Add data-testid='featureset-panel-close' to X close button - Add data-testid='featureset-panel-overlay' to backdrop overlay - Update featureset.wdio.ts to click close button/overlay instead of Escape key Fixes TC-FS-004 and Cleanup tests failing because panel was blocking navigation
1 parent 26d5d74 commit 82a60d4

3 files changed

Lines changed: 26 additions & 32 deletions

File tree

apps/desktop/src/features/featuresets/FeatureSetPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ export function FeatureSetPanel({ featureSet, spaceId, onClose, onDelete, onUpda
327327
</div>
328328
</div>
329329
<button
330+
data-testid="featureset-panel-close"
330331
onClick={onClose}
331332
className="p-1.5 rounded-lg hover:bg-[rgb(var(--surface-hover))] transition-colors flex-shrink-0"
332333
>

apps/desktop/src/features/featuresets/FeatureSetsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ export function FeatureSetsPage() {
334334
{/* Overlay backdrop when panel is open */}
335335
{selectedFeatureSet && (
336336
<div
337+
data-testid="featureset-panel-overlay"
337338
className="fixed inset-0 bg-black/20 backdrop-blur-[2px] z-40 animate-in fade-in duration-200"
338339
onClick={() => setSelectedFeatureSet(null)}
339340
/>

tests/e2e/specs/featureset.wdio.ts

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,25 @@ describe('FeatureSet - Server-All Auto Creation', () => {
136136
});
137137

138138
it('TC-FS-004: Disable server and verify FeatureSet is hidden', async () => {
139-
// Aggressively dismiss any open modal/panel - press Escape multiple times
140-
await browser.keys('Escape');
141-
await browser.pause(300);
142-
await browser.keys('Escape');
143-
await browser.pause(500);
144-
145-
// Click outside any potential modal to dismiss it
146-
const body = await $('body');
147-
await body.click({ x: 10, y: 10 });
148-
await browser.pause(500);
139+
// Close the FeatureSet detail panel if open (from previous test)
140+
// First try clicking the panel close button
141+
const panelCloseBtn = await byTestId('featureset-panel-close');
142+
if (await panelCloseBtn.isDisplayed().catch(() => false)) {
143+
console.log('[TC-FS-004] Clicking panel close button');
144+
await panelCloseBtn.click();
145+
await browser.pause(500);
146+
} else {
147+
// Try clicking the overlay to close
148+
const overlay = await byTestId('featureset-panel-overlay');
149+
if (await overlay.isDisplayed().catch(() => false)) {
150+
console.log('[TC-FS-004] Clicking panel overlay to close');
151+
await overlay.click();
152+
await browser.pause(500);
153+
}
154+
}
149155

150156
const myServersButton = await byTestId('nav-my-servers');
151-
// Try clicking even if not fully "clickable" - force the click
152-
try {
153-
await myServersButton.waitForClickable({ timeout: TIMEOUT.short });
154-
} catch {
155-
console.log('[TC-FS-004] Nav button not clickable, trying force click');
156-
}
157+
await myServersButton.waitForClickable({ timeout: TIMEOUT.medium });
157158
await myServersButton.click();
158159
await browser.pause(2000);
159160

@@ -180,24 +181,15 @@ describe('FeatureSet - Server-All Auto Creation', () => {
180181
});
181182

182183
it('Cleanup: Uninstall Echo Server', async () => {
183-
// Aggressively dismiss any open modal/panel
184-
await browser.keys('Escape');
185-
await browser.pause(300);
186-
await browser.keys('Escape');
187-
await browser.pause(500);
188-
189-
// Click outside any potential modal to dismiss it
190-
const body = await $('body');
191-
await body.click({ x: 10, y: 10 });
192-
await browser.pause(500);
184+
// Close any open panel first
185+
const panelCloseBtn = await byTestId('featureset-panel-close');
186+
if (await panelCloseBtn.isDisplayed().catch(() => false)) {
187+
await panelCloseBtn.click();
188+
await browser.pause(500);
189+
}
193190

194191
const discoverButton = await byTestId('nav-discover');
195-
// Try clicking even if not fully "clickable"
196-
try {
197-
await discoverButton.waitForClickable({ timeout: TIMEOUT.short });
198-
} catch {
199-
console.log('[Cleanup] Nav button not clickable, trying force click');
200-
}
192+
await discoverButton.waitForClickable({ timeout: TIMEOUT.medium });
201193
await discoverButton.click();
202194
await browser.pause(2000);
203195

0 commit comments

Comments
 (0)