Skip to content

Commit b4a1583

Browse files
Fix to hide toolbar before capturing snapshots for UI notebook tests
1 parent 5c582c9 commit b4a1583

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui-tests/tests/widget_notebook_example.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ test.describe("Visual Regression", () => {
3434
await page.notebook.openByPath(`${tmpPath}/${notebook}`);
3535
await page.notebook.activate(notebook);
3636

37+
// Hide the cell toolbar before capturing the screenshots
38+
await page.addStyleTag({ content: '.jp-cell-toolbar { display: none !important; }' });
39+
3740
const captures: (Buffer | null)[] = []; // Array to store cell screenshots
3841
const cellCount = await page.notebook.getCellCount();
3942
console.log(`Cell count: ${cellCount}`);
@@ -45,7 +48,6 @@ test.describe("Visual Regression", () => {
4548
if (cell && (await cell.isVisible())) {
4649
captures[cellIndex] = await cell.screenshot(); // Save the screenshot by cell index
4750
}
48-
await page.addStyleTag({ content: '.jp-cell-toolbar { display: none !important; }' });
4951
},
5052
});
5153

0 commit comments

Comments
 (0)