flutter_gherkin_wrapper 1.0.1 copy "flutter_gherkin_wrapper: ^1.0.1" to clipboard
flutter_gherkin_wrapper: ^1.0.1 copied to clipboard

Gherkin Widget Tests -- to execute widget (component) tests with Cucumber / Gherkin notation

Flutter Gherkin Wrapper #

Test Status Build Status

Wrapper is used to execute widget (component) tests with Cucumber / Gherkin notation instead of integration tests as done for original flutter_gherkin-package.

Getting started #

Initialization #

// Generate steps from resources
// ./test/e2e/given/generic.dart
@GenerateGherkinResources(['../steps'])
class Generic extends GivenGeneric {}

// Generate list of steps
// ./test/e2e/steps_iterator.dart
@GenerateListOfClasses(['given', 'when', 'then'])
import 'steps_iterator.list.dart';
# /test/e2e/steps/open_expense_form.resource.feature
Feature: Verify Basic Actions

  Scenario: Opened Expense Form
    Given I am on "Home" page
     When I tap "Add Bill, Income or Transfer" button
     Then I can see "Add new Bill" button

Execution #

void main() {
  Iterable<File> features = Directory('./test/e2e')
      .listSync(recursive: true)
      .where(
          (entity) => entity is File && entity.path.endsWith('.test.feature'))
      .cast<File>();

  setUpAll(() {
    TestWidgetsFlutterBinding.ensureInitialized();
    ScreenCapture.enableScreenCapture();
    // MainTest.cleanUpData();
  });

  group('Run All End-To-End Tests', () {
    for (var file in features) {
      testWidgets(file.path, (WidgetTester tester) async {
        // await MainTest.init(tester);
        final runner = FileRunner(tester);
        await runner.init(file);
        // ! to avoid collisions in concurrent requests
        expectSync(await runner.run(), true);
        await tester.pumpAndSettle();
      }, timeout: const Timeout(Duration(minutes: 5)));
    }
  });
}
# /test/e2e/bill/create_different_expenses.test.feature
Feature: Verify Expenses Functionality

  Scenario Outline: Added different Expenses
    Given Opened Expense Form
     When I select "<account>" from "AccountSelector" with "Enter Account Identifier" tooltip
      And ...

In addition to thanking, you may treat us to ☕.

2
likes
0
pub points
38%
popularity

Publisher

verified publishertercad.com

Gherkin Widget Tests -- to execute widget (component) tests with Cucumber / Gherkin notation

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, flutter, flutter_gherkin, flutter_test, gherkin, source_gen

More

Packages that depend on flutter_gherkin_wrapper