Skip to content

Commit ddab9bb

Browse files
committed
Add new reference snapshots
1 parent 5bf272b commit ddab9bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+18
-14
lines changed

ui-tests/tests/notebooks/widgets.ipynb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,8 @@
66
"metadata": {},
77
"outputs": [],
88
"source": [
9-
"import ipywidgets as widgets"
10-
]
11-
},
12-
{
13-
"cell_type": "code",
14-
"execution_count": null,
15-
"metadata": {},
16-
"outputs": [],
17-
"source": [
9+
"import ipywidgets as widgets\n",
10+
"\n",
1811
"widgets.IntSlider(\n",
1912
" value=7,\n",
2013
" min=0,\n",

ui-tests/tests/widgets.test.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,25 @@ test.describe('Widget Visual Regression', () => {
2323
const notebook = 'widgets.ipynb';
2424
await page.notebook.openByPath(`${tmpPath}/${notebook}`);
2525
await page.notebook.activate(notebook);
26+
27+
const captures = new Array<Buffer>();
28+
const cellCount = await page.notebook.getCellCount();
29+
30+
await page.notebook.runCellByCell({
31+
onAfterCellRun: async (cellIndex: number) => {
32+
const cell = await page.notebook.getCellOutput(cellIndex);
33+
if (cell) {
34+
captures.push(await cell.screenshot());
35+
}
36+
},
37+
});
38+
2639
await page.notebook.runCellByCell();
2740
await page.notebook.save();
2841

29-
const cellCount = await page.notebook.getCellCount();
30-
for (let c = 0; c < cellCount; ++c) {
31-
const cell = await page.notebook.getCellOutput(c);
32-
const image = `cell-${c}`;
33-
expect(await cell.screenshot()).toMatchSnapshot(image);
42+
for (let i = 0; i < cellCount; i++) {
43+
const image = `cell-${i}.png`;
44+
expect(captures[i]).toMatchSnapshot(image);
3445
}
3546
});
3647
});
1.7 KB
1.98 KB
1.4 KB
1.7 KB
1.96 KB
1.85 KB
2.15 KB
1.98 KB

0 commit comments

Comments
 (0)