-
Notifications
You must be signed in to change notification settings - Fork 380
chore(vscode): starts testing the actual contents of the lineage view #4865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| import { test } from '@playwright/test' | ||||||||||||||||||||||||||||||||||||||||||||||||
| import { test, expect } from '@playwright/test' | ||||||||||||||||||||||||||||||||||||||||||||||||
| import fs from 'fs-extra' | ||||||||||||||||||||||||||||||||||||||||||||||||
| import os from 'os' | ||||||||||||||||||||||||||||||||||||||||||||||||
| import path from 'path' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -95,18 +95,59 @@ test('working project, then broken through adding double model, then refixed', a | |||||||||||||||||||||||||||||||||||||||||||||||
| await saveFile(page) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| // Wait for the error to appear | ||||||||||||||||||||||||||||||||||||||||||||||||
| // TODO: Selector doesn't work in the linage view | ||||||||||||||||||||||||||||||||||||||||||||||||
| // await window.waitForSelector('text=Error') | ||||||||||||||||||||||||||||||||||||||||||||||||
| const iframes = page.locator('iframe') | ||||||||||||||||||||||||||||||||||||||||||||||||
| const iframeCount = await iframes.count() | ||||||||||||||||||||||||||||||||||||||||||||||||
| let errorCount = 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() | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const activeFrame = contentFrame.locator('#active-frame').contentFrame() | |
| const activeFrame = await contentFrame.locator('#active-frame').contentFrame() |
Copilot
AI
Jul 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] You repeat nearly identical iframe-scanning logic three times. Extract a helper function like countTextInLineageView(page, text) to reduce duplication.
| const iframes = page.locator('iframe') | |
| const iframeCount = await iframes.count() | |
| let errorCount = 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 | |
| .getByText('Error: Failed to load model') | |
| .waitFor({ timeout: 1000 }) | |
| errorCount++ | |
| } catch { | |
| // Continue to next iframe if this one doesn't have the error | |
| continue | |
| } | |
| } | |
| } | |
| } | |
| const errorCount = await countTextInLineageView(page, 'Error: Failed to load model') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to
awaitthe call toiframe.contentFrame()to get the actualFrameobject before using it.