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

This commit is contained in:
Max Schmitt 2024-09-26 22:30:41 +02:00 committed by GitHub
parent 463bd55cf0
commit 0d79291604
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View file

@ -104,8 +104,6 @@ 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);
@ -517,7 +515,6 @@ 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

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

View file

@ -1402,7 +1402,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('should allow showing screenshots instead of snapshots', async ({ runAndTrace, page, server }) => { test.skip('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
@ -1420,7 +1420,7 @@ test('should allow showing screenshots instead of snapshots', async ({ runAndTra
await expect(screenshot).toBeVisible(); await expect(screenshot).toBeVisible();
}); });
test('should handle case where neither snapshots nor screenshots exist', async ({ runAndTrace, page, server }) => { test.skip('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 });