olexale / bdd_widget_test

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

Feature tags misplaced #38

Closed GuillaumeMorinQc closed 1 year ago

GuillaumeMorinQc commented 1 year ago

Tags from feature are placed between general imports and local imports. this prevent tags to be used to filter tests. Example feature file :

@admin
  Feature: feature admin

  Rule: Wrong usage of the app

      Background: 
          Given The application is running
      @Id-59313
      @run_type_Manual
      Scenario: Wrong way to use the app
          When I do a wrong step
          Then I should have the wrong result

Resulting dart test file :

// 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';

@Tags(['admin'])
import './../../bdd_steps,/the_application_is_running.dart';
import './../../bdd_steps,/i_do_a_wrong_step.dart';
import './../../bdd_steps,/i_should_have_the_wrong_result.dart';

void main() {
  Future<void> bddSetUp(WidgetTester tester) async {
    await theApplicationIsRunning(tester);
  }
  group('''feature admin''', () {
    testWidgets('''Wrong way to use the app''', (tester) async {
      await bddSetUp(tester);
      await iDoAWrongStep(tester);
      await iShouldHaveTheWrongResult(tester);
    }, tags: ['Id-59313', 'run_type_Manual']);
  });
}

@Tags(['admin']) should be placed before any imports

olexale commented 1 year ago

Released in 1.5.0. Thanks again for your contribution!