text: // node sleepers.js [url] [user] [password] [--demo]
  
  const utils = require('../utils/utils');
  const tutorialBase = require('./tutorialBase');
  
  const args = process.argv.slice(2);
  const {
    url,
    user,
    pass,
    newUser,
    enableDemoMode
  } = utils.parseCommandLineArguments(args)
  
  const templateName = "Sleepers";
  
  async function runTutorial() {
    const tutorial = new tutorialBase.TutorialBase(url, templateName, user, pass, newUser, enableDemoMode);
    let studyId
    try {
      await tutorial.start();
      const studyData = await tutorial.openTemplate(1000);
      studyId = studyData["data"]["uuid"];
      console.log("Study ID:", studyId);
  
      await tutorial.waitFor(5000, 'Some time for loading the workbench');
  
      await tutorial.showLogger(true);
      await tutorial.runPipeline();
      await tutorial.waitForStudyDone(studyId, 60000);
      await tutorial.showLogger(false);
  
      const outFiles = [
        "logs.zip",
        "out_1"
      ];
      await tutorial.checkNodeOutputs(0, outFiles);
    }
    catch(err) {
      tutorial.setTutorialFailed(true);
      console.log('Tutorial error: ' + err);
    }
    finally {
      await tutorial.toDashboard()
      await tutorial.removeStudy(studyId);
      await tutorial.logOut();
      await tutorial.close();
    }
  
    if (tutorial.getTutorialFailed()) {
      throw "Tutorial Failed";
    }
  }
  
  runTutorial()
    .catch(error => {
      console.log('Puppeteer error: ' + error);
      process.exit(1);
    });
  