olexale / bdd_widget_test

A BDD-style widget testing library
MIT License
101 stars 30 forks source link

Broken comments #73

Closed olexale closed 7 months ago

olexale commented 7 months ago

In 1.7.1 we have broken comments.

Steps to reproduce

Feature: Counter
    Here is a comment
    Background:
        Given the app is running

    After:
        # Just for the demo purpose, you may write "I don't see {'surprise'} text" to use built-in step instead.
        # See the list of built-in step below.
        And I do not see {'surprise'} text 

    # @testMethodName: testGoldens
    Scenario: Initial counter value is 0
        Then I see {'0'} text
   ....

generates:

// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_import, directives_ordering

Here is a comment

# Just for the demo purpose, you may write "I don't see {'surprise'} text" to use built-in step instead.
# See the list of built-in step below.

# @testMethodName: testGoldens

# Scenario: Built-in steps
#     And I don't see {Icons.add} icon
#     And I don't see {'text'} rich text
#     And I don't see {'text'} text
#     And I don't see {Container} widget
#     And I enter {'text'} into {1} input field
#     And I see disabled elevated button
#     And I see enabled elevated button
#     And I see exactly {4} {Container} widgets
#     And I see {Icons.add} icon
#     And I see multiple {'text'} texts
#     And I see multiple {Container} widgets
#     And I see {'text'} rich text
#     And I see {'text'} text
#     And I tap {Icons.add} icon
#     And I wait
#     And I dismiss the page
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import './step/common/the_app_is_running.dart';
import './step/i_do_not_see_text.dart';
import 'package:bdd_widget_test/step/i_see_text.dart';
import 'package:bdd_widget_test/step/i_tap_icon.dart';
import './step/i_tap_icon_times.dart';

void main() {
  group('''Counter''', () {
...

Expected behavior

The generated code should be

// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_import, directives_ordering

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import './step/common/the_app_is_running.dart';
import './step/i_do_not_see_text.dart';
import 'package:bdd_widget_test/step/i_see_text.dart';
import 'package:bdd_widget_test/step/i_tap_icon.dart';
import './step/i_tap_icon_times.dart';

void main() {
  group('''Counter''', () {
    Future<void> bddSetUp(WidgetTester tester) async {
      await theAppIsRunning(tester);
    }
    Future<void> bddTearDown(WidgetTester tester) async {
...