Skip to content

Commit b81744c

Browse files
committed
still wondering
1 parent 7128cc6 commit b81744c

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

tests/e2e/tutorials/jupyters.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function runTutorial() {
3333

3434
const iframeHandles = await tutorial.getIframe();
3535
const iframes = [];
36-
for (let i=0; i<iframeHandles.length; i++) {
36+
for (let i = 0; i < iframeHandles.length; i++) {
3737
const frame = await iframeHandles[i].contentFrame();
3838
iframes.push(frame);
3939
}
@@ -65,11 +65,23 @@ async function runTutorial() {
6565

6666

6767

68-
async function checkNotebookCompleted(page, el, expected_value) {
68+
// async function checkNotebookCompleted(page, el) {
69+
// let value = await page.evaluate(el => el.textContent, el);
70+
// return value.match(/\[[0-9]+\]/) != null;
71+
// }
72+
await nbIframe.waitForFunction(async (page, el) => {
6973
let value = await page.evaluate(el => el.textContent, el);
70-
return value.match(expected_value) != null;
71-
}
72-
await nbIframe.waitForFunction(checkNotebookCompleted(nbIframe, inputElement, /\[[0-9]+\]/g), { polling: 200, timeout: 20000 });
74+
if (value.match(/\[[0-9]+\]/)) {
75+
return true;
76+
} else {
77+
return false;
78+
}
79+
}, {}, nbIframe, inputElement);
80+
// await nbIframe.waitForFunction(async (page, selector) => {
81+
// element = await page.$(selector);
82+
// return element.innerText.match(/\[[0-9]+\]/) != null;
83+
// }, { polling: 200, timeout: 20000 }, nbIframe, finishedRunningCheckboxSelector);
84+
// checkNotebookCompleted(nbIframe, inputElement, /\[[0-9]+\]/g), { polling: 200, timeout: 20000 });
7385

7486

7587

@@ -87,7 +99,7 @@ async function runTutorial() {
8799

88100
const iframeHandles2 = await tutorial.getIframe();
89101
const iframes2 = [];
90-
for (let i=0; i<iframeHandles2.length; i++) {
102+
for (let i = 0; i < iframeHandles2.length; i++) {
91103
const frame = await iframeHandles2[i].contentFrame();
92104
iframes2.push(frame);
93105
}

0 commit comments

Comments
 (0)