Skip to content

Commit

Permalink
Try to sleep a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Aug 19, 2022
1 parent e552232 commit 22dc2e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui-tests/tests/ipympl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { expect } from '@playwright/test';
import * as path from 'path';
const klaw = require('klaw-sync');

async function sleep(time: number) {
return await new Promise((resolve) => setTimeout(resolve, time));
}

const filterUpdateNotebooks = (item) => {
const basename = path.basename(item.path);
return basename.includes('_update');
Expand Down Expand Up @@ -37,6 +41,7 @@ const testCellOutputs = async (
onAfterCellRun: async (cellIndex: number) => {
const cell = await page.notebook.getCellOutput(cellIndex);
if (cell) {
await sleep(500);
results.push(await cell.screenshot());
numCellImages++;
}
Expand Down Expand Up @@ -78,6 +83,7 @@ const testUpdates = async (page: IJupyterLabPageFixture, tmpPath: string) => {
// Always get first cell output which must contain the plot
const cell = await page.notebook.getCellOutput(0);
if (cell) {
await sleep(500);
results.push(await cell.screenshot());
cellCount++;
}
Expand Down

0 comments on commit 22dc2e1

Please sign in to comment.