Skip to content

Commit 235b390

Browse files
committed
fix: update e2e tests for ConnectIDEs component
Update dashboard and user-flow E2E tests to match the new ConnectIDEs component that replaced the old "Connect Your Client" config section. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 414515a commit 235b390

3 files changed

Lines changed: 25 additions & 18 deletions

File tree

tests/e2e/pages/DashboardPage.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Page, Locator, expect } from '@playwright/test';
1+
import { Page, Locator } from '@playwright/test';
22
import { BasePage } from './BasePage';
33

44
/**
@@ -12,7 +12,8 @@ export class DashboardPage extends BasePage {
1212
readonly featureSetsCard: Locator;
1313
readonly clientsCard: Locator;
1414
readonly activeSpaceCard: Locator;
15-
readonly configCopyButton: Locator;
15+
readonly connectIDEsSection: Locator;
16+
readonly clientGrid: Locator;
1617

1718
constructor(page: Page) {
1819
super(page);
@@ -23,7 +24,8 @@ export class DashboardPage extends BasePage {
2324
this.featureSetsCard = page.locator('text=FeatureSets').first();
2425
this.clientsCard = page.locator('text=Clients').first();
2526
this.activeSpaceCard = page.locator('text=Active Space').first();
26-
this.configCopyButton = page.getByRole('button', { name: /Copy/ });
27+
this.connectIDEsSection = page.locator('text=Connect Your IDEs');
28+
this.clientGrid = page.locator('[data-testid="client-grid"]');
2729
}
2830

2931
async navigate() {
@@ -49,6 +51,8 @@ export class DashboardPage extends BasePage {
4951
}
5052

5153
async copyConfig() {
52-
await this.configCopyButton.click();
54+
// Open JSON config popover and click copy
55+
await this.page.locator('[data-testid="client-icon-copy-config"]').click();
56+
await this.page.locator('[data-testid="copy-config-btn"]').click();
5357
}
5458
}

tests/e2e/specs/dashboard.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ test.describe('Dashboard', () => {
2222
await expect(dashboard.activeSpaceCard).toBeVisible();
2323
});
2424

25-
test('should display client config section', async ({ page }) => {
25+
test('should display connect IDEs section', async ({ page }) => {
2626
const dashboard = new DashboardPage(page);
2727
await dashboard.navigate();
2828

29-
// Config section should be visible
30-
await expect(page.locator('text=Connect Your Client')).toBeVisible();
31-
await expect(dashboard.configCopyButton).toBeVisible();
29+
// Connect IDEs section should be visible
30+
await expect(page.locator('text=Connect Your IDEs')).toBeVisible();
31+
await expect(page.locator('[data-testid="client-grid"]')).toBeVisible();
3232
});
3333

34-
test('should copy config to clipboard', async ({ page, context, browserName }) => {
34+
test('should copy config via JSON button', async ({ page, context, browserName }) => {
3535
// Clipboard permissions only work on Chromium
3636
test.skip(browserName !== 'chromium', 'Clipboard permissions not supported');
3737

@@ -40,9 +40,12 @@ test.describe('Dashboard', () => {
4040
const dashboard = new DashboardPage(page);
4141
await dashboard.navigate();
4242

43-
await dashboard.copyConfig();
43+
// Click the JSON config icon to open popover
44+
await page.locator('[data-testid="client-icon-copy-config"]').click();
45+
// Click copy button in popover
46+
await page.locator('[data-testid="copy-config-btn"]').click();
4447

4548
// Check for success message
46-
await expect(page.locator('text=copied')).toBeVisible({ timeout: 2000 });
49+
await expect(page.locator('text=Copied!')).toBeVisible({ timeout: 2000 });
4750
});
4851
});

tests/e2e/specs/user-flows.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ test.describe('Dashboard Interactions', () => {
120120
await expect(dashboard.activeSpaceCard).toBeVisible();
121121
});
122122

123-
test('should show connection config section', async ({ page }) => {
123+
test('should show connect IDEs section', async ({ page }) => {
124124
const dashboard = new DashboardPage(page);
125125
await dashboard.navigate();
126-
127-
// Config section should be present
128-
await expect(page.locator('text=Connect Your Client')).toBeVisible();
129-
130-
// Config code block should be present
131-
await expect(page.locator('pre')).toBeVisible();
126+
127+
// Connect IDEs section should be present
128+
await expect(page.locator('text=Connect Your IDEs')).toBeVisible();
129+
130+
// Client grid should be present
131+
await expect(page.locator('[data-testid="client-grid"]')).toBeVisible();
132132
});
133133
});
134134

0 commit comments

Comments
 (0)