Revert "chore: hide screenshot instead of snapshot Trace Viewer feature (#32832)"

This reverts commit 0d79291604.
This commit is contained in:
Simon Knott 2024-10-15 11:18:45 +02:00
parent d22083ccf6
commit f80ec81311
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
3 changed files with 6 additions and 4 deletions

View file

@ -105,6 +105,8 @@ export const UIModeView: React.FC<{}> = ({
const [showBrowser, setShowBrowser] = React.useState(false); const [showBrowser, setShowBrowser] = React.useState(false);
const [updateSnapshots, setUpdateSnapshots] = React.useState(false); const [updateSnapshots, setUpdateSnapshots] = React.useState(false);
const [darkMode, setDarkMode] = useDarkModeSetting(); const [darkMode, setDarkMode] = useDarkModeSetting();
const [showScreenshot, setShowScreenshot] = useSetting('screenshot-instead-of-snapshot', false);
const inputRef = React.useRef<HTMLInputElement>(null); const inputRef = React.useRef<HTMLInputElement>(null);
@ -520,6 +522,7 @@ export const UIModeView: React.FC<{}> = ({
</Toolbar> </Toolbar>
{settingsVisible && <SettingsView settings={[ {settingsVisible && <SettingsView settings={[
{ value: darkMode, set: setDarkMode, title: 'Dark mode' }, { value: darkMode, set: setDarkMode, title: 'Dark mode' },
{ value: showScreenshot, set: setShowScreenshot, title: 'Show screenshot instead of snapshot' },
]} />} ]} />}
</div> </div>
} }

View file

@ -351,8 +351,7 @@ export const Workbench: React.FunctionComponent<{
openPage={openPage} />} openPage={openPage} />}
sidebar={ sidebar={
<TabbedPane <TabbedPane
// Hide settings tab for now, it only includes screenshots as snapshots option which is not ready yet. tabs={showSettings ? [actionsTab, metadataTab, settingsTab] : [actionsTab, metadataTab]}
tabs={(showSettings && false) ? [actionsTab, metadataTab, settingsTab] : [actionsTab, metadataTab]}
selectedTab={selectedNavigatorTab} selectedTab={selectedNavigatorTab}
setSelectedTab={setSelectedNavigatorTab} setSelectedTab={setSelectedNavigatorTab}
/> />

View file

@ -1421,7 +1421,7 @@ test('should serve css without content-type', async ({ page, runAndTrace, server
await expect(snapshotFrame.locator('body')).toHaveCSS('background-color', 'rgb(255, 0, 0)', { timeout: 0 }); await expect(snapshotFrame.locator('body')).toHaveCSS('background-color', 'rgb(255, 0, 0)', { timeout: 0 });
}); });
test.skip('should allow showing screenshots instead of snapshots', async ({ runAndTrace, page, server }) => { test('should allow showing screenshots instead of snapshots', async ({ runAndTrace, page, server }) => {
const traceViewer = await runAndTrace(async () => { const traceViewer = await runAndTrace(async () => {
await page.goto(server.PREFIX + '/one-style.html'); await page.goto(server.PREFIX + '/one-style.html');
await page.waitForTimeout(1000); // ensure we could take a screenshot await page.waitForTimeout(1000); // ensure we could take a screenshot
@ -1439,7 +1439,7 @@ test.skip('should allow showing screenshots instead of snapshots', async ({ runA
await expect(screenshot).toBeVisible(); await expect(screenshot).toBeVisible();
}); });
test.skip('should handle case where neither snapshots nor screenshots exist', async ({ runAndTrace, page, server }) => { test('should handle case where neither snapshots nor screenshots exist', async ({ runAndTrace, page, server }) => {
const traceViewer = await runAndTrace(async () => { const traceViewer = await runAndTrace(async () => {
await page.goto(server.PREFIX + '/one-style.html'); await page.goto(server.PREFIX + '/one-style.html');
}, { snapshots: false, screenshots: false }); }, { snapshots: false, screenshots: false });