taptest 0.0.5 copy "taptest: ^0.0.5" to clipboard
taptest: ^0.0.5 copied to clipboard

Lightning-fast Flutter testing framework for comprehensive E2E and granular tests with snapshot support.

TapTest #

See https://taptest.dev for Tutorials and more information.

void main() {
  final config = Config(
    variants: Variant.lightAndDarkVariants, // ☀️ 🌙
    httpRequestHandlers: [
      // required for ultra fast Widget tests
      // optional for Integration tests
      MockRegistrationWebservice(success: true),
    ],
    builder: (params) {
      return MyApp(params: params);
    },
  );

  tapTest('E2E test (with Page Object)', config, (tt) async {
    await tt
        .onHomeScreen()
        .snapshot('HomeScreen_initial')
        .enterUsername('John Doe')
        .enterPassword('password123')
        .tapRegister()
        .expectError('Please accept terms.')
        .tapAcceptTerms()
        .tapRegister();

    await tt
        .onWelcomeScreen()
        .expectWelcomeMessage('Welcome John Doe!')
        .snapshot('WelcomeScreen_JohnDoe');
  });

  tapTest('E2E test (plain)', config, (tt) async {
    await tt.expect(AppKeys.homeScreen);
    await tt.snapshot("HomeScreen_initial");
    await tt.type(AppKeys.usernameField, 'John Doe');
    await tt.type(AppKeys.passwordField, 'password123');
    await tt.tap(AppKeys.registerButton);
    await tt.expectText(AppKeys.errorMessage, 'Please accept terms.');
    await tt.tap(AppKeys.acceptTermsCheckbox);
    await tt.tap(AppKeys.registerButton);

    await tt.expect(AppKeys.welcomeScreen);
    await tt.expectText(AppKeys.welcomeMessage, 'Welcome John Doe!');
    await tt.snapshot("WelcomeScreen_JohnDoe");
  });
}
5
likes
0
points
10
downloads

Publisher

verified publishercommingle.app

Weekly Downloads

Lightning-fast Flutter testing framework for comprehensive E2E and granular tests with snapshot support.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, device_info_plus, fake_http_client, file, flutter, flutter_test, integration_test, meta, path, platform, qr, taptest_runtime

More

Packages that depend on taptest