Skip to content

Commit f8ee557

Browse files
committed
this still does not work
1 parent cb7cef9 commit f8ee557

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

tests/e2e/tutorials/jupyters.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ async function runTutorial() {
2727

2828
const workbenchData = utils.extractWorkbenchData(studyData["data"]);
2929
await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][1], workbenchData["nodeIds"][2]]);
30+
await tutorial.waitFor(2000);
3031

3132
// open jupyterNB
3233
await tutorial.openNode(1);
@@ -51,15 +52,19 @@ async function runTutorial() {
5152
// inside the first notebook, click Run all button
5253
const runAllButtonSelector = '#run_int > button:nth-child(4)';
5354
await utils.waitAndClick(nbIframe, runAllButtonSelector)
55+
5456
// inside the first notebook, click confirm run all
5557
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");
5659
await utils.waitAndClick(nbIframe, confirmRunAllButtonSelector)
60+
await tutorial.takeScreenshot("pressRunNotebookAfterConfirm");
5761
// now check that the input contains [4]
5862
console.log('Waiting for notebook results...');
5963
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);
6266
const value = await nbIframe.evaluate(el => el.textContent, element);
67+
await tutorial.takeScreenshot("notebookAfterRun");
6368
console.log('Checking results for the notebook cell:', value);
6469

6570
await tutorial.openNodeFiles(1);
@@ -91,17 +96,21 @@ async function runTutorial() {
9196

9297
// click Run Menu
9398
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)
96100
await tutorial.waitFor(1000);
97101

98102
// click Run All Cells
99103
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);
103112
await tutorial.takeScreenshot("pressRunJLab");
104-
113+
await tutorial.waitFor(5000);
105114
console.log('Checking results for the jupyter lab:');
106115
await tutorial.openNodeFiles(2);
107116
const outFiles2 = [

0 commit comments

Comments
 (0)