Исключение: неизвестный исполняемый дочерний элемент, данный FeatureFile 'CommentLineRunnable' - PullRequest
0 голосов
/ 09 ноября 2019

Я написал контрольные примеры BDD в своем приложении. Я получаю «Исключение: неизвестный исполняемый дочерний объект передан FeatureFile« CommentLineRunnable »», когда я запускаю dart test_driver / test_config.dart в терминале проекта.

Мой файл test_config.dart:

import 'dart:async';
import 'package:glob/glob.dart';
import 'package:gherkin/gherkin.dart';
import 'package:flutter_gherkin/flutter_gherkin.dart';
import './steps/loginPage_test.dart';



Future<void> main() {
  final config = FlutterTestConfiguration()
    ..features = [Glob(r"test_driver/features/**.feature")]
    ..stepDefinitions = [
      LoginPageValidation(),
      PasswordValidation(),
      LoginButton(),
      NavValidation()
    ]
    ..reporters = [ProgressReporter(), TestRunSummaryReporter(), JsonReporter()]
    ..restartAppBetweenScenarios = true
    ..targetAppPath = "test_driver/app.dart"
    ..exitAfterTestRun = true;
  return GherkinRunner().execute(config);
}

Я получаю сообщение об ошибке:

Unhandled exception:
Exception: Unknown runnable child given to FeatureFile 'CommentLineRunnable'
#0      FeatureFile.addChild (package:gherkin/src/gherkin/runnables/feature_file.dart:41:9)
#1      GherkinParser._parseBlock (package:gherkin/src/gherkin/parser.dart:119:21)
#2      GherkinParser.parseFeatureFile (package:gherkin/src/gherkin/parser.dart:55:7)
<asynchronous suspension>
#3      GherkinRunner.execute (package:gherkin/src/test_runner.dart:47:43)
<asynchronous suspension>
#4      main (file:///home/al029/Altorum_Projects/altorum-operation-flutter/test_driver/test_config.dart:22:26)
#5      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:19)
#6      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

1 Ответ

0 голосов
/ 09 ноября 2019

Проблема решена удалением комментариев из моего файла функций, но я не понял, почему комментарий в файле объектов вызвал проблему.

# Login Page test
Feature: Login

  User should be able to login successfully after clicking login button.

  Scenario: User logs in successfully
    Given I expect the user enters email
    And I expect the user enters password
    When user hits Login button
    Then user should land on next screen

Я удалил комментарий

Feature: Login

  User should be able to login successfully after clicking login button.

  Scenario: User logs in successfully
    Given I expect the user enters email
    And I expect the user enters password
    When user hits Login button
    Then user should land on next screen

И все работало нормально.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...