|
1 | | -import { test } from '@playwright/test' |
| 1 | +import { test, expect } from '@playwright/test' |
2 | 2 | import path from 'path' |
3 | 3 | import fs from 'fs-extra' |
4 | 4 | import os from 'os' |
5 | 5 | import { openLineageView, SUSHI_SOURCE_PATH } from './utils' |
6 | 6 | import { startCodeServer, stopCodeServer } from './utils_code_server' |
7 | 7 |
|
8 | | -test('Turn on and off show columns', async ({ page }) => { |
| 8 | +test('Settings button is visible in the lineage view', async ({ page }) => { |
9 | 9 | const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-test-sushi-')) |
10 | 10 | await fs.copy(SUSHI_SOURCE_PATH, tempDir) |
11 | 11 |
|
@@ -34,7 +34,32 @@ test('Turn on and off show columns', async ({ page }) => { |
34 | 34 | // Open lineage |
35 | 35 | await openLineageView(page) |
36 | 36 |
|
37 | | - await page.locator('iframe >> nth=1 >> button').click() |
| 37 | + const iframes = page.locator('iframe') |
| 38 | + const iframeCount = await iframes.count() |
| 39 | + let settingsCount = 0 |
| 40 | + |
| 41 | + for (let i = 0; i < iframeCount; i++) { |
| 42 | + const iframe = iframes.nth(i) |
| 43 | + const contentFrame = iframe.contentFrame() |
| 44 | + if (contentFrame) { |
| 45 | + const activeFrame = contentFrame.locator('#active-frame').contentFrame() |
| 46 | + if (activeFrame) { |
| 47 | + try { |
| 48 | + await activeFrame |
| 49 | + .getByRole('button', { |
| 50 | + name: 'Settings', |
| 51 | + }) |
| 52 | + .waitFor({ timeout: 1000 }) |
| 53 | + settingsCount++ |
| 54 | + } catch { |
| 55 | + // Continue to next iframe if this one doesn't have the error |
| 56 | + continue |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + } |
| 61 | + |
| 62 | + expect(settingsCount).toBeGreaterThan(0) |
38 | 63 | } finally { |
39 | 64 | await stopCodeServer(context) |
40 | 65 | } |
|
0 commit comments