Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/trace-viewer/src/ui/uiModeTraceView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const TraceView: React.FC<{
clearTimeout(pollTimer.current);

const result = item.testCase?.results[0];
if (!result) {
if (!result || item.treeItem?.status === 'scheduled') {
Comment thread
cpAdm marked this conversation as resolved.
setModel(undefined);
return;
}
Expand Down
19 changes: 19 additions & 0 deletions tests/playwright-test/ui-mode-test-source.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,22 @@ test('should load error (dupe tests) indicator on sources', async ({ runUITest }
Error: duplicate test title "first", first declared in a.test.ts:3
`);
});

test('should keep showing source when test is pending', async ({ runUITest }, testInfo) => {
const { page } = await runUITest({
'a.test.ts': `
import { test } from '@playwright/test';
test('zero', () => {});
test('first', async () => {
await new Promise(f => setTimeout(f, ${testInfo.timeout}));
});
test('second', () => {});
`,
});

await page.getByTitle('Run all').click();
await page.getByTestId('test-tree').getByText('second').click();
await expect(page.getByTestId('status-line')).toHaveText('Running 1/3 passed (33%)');
await expect(page.getByTestId('source-code').locator('.source-tab-file-name')).toHaveText('a.test.ts');
await expect(page.locator('.CodeMirror .source-line-running')).toHaveText(`7 test('second', () => {});`);
});
Loading