-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathlineage_settings.spec.ts
More file actions
66 lines (58 loc) · 1.77 KB
/
lineage_settings.spec.ts
File metadata and controls
66 lines (58 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { test, expect } from './fixtures'
import path from 'path'
import fs from 'fs-extra'
import os from 'os'
import {
openLineageView,
openServerPage,
SUSHI_SOURCE_PATH,
waitForLoadedSQLMesh,
} from './utils'
import { createPythonInterpreterSettingsSpecifier } from './utils_code_server'
test('Settings button is visible in the lineage view', async ({
page,
sharedCodeServer,
}) => {
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-test-sushi-'))
await fs.copy(SUSHI_SOURCE_PATH, tempDir)
await createPythonInterpreterSettingsSpecifier(tempDir)
await openServerPage(page, tempDir, sharedCodeServer)
await page.waitForSelector('text=models')
// Click on the models folder, excluding external_models
await page
.getByRole('treeitem', { name: 'models', exact: true })
.locator('a')
.click()
// Open the waiters.py model
await page
.getByRole('treeitem', { name: 'waiters.py', exact: true })
.locator('a')
.click()
await waitForLoadedSQLMesh(page)
// Open lineage
await openLineageView(page)
const iframes = page.locator('iframe')
const iframeCount = await iframes.count()
let settingsCount = 0
for (let i = 0; i < iframeCount; i++) {
const iframe = iframes.nth(i)
const contentFrame = iframe.contentFrame()
if (contentFrame) {
const activeFrame = contentFrame.locator('#active-frame').contentFrame()
if (activeFrame) {
try {
await activeFrame
.getByRole('button', {
name: 'Settings',
})
.waitFor({ timeout: 1000 })
settingsCount++
} catch {
// Continue to next iframe if this one doesn't have the error
continue
}
}
}
}
expect(settingsCount).toBeGreaterThan(0)
})