scenario property

  1. @override
ReportActionHandler<ScenarioMessage> get scenario

Implementation

@override
ReportActionHandler<ScenarioMessage> get scenario => ReportActionHandler(
      onStarted: ([message]) async {
        if (message == null) {
          logger.e('Cannot got scenario information');
        } else {
          _testSuites[_testSuiteIndex].testCases.add(TestCase(message.name));
          _testSuites[_testSuiteIndex].tests++;
        }
      },
      onFinished: ([message]) async {
        if (message == null) {
          logger.e('Cannot got scenario information');
        } else {
          if (!message.hasPassed) {
            _testSuites[_testSuiteIndex].failures++;
          }
          _testSuites[_testSuiteIndex].testCases[_testCaseIndex].isPassed =
              message.hasPassed;
          _testSuites[_testSuiteIndex].testCases[_testCaseIndex].time =
              DateTime.now()
                  .difference(_testSuites[_testSuiteIndex]
                      .testCases[_testCaseIndex]
                      .timestamp)
                  .inMilliseconds
                  .toString();
          _testSuites[_testSuiteIndex].time = DateTime.now()
              .difference(_testSuites[_testSuiteIndex].timestamp)
              .inMilliseconds
              .toString();
          //TODO améliorer le calcul du chemin pour la CI
          _testSuites[_testSuiteIndex]
              .testCases[_testCaseIndex]
              .dumpFileContent = currentWorld.dumpFileContent;
          _testSuites[_testSuiteIndex].testCases[_testCaseIndex].screenshotPath =
              "$dirRoot/${p.relative(currentWorld.screenshot?.path.toString() ?? "")}";
          _testCaseIndex++;
        }
      },
    );