Skip to content

Commit

Permalink
setTutorialFailed declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Nov 18, 2024
1 parent 9baf7b8 commit 05b1c78
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 35 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/portal-files/VTK_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function runTutorial () {
await utils.takeScreenshot(page, screenshotPrefix + 'teapot');
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/2D_Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function runTutorial () {
await utils.takeScreenshot(page, screenshotPrefix + 'iFrame2');
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/3D_Anatomical.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(1, outFiles);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/3D_EM.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(2, outFiles);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/BIOS_VNS_Calibrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function runTutorial () {
await tutorial.restoreIFrame();
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/Bornstein.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(0, outFiles);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/CC_Human.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(3, outFiles2);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/CC_Rabbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(3, outFiles2);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/Kember.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function runTutorial () {
await tutorial.takeScreenshot("viewer_after");
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/Mattward.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(0, outFiles);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/portal/opencor.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function runTutorial () {
await tutorial.checkNodeOutputs(0, outFiles);
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/publications/SarValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function runTutorial () {
await tutorial.testSARValidation(sarNodeId);
}
catch(err) {
await tutorial.setTutorialFailed(true, false);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/publications/Voila.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function runTutorial () {
await tutorial.waitForVoilaRendered(iframe);
}
catch(err) {
await tutorial.setTutorialFailed(true, false);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/s4l/sim4life-dipole.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function runTutorial() {
await tutorial.testS4LDipole(s4lNodeId);
}
catch (err) {
tutorial.setTutorialFailed(true, false);
tutorial.setTutorialFailed(err);
console.log('Tutorial error: ' + err);
throw "Tutorial Failed";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/s4l/sim4life-lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function runTutorial(user, pass, newUser, parallelUserIdx) {
await tutorial.testS4L(s4lNodeId);
}
catch (err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
throw "Tutorial Failed";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/s4l/sim4life.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function runTutorial() {
await tutorial.testS4L(s4lNodeId);
}
catch (err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/isolve-gpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function runTutorial() {
await tutorial.checkNodeLogsFunctional();
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/isolve-mpi.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function runTutorial() {
await tutorial.checkNodeLogsFunctional();
}
catch (err) {
await tutorial.setTutorialFailed(true, err);
await tutorial.setTutorialFailed(err);
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/jupyterlabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function runTutorial() {
}
}
catch (err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tutorials/rclone_large.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ async function runTutorial() {

await tutorial.takeScreenshot("after_run_all_menu");


await tutorial.waitFor(60000); // we are creating 12 x 1 GB files with 75 % probability
}
}
catch (err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/rclone_small.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function runTutorial() {
}
}
catch (err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/sleepers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function runTutorial() {
await tutorial.checkNodeLogsFunctional();
}
catch(err) {
await tutorial.setTutorialFailed(true);
await tutorial.setTutorialFailed();
console.log('Tutorial error: ' + err);
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/ti-plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function runTutorial() {
.then(() => page.click(id))
.catch(() => console.log("Preparing Inputs window not found"));

tutorial.setTutorialFailed(true, false);
tutorial.setTutorialFailed(err);
console.log('Tutorial error: ' + err);
throw "Tutorial Failed";
}
Expand Down
13 changes: 2 additions & 11 deletions tests/e2e/tutorials/tutorialBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,6 @@ class TutorialBase {
await auto.showLogger(this.__page, show);
}

async takeLoggerScreenshot() {
await this.takeScreenshot("logger_before");
await this.showLogger(true);
await this.takeScreenshot("logger_after");
}

async runPipeline() {
await this.takeScreenshot("runStudy_before");
await auto.runStudy(this.__page);
Expand Down Expand Up @@ -835,11 +829,8 @@ class TutorialBase {
return this.__reasonFailed;
}

async setTutorialFailed(failed, loggerScreenshot = true, reason = "") {
if (failed && loggerScreenshot) {
await this.takeLoggerScreenshot();
}
this.__failed = failed;
async setTutorialFailed(reason = "") {
this.__failed = true;
this.__reasonFailed = reason
}
}
Expand Down

0 comments on commit 05b1c78

Please sign in to comment.