Skip to content

Commit 6d03a3e

Browse files
authored
E2e wait for notebook3 (#2199)
* puppeteer fails if going to fast to the next timestamp * set a default value
1 parent f3d9592 commit 6d03a3e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/e2e/tutorials/jupyters.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ async function runTutorial() {
4242

4343
// inside the iFrame, open the first notebook
4444
const notebookCBSelector = '#notebook_list > div:nth-child(2) > div > input[type=checkbox]';
45-
await utils.waitAndClick(nbIframe, notebookCBSelector)
45+
await utils.waitAndClick(nbIframe, notebookCBSelector);
4646
const notebookViewSelector = "#notebook_toolbar > div.col-sm-8.no-padding > div.dynamic-buttons > button.view-button.btn.btn-default.btn-xs"
47-
await utils.waitAndClick(nbIframe, notebookViewSelector)
48-
47+
await utils.waitAndClick(nbIframe, notebookViewSelector);
48+
console.log("notebook iframe found");
49+
await tutorial.waitFor(5000);
4950

5051
// inside the first notebook, click Run all button
5152
const cellMenuSelector = '#menus > div > div > ul > li:nth-child(5) > a'

tests/e2e/utils/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ async function waitForValidOutputFile(page) {
300300
})
301301
}
302302

303-
async function waitAndClick(page, id, timeout) {
303+
async function waitAndClick(page, id, timeout = null) {
304304
await page.waitForSelector(id, {
305305
timeout: (timeout ? timeout : 30000) // default 30s
306306
});

0 commit comments

Comments
 (0)