Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nour-Cheour10 committed Jun 20, 2024
1 parent b5759bb commit 13a8c65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d6165d46dd854057842f2bb9c175c41e",
"model_id": "d56255d3aef94626be3caed4998ac533",
"version_major": 2,
"version_minor": 0
},
Expand Down
6 changes: 4 additions & 2 deletions ui-tests/tests/ipyopenlayers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const testCellOutputs = async (page: IJupyterLabPageFixture, tmpPath: string, th
await page.notebook.save();

for (let c = 0; c < numCellImages; ++c) {
expect(results[c]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, c), {threshold: 0.5});
expect(results[c]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, c), {threshold: 0.3});
}

await page.notebook.close(true);
Expand All @@ -60,6 +60,7 @@ const testPlotUpdates = async (page: IJupyterLabPageFixture, tmpPath: string, th
if (theme == 'JupyterLab Dark') {
page.theme.setTheme(theme);
}
await page.setViewportSize({ width: 1280, height: 800 });

for (const notebook of notebooks) {
let results = [];
Expand All @@ -74,6 +75,7 @@ const testPlotUpdates = async (page: IJupyterLabPageFixture, tmpPath: string, th
let cellCount = 0;
await page.notebook.runCellByCell({
onAfterCellRun: async (cellIndex: number) => {
await page.waitForTimeout(1000); // Ajouter un délai pour la stabilisation du rendu
// Always get first cell output which must contain the plot
const cell = await page.notebook.getCellOutput(0);
if (cell) {
Expand All @@ -86,7 +88,7 @@ const testPlotUpdates = async (page: IJupyterLabPageFixture, tmpPath: string, th
await page.notebook.save();

for (let i = 0; i < cellCount; i++) {
expect(results[i]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, i), {threshold: 0.3});
expect(results[i]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, i), {threshold: 0.5});

Check failure on line 91 in ui-tests/tests/ipyopenlayers.test.ts

View workflow job for this annotation

GitHub Actions / visual-regression-tests

tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties

1) tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties Error: Screenshot comparison failed: Expected an image 656px by 501px, received 912px by 501px. 15 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts-snapshots/light-map-update-ipynb-cell-0-linux.png Received: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties/light-map-update-ipynb-cell-0-actual.png Diff: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties/light-map-update-ipynb-cell-0-diff.png 89 | 90 | for (let i = 0; i < cellCount; i++) { > 91 | expect(results[i]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, i), {threshold: 0.5}); | ^ 92 | } 93 | 94 | await page.notebook.close(true); at testPlotUpdates (/home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:91:26) at /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:129:5

Check failure on line 91 in ui-tests/tests/ipyopenlayers.test.ts

View workflow job for this annotation

GitHub Actions / visual-regression-tests

tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties

1) tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: Expected an image 656px by 501px, received 912px by 501px. 15 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts-snapshots/light-map-update-ipynb-cell-0-linux.png Received: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties-retry1/light-map-update-ipynb-cell-0-actual.png Diff: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties-retry1/light-map-update-ipynb-cell-0-diff.png 89 | 90 | for (let i = 0; i < cellCount; i++) { > 91 | expect(results[i]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, i), {threshold: 0.5}); | ^ 92 | } 93 | 94 | await page.notebook.close(true); at testPlotUpdates (/home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:91:26) at /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:129:5

Check failure on line 91 in ui-tests/tests/ipyopenlayers.test.ts

View workflow job for this annotation

GitHub Actions / visual-regression-tests

tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties

1) tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: Expected an image 656px by 501px, received 912px by 501px. 15 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts-snapshots/light-map-update-ipynb-cell-0-linux.png Received: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties-retry2/light-map-update-ipynb-cell-0-actual.png Diff: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties-retry2/light-map-update-ipynb-cell-0-diff.png 89 | 90 | for (let i = 0; i < cellCount; i++) { > 91 | expect(results[i]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, i), {threshold: 0.5}); | ^ 92 | } 93 | 94 | await page.notebook.close(true); at testPlotUpdates (/home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:91:26) at /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:129:5

Check failure on line 91 in ui-tests/tests/ipyopenlayers.test.ts

View workflow job for this annotation

GitHub Actions / visual-regression-tests

tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties

1) tests/ipyopenlayers.test.ts:125:7 › ipyopenlayers Visual Regression › Light theme: Check ipyopenlayers update plot properties Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: Expected an image 656px by 501px, received 912px by 501px. 15 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts-snapshots/light-map-update-ipynb-cell-0-linux.png Received: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties-retry3/light-map-update-ipynb-cell-0-actual.png Diff: /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/test-results/tests-ipyopenlayers-ipyopenlayers-Visual-Regre-a3197-heme-Check-ipyopenlayers-update-plot-properties-retry3/light-map-update-ipynb-cell-0-diff.png 89 | 90 | for (let i = 0; i < cellCount; i++) { > 91 | expect(results[i]).toMatchSnapshot(getCaptureImageName(contextPrefix, notebook, i), {threshold: 0.5}); | ^ 92 | } 93 | 94 | await page.notebook.close(true); at testPlotUpdates (/home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:91:26) at /home/runner/work/ipyopenlayers/ipyopenlayers/ui-tests/tests/ipyopenlayers.test.ts:129:5
}

await page.notebook.close(true);
Expand Down

0 comments on commit 13a8c65

Please sign in to comment.