Skip to content

Commit a7b4e35

Browse files
alswlcursoragent
andcommitted
fix(e2e): 合并冲突,统一 should display table names 等待逻辑
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d9b31e8 commit a7b4e35

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

tests/e2e/er-diagram.spec.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ test.describe('ER Diagram - Interaction', () => {
44
test.beforeEach(async ({ page }) => {
55
await page.goto('/');
66
await page.waitForLoadState('load');
7-
await expect(page.locator('.react-shape-app')).toBeVisible({ timeout: 15000 });
7+
await expect(page.locator('.react-shape-app')).toBeVisible({
8+
timeout: 15000,
9+
});
810
await page.waitForSelector('svg', { timeout: 10000 });
911
});
1012

@@ -22,15 +24,15 @@ test.describe('ER Diagram - Interaction', () => {
2224
});
2325

2426
test('should display table names', async ({ page }) => {
25-
// 等待 ER 图节点和文字渲染完成(layout 与 X6 渲染为异步)
27+
// 等待 ER 图节点和文字渲染完成(layout 与 X6 渲染为异步,CI 更慢
2628
await expect(page.locator('svg g[data-cell-id]').first()).toBeVisible({
2729
timeout: 15000,
2830
});
29-
await expect(page.locator('svg text').first()).toBeVisible({ timeout: 15000 });
31+
await expect(page.locator('svg text').first()).toBeVisible({
32+
timeout: 15000,
33+
});
3034

3135
const tableNames = page.locator('svg text');
32-
await expect(tableNames.first()).toBeVisible({ timeout: 15000 });
33-
3436
const textCount = await tableNames.count();
3537
expect(textCount).toBeGreaterThan(0);
3638

@@ -116,7 +118,9 @@ test.describe('ER Diagram - Layout', () => {
116118
test.beforeEach(async ({ page }) => {
117119
await page.goto('/');
118120
await page.waitForLoadState('load');
119-
await expect(page.locator('.react-shape-app')).toBeVisible({ timeout: 15000 });
121+
await expect(page.locator('.react-shape-app')).toBeVisible({
122+
timeout: 15000,
123+
});
120124
await page.waitForSelector('svg', { timeout: 10000 });
121125
});
122126

@@ -189,7 +193,9 @@ test.describe('ER Diagram - Visual', () => {
189193
test.beforeEach(async ({ page }) => {
190194
await page.goto('/');
191195
await page.waitForLoadState('load');
192-
await expect(page.locator('.react-shape-app')).toBeVisible({ timeout: 15000 });
196+
await expect(page.locator('.react-shape-app')).toBeVisible({
197+
timeout: 15000,
198+
});
193199
await page.waitForSelector('svg', { timeout: 10000 });
194200
await page.waitForTimeout(1000);
195201
});
@@ -205,7 +211,9 @@ test.describe('ER Diagram - Visual', () => {
205211
const rectCount = await rects.count();
206212
expect(rectCount).toBeGreaterThan(0);
207213

208-
await expect(page.locator('svg text').first()).toBeVisible({ timeout: 15000 });
214+
await expect(page.locator('svg text').first()).toBeVisible({
215+
timeout: 15000,
216+
});
209217
const texts = page.locator('svg text');
210218
const textCount = await texts.count();
211219
expect(textCount).toBeGreaterThan(0);

0 commit comments

Comments
 (0)