Skip to content

Commit

Permalink
Make the open tabs sidebar snapshot focused on open tabs
Browse files Browse the repository at this point in the history
Before this commit we had two very similar snapshots:
- interface-tabs-documentation-linux.png
- running-layout-documentation-linux.png

both showing "open tabs" and "kernels" sections.
After this commit the former now only shows "open tabs"
reducing the burden reviewing snapshots when kernels
are flaky or when kernels section changes
  • Loading branch information
krassowski committed Mar 21, 2024
1 parent fad82b8 commit ab321d7
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions galata/test/documentation/overview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,16 @@ test.describe('Overview', () => {

await page.click('[title="Running Terminals and Kernels"]');

await page
.locator(
'.jp-RunningSessions-item.jp-mod-kernelspec >> text="Python 3 (ipykernel)"'
)
.waitFor();

// Freeze kernel ID
await page.evaluate(() => {
document.querySelector(
'.jp-RunningSessions-item-label-kernel-id'
).innerText = '(abcd1234)';
});
// Close all other sections
const otherSections = page.locator(
'.jp-AccordionPanel-title.lm-mod-expanded:not([aria-label="Open Tabs Section"])'
);
for (const section of await otherSections.all()) {
await section.click();
}

expect(
await page.screenshot({ clip: { y: 27, x: 0, width: 283, height: 400 } })
await page.screenshot({ clip: { y: 27, x: 0, width: 283, height: 200 } })
).toMatchSnapshot('interface_tabs.png');
});

Expand Down

0 comments on commit ab321d7

Please sign in to comment.