diff --git a/packages/trace-viewer/src/ui/uiModeView.tsx b/packages/trace-viewer/src/ui/uiModeView.tsx index 498fab951a..bf02e22f5f 100644 --- a/packages/trace-viewer/src/ui/uiModeView.tsx +++ b/packages/trace-viewer/src/ui/uiModeView.tsx @@ -254,7 +254,10 @@ export const UIModeView: React.FC<{}> = ({ } runTests('bounce-if-busy', visibleTestIds)} disabled={isRunningTest || isLoading}> sendMessageNoReply('stop')} disabled={!isRunningTest || isLoading}> - setWatchAll(!watchAll)}> + { + setWatchedTreeIds({ value: new Set() }); + setWatchAll(!watchAll); + }}> { setCollapseAllCount(collapseAllCount + 1); }} /> diff --git a/packages/trace-viewer/src/ui/workbench.tsx b/packages/trace-viewer/src/ui/workbench.tsx index 186a555e33..703ff72c50 100644 --- a/packages/trace-viewer/src/ui/workbench.tsx +++ b/packages/trace-viewer/src/ui/workbench.tsx @@ -72,12 +72,21 @@ export const Workbench: React.FunctionComponent<{ if (selectedAction && model?.actions.includes(selectedAction)) return; const failedAction = model?.failedAction(); - if (initialSelection && model?.actions.includes(initialSelection)) + if (initialSelection && model?.actions.includes(initialSelection)) { setSelectedAction(initialSelection); - else if (failedAction) + } else if (failedAction) { setSelectedAction(failedAction); - else if (model?.actions.length) - setSelectedAction(model.actions[model.actions.length - 1]); + } else if (model?.actions.length) { + // Select the last non-after hooks item. + let index = model.actions.length - 1; + for (let i = 0; i < model.actions.length; ++i) { + if (model.actions[i].apiName === 'After Hooks' && i) { + index = i - 1; + break; + } + } + setSelectedAction(model.actions[index]); + } }, [model, selectedAction, setSelectedAction, initialSelection]); const onActionSelected = React.useCallback((action: ActionTraceEventInContext) => { diff --git a/tests/playwright-test/ui-mode-test-progress.spec.ts b/tests/playwright-test/ui-mode-test-progress.spec.ts index 16c88290c1..38091dcd93 100644 --- a/tests/playwright-test/ui-mode-test-progress.spec.ts +++ b/tests/playwright-test/ui-mode-test-progress.spec.ts @@ -109,8 +109,6 @@ test('should update trace live', async ({ runUITest, server }) => { /page.gotohttp:\/\/localhost:\d+\/one.html[\d.]+m?s/, /page.gotohttp:\/\/localhost:\d+\/two.html[\d.]+m?s/, /After Hooks[\d.]+m?s/, - /fixture: page[\d.]+m?s/, - /fixture: context[\d.]+m?s/, ]); }); diff --git a/tests/playwright-test/ui-mode-test-screencast.spec.ts b/tests/playwright-test/ui-mode-test-screencast.spec.ts index 27e3393e99..7c973f588b 100644 --- a/tests/playwright-test/ui-mode-test-screencast.spec.ts +++ b/tests/playwright-test/ui-mode-test-screencast.spec.ts @@ -44,6 +44,6 @@ test('should show screenshots', async ({ runUITest }) => { await page.getByText('test 2', { exact: true }).click(); await expect( page.locator('.CodeMirror .source-line-running'), - ).toContainText(`test('test 2', async ({ page }) => {`); + ).toContainText(`await page.waitForTimeout(1000);`); await expect(page.locator('.film-strip-frame').first()).toBeVisible(); }); diff --git a/tests/playwright-test/ui-mode-trace.spec.ts b/tests/playwright-test/ui-mode-trace.spec.ts index c3dad2b786..68b1bd1d97 100644 --- a/tests/playwright-test/ui-mode-trace.spec.ts +++ b/tests/playwright-test/ui-mode-trace.spec.ts @@ -45,8 +45,6 @@ test('should merge trace events', async ({ runUITest, server }) => { /locator.clickgetByRole\('button'\)[\d.]+m?s/, /expect.toBe[\d.]+m?s/, /After Hooks[\d.]+m?s/, - /fixture: page[\d.]+m?s/, - /fixture: context[\d.]+m?s/, ]); }); @@ -72,8 +70,6 @@ test('should merge web assertion events', async ({ runUITest }, testInfo) => { /page.setContent[\d.]+m?s/, /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/, /After Hooks[\d.]+m?s/, - /fixture: page[\d.]+m?s/, - /fixture: context[\d.]+m?s/, ]); }); @@ -98,9 +94,8 @@ test('should merge screenshot assertions', async ({ runUITest }, testInfo) => { /Before Hooks[\d.]+m?s/, /page.setContent[\d.]+m?s/, /expect.toHaveScreenshot[\d.]+m?s/, + /attach "trace-test-1-actual.png/, /After Hooks[\d.]+m?s/, - /fixture: page[\d.]+m?s/, - /fixture: context[\d.]+m?s/, ]); }); @@ -147,8 +142,6 @@ test('should show snapshots for sync assertions', async ({ runUITest, server }) /locator\.clickgetByRole\('button'\)[\d.]+m?s/, /expect\.toBe[\d.]+m?s/, /After Hooks[\d.]+m?s/, - /fixture: page[\d.]+m?s/, - /fixture: context[\d.]+m?s/, ]); await expect(