@@ -27,6 +27,7 @@ async function runTutorial() {
27
27
28
28
const workbenchData = utils . extractWorkbenchData ( studyData [ "data" ] ) ;
29
29
await tutorial . waitForServices ( workbenchData [ "studyId" ] , [ workbenchData [ "nodeIds" ] [ 1 ] , workbenchData [ "nodeIds" ] [ 2 ] ] ) ;
30
+ await tutorial . waitFor ( 2000 ) ;
30
31
31
32
// open jupyterNB
32
33
await tutorial . openNode ( 1 ) ;
@@ -51,15 +52,19 @@ async function runTutorial() {
51
52
// inside the first notebook, click Run all button
52
53
const runAllButtonSelector = '#run_int > button:nth-child(4)' ;
53
54
await utils . waitAndClick ( nbIframe , runAllButtonSelector )
55
+
54
56
// inside the first notebook, click confirm run all
55
57
const confirmRunAllButtonSelector = 'body > div.modal.fade.in > div > div > div.modal-footer > button.btn.btn-default.btn-sm.btn-danger' ;
58
+ await tutorial . takeScreenshot ( "pressRunNotebook" ) ;
56
59
await utils . waitAndClick ( nbIframe , confirmRunAllButtonSelector )
60
+ await tutorial . takeScreenshot ( "pressRunNotebookAfterConfirm" ) ;
57
61
// now check that the input contains [4]
58
62
console . log ( 'Waiting for notebook results...' ) ;
59
63
const finishedRunningCheckboxSelector = '#notebook-container > div:nth-child(5) > div.input > div.prompt_container > div.prompt.input_prompt' ;
60
- await nbIframe . waitForFunction ( 'document.querySelector("' + finishedRunningCheckboxSelector + '").innerText.match(/\[[0-9]+\]/)' )
61
- const element = await nbIframe . $ ( finishedRunningCheckboxSelector )
64
+ await nbIframe . waitForFunction ( 'document.querySelector("' + finishedRunningCheckboxSelector + '").innerText.match(/\[[0-9]+\]/)' ) ;
65
+ const element = await nbIframe . $ ( finishedRunningCheckboxSelector ) ;
62
66
const value = await nbIframe . evaluate ( el => el . textContent , element ) ;
67
+ await tutorial . takeScreenshot ( "notebookAfterRun" ) ;
63
68
console . log ( 'Checking results for the notebook cell:' , value ) ;
64
69
65
70
await tutorial . openNodeFiles ( 1 ) ;
@@ -91,17 +96,21 @@ async function runTutorial() {
91
96
92
97
// click Run Menu
93
98
const mainRunMenuBtnSelector = '#jp-MainMenu > ul > li:nth-child(4)' ;
94
- await jLabIframe . waitForSelector ( mainRunMenuBtnSelector ) ;
95
- await jLabIframe . click ( mainRunMenuBtnSelector ) ;
99
+ await utils . waitAndClick ( jLabIframe , mainRunMenuBtnSelector )
96
100
await tutorial . waitFor ( 1000 ) ;
97
101
98
102
// click Run All Cells
99
103
const mainRunAllBtnSelector = ' body > div.lm-Widget.p-Widget.lm-Menu.p-Menu.lm-MenuBar-menu.p-MenuBar-menu > ul > li:nth-child(17)' ;
100
- await jLabIframe . waitForSelector ( mainRunAllBtnSelector ) ;
101
- await jLabIframe . click ( mainRunAllBtnSelector ) ;
102
- await tutorial . waitFor ( 6000 ) ;
104
+ await utils . waitAndClick ( jLabIframe , mainRunAllBtnSelector )
105
+
106
+ console . log ( 'Waiting for jupyter lab results...' ) ;
107
+ const labCompletedInputSelector = 'div.lm-Widget.p-Widget.jp-MainAreaWidget.jp-NotebookPanel.jp-Document.jp-Activity > div:nth-child(2) > div:nth-child(3) > div.lm-Widget.p-Widget.lm-Panel.p-Panel.jp-Cell-inputWrapper > div.lm-Widget.p-Widget.jp-InputArea.jp-Cell-inputArea > div.lm-Widget.p-Widget.jp-InputPrompt.jp-InputArea-prompt' ;
108
+ await jLabIframe . waitForFunction ( 'document.querySelector("' + labCompletedInputSelector + '").innerText.match(/\[[0-9]+\]/)' ) ;
109
+ const jLabElement = await jLabIframe . $ ( labCompletedInputSelector ) ;
110
+ const jLabVvalue = await jLabIframe . evaluate ( el => el . textContent , jLabElement ) ;
111
+ console . log ( 'Checking results for the jupyter lab cell:' , jLabVvalue ) ;
103
112
await tutorial . takeScreenshot ( "pressRunJLab" ) ;
104
-
113
+ await tutorial . waitFor ( 5000 ) ;
105
114
console . log ( 'Checking results for the jupyter lab:' ) ;
106
115
await tutorial . openNodeFiles ( 2 ) ;
107
116
const outFiles2 = [
0 commit comments