Skip to content

Commit 587a3e8

Browse files
authored
More e2e (#1845)
* no need to calls catalog/dags anymore * make screenshooter work again * Mark tutorials as failed and throw later
1 parent ed0b00c commit 587a3e8

File tree

13 files changed

+68
-49
lines changed

13 files changed

+68
-49
lines changed

tests/e2e/portal/2D_Plot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const screenshotPrefix = "2DPlot_";
1717
async function runTutorial () {
1818
const tutorial = new tutorialBase.TutorialBase(anonURL);
1919

20-
tutorial.initScreenshoter();
20+
tutorial.startScreenshooter();
2121

2222
const page = await tutorial.beforeScript();
2323
const studyData = await tutorial.openStudyLink();
@@ -54,7 +54,7 @@ async function runTutorial () {
5454
await utils.takeScreenshot(page, screenshotPrefix + 'iFrame2');
5555

5656
await tutorial.logOut();
57-
tutorial.stopScreenshoter();
57+
tutorial.stopScreenshooter();
5858
await tutorial.close();
5959
}
6060

tests/e2e/portal/3D_Anatomical.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "3DAnatomical_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
const studyData = await tutorial.openStudyLink();
2222

@@ -34,7 +34,7 @@ async function runTutorial () {
3434
await tutorial.checkResults(outFiles.length);
3535

3636
await tutorial.logOut();
37-
tutorial.stopScreenshoter();
37+
tutorial.stopScreenshooter();
3838
await tutorial.close();
3939
}
4040

tests/e2e/portal/3D_EM.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "3DEM_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
const studyData = await tutorial.openStudyLink();
2222

@@ -34,7 +34,7 @@ async function runTutorial () {
3434
await tutorial.checkResults(outFiles.length);
3535

3636
await tutorial.logOut();
37-
tutorial.stopScreenshoter();
37+
tutorial.stopScreenshooter();
3838
await tutorial.close();
3939
}
4040

tests/e2e/portal/Bornstein.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "Bornstein_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
const studyData = await tutorial.openStudyLink();
2222

@@ -38,7 +38,7 @@ async function runTutorial () {
3838
await tutorial.checkResults(outFiles.length);
3939

4040
await tutorial.logOut();
41-
tutorial.stopScreenshoter();
41+
tutorial.stopScreenshooter();
4242
await tutorial.close();
4343
}
4444

tests/e2e/portal/CC_Human.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "CCHuman_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
await tutorial.goTo();
2222

@@ -57,7 +57,7 @@ async function runTutorial () {
5757
// await tutorial.openNodeRetrieveAndRestart(4);
5858

5959
await tutorial.logOut();
60-
tutorial.stopScreenshoter();
60+
tutorial.stopScreenshooter();
6161
await tutorial.close();
6262
}
6363

tests/e2e/portal/CC_Rabbit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "CCRabbit_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
await tutorial.goTo();
2222

@@ -55,7 +55,7 @@ async function runTutorial () {
5555
// await tutorial.openNodeRetrieveAndRestart(4);
5656

5757
await tutorial.logOut();
58-
tutorial.stopScreenshoter();
58+
tutorial.stopScreenshooter();
5959
await tutorial.close();
6060
}
6161

tests/e2e/portal/Mattward.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "Mattward_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
const studyData = await tutorial.openStudyLink();
2222

@@ -43,7 +43,7 @@ async function runTutorial () {
4343
await tutorial.checkResults(outFiles.length);
4444

4545
await tutorial.logOut();
46-
tutorial.stopScreenshoter();
46+
tutorial.stopScreenshooter();
4747
await tutorial.close();
4848
}
4949

tests/e2e/portal/opencor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const screenshotPrefix = "Opencor_";
1616
async function runTutorial () {
1717
const tutorial = new tutorialBase.TutorialBase(anonURL);
1818

19-
tutorial.initScreenshoter();
19+
tutorial.startScreenshooter();
2020
const page = await tutorial.beforeScript();
2121
await tutorial.goTo();
2222

@@ -36,7 +36,7 @@ async function runTutorial () {
3636
await tutorial.checkResults(outFiles.length);
3737

3838
await tutorial.logOut();
39-
tutorial.stopScreenshoter();
39+
tutorial.stopScreenshooter();
4040
await tutorial.close();
4141
}
4242

tests/e2e/tutorials/jupyters.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function runTutorial() {
1818
const tutorial = new tutorialBase.TutorialBase(url, user, pass, newUser, templateName, enableDemoMode);
1919

2020
try {
21-
tutorial.initScreenshoter();
21+
tutorial.startScreenshooter();
2222
await tutorial.start();
2323
const studyData = await tutorial.openTemplate(1000);
2424

@@ -106,13 +106,18 @@ async function runTutorial() {
106106
await tutorial.removeStudy();
107107
}
108108
catch(err) {
109+
tutorial.setTutorialFailed(true);
109110
console.log('Tutorial error: ' + err);
110111
}
111112
finally {
112113
await tutorial.logOut();
113-
tutorial.stopScreenshoter();
114+
tutorial.stopScreenshooter();
114115
await tutorial.close();
115116
}
117+
118+
if (tutorial.getTutorialFailed()) {
119+
throw "Tutorial Failed";
120+
}
116121
}
117122

118123
runTutorial()

tests/e2e/tutorials/mattward.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function runTutorial() {
1818
const tutorial = new tutorialBase.TutorialBase(url, user, pass, newUser, templateName, enableDemoMode);
1919

2020
try {
21-
tutorial.initScreenshoter();
21+
tutorial.startScreenshooter();
2222
await tutorial.start();
2323
const studyData = await tutorial.openTemplate(1000);
2424

@@ -46,13 +46,18 @@ async function runTutorial() {
4646
await tutorial.removeStudy();
4747
}
4848
catch(err) {
49+
tutorial.setTutorialFailed(true);
4950
console.log('Tutorial error: ' + err);
5051
}
5152
finally {
5253
await tutorial.logOut();
53-
tutorial.stopScreenshoter();
54+
tutorial.stopScreenshooter();
5455
await tutorial.close();
5556
}
57+
58+
if (tutorial.getTutorialFailed()) {
59+
throw "Tutorial Failed";
60+
}
5661
}
5762

5863
runTutorial()

0 commit comments

Comments
 (0)