@@ -33,7 +33,7 @@ async function runTutorial() {
33
33
34
34
const iframeHandles = await tutorial . getIframe ( ) ;
35
35
const iframes = [ ] ;
36
- for ( let i = 0 ; i < iframeHandles . length ; i ++ ) {
36
+ for ( let i = 0 ; i < iframeHandles . length ; i ++ ) {
37
37
const frame = await iframeHandles [ i ] . contentFrame ( ) ;
38
38
iframes . push ( frame ) ;
39
39
}
@@ -65,11 +65,23 @@ async function runTutorial() {
65
65
66
66
67
67
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 ) => {
69
73
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 });
73
85
74
86
75
87
@@ -87,7 +99,7 @@ async function runTutorial() {
87
99
88
100
const iframeHandles2 = await tutorial . getIframe ( ) ;
89
101
const iframes2 = [ ] ;
90
- for ( let i = 0 ; i < iframeHandles2 . length ; i ++ ) {
102
+ for ( let i = 0 ; i < iframeHandles2 . length ; i ++ ) {
91
103
const frame = await iframeHandles2 [ i ] . contentFrame ( ) ;
92
104
iframes2 . push ( frame ) ;
93
105
}
0 commit comments