-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathdiagnostics.spec.ts
More file actions
54 lines (45 loc) · 1.59 KB
/
diagnostics.spec.ts
File metadata and controls
54 lines (45 loc) · 1.59 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
import { test } from '@playwright/test'
import path from 'path'
import fs from 'fs-extra'
import os from 'os'
import { runCommand, SUSHI_SOURCE_PATH } from './utils'
import {
createPythonInterpreterSettingsSpecifier,
startCodeServer,
stopCodeServer,
} from './utils_code_server'
test('Workspace diagnostics show up in the diagnostics panel', async ({
page,
}) => {
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-test-sushi-'))
await fs.copy(SUSHI_SOURCE_PATH, tempDir)
const context = await startCodeServer({
tempDir,
})
await createPythonInterpreterSettingsSpecifier(tempDir)
const configPath = path.join(tempDir, 'config.py')
const configContent = await fs.readFile(configPath, 'utf8')
const updatedContent = configContent.replace('enabled=False', 'enabled=True')
await fs.writeFile(configPath, updatedContent)
try {
await page.goto(`http://127.0.0.1:${context.codeServerPort}`)
// Wait for the models folder to be visible
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 customer_revenue_lifetime model
await page
.getByRole('treeitem', { name: 'customers.sql', exact: true })
.locator('a')
.click()
// Open problems panel
await runCommand(page, 'View: Focus Problems')
await page.waitForSelector('text=problems')
await page.waitForSelector('text=All models should have an owner')
} finally {
await stopCodeServer(context)
}
})