chore: do not select after hooks automatically (#27805)
This commit is contained in:
parent
54235120a0
commit
47733b04fb
|
|
@ -254,7 +254,10 @@ export const UIModeView: React.FC<{}> = ({
|
|||
</div>}
|
||||
<ToolbarButton icon='play' title='Run all' onClick={() => runTests('bounce-if-busy', visibleTestIds)} disabled={isRunningTest || isLoading}></ToolbarButton>
|
||||
<ToolbarButton icon='debug-stop' title='Stop' onClick={() => sendMessageNoReply('stop')} disabled={!isRunningTest || isLoading}></ToolbarButton>
|
||||
<ToolbarButton icon='eye' title='Watch all' toggled={watchAll} onClick={() => setWatchAll(!watchAll)}></ToolbarButton>
|
||||
<ToolbarButton icon='eye' title='Watch all' toggled={watchAll} onClick={() => {
|
||||
setWatchedTreeIds({ value: new Set() });
|
||||
setWatchAll(!watchAll);
|
||||
}}></ToolbarButton>
|
||||
<ToolbarButton icon='collapse-all' title='Collapse all' onClick={() => {
|
||||
setCollapseAllCount(collapseAllCount + 1);
|
||||
}} />
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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/,
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue