Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test widget with animation and image #136

Open
1 task done
vlkonoshenko opened this issue Nov 15, 2024 · 1 comment
Open
1 task done

fix: test widget with animation and image #136

vlkonoshenko opened this issue Nov 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@vlkonoshenko
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Version

0.10.0

Description

The error occurs when trying to test a widget with an image and infinite animation

Steps to reproduce

  1. When testing a widget with an image and an endless animation,
  2. If it is a precacheImages function, and it has a command at the end, await tester.pumpAndSettle(), then it waits for the end of the frame rendering, but this doesn't happen because there's an endless animation on the screen.
  3. Perhaps we should extend the precacheImages function with a flag to turn off await tester.pumpAndSettle()?

Expected behavior

The test was completed successfully.

Screenshots

Снимок экрана 2024-11-15 в 11 20 08

Additional context and comments

Example

goldenTest(
    'Animation with image',
    fileName: 'example',
    pumpBeforeTest: precacheImages,
    pumpWidget: (tester, widget) async {
      await tester.pumpWidget(widget);
      await tester.pump(Durations.medium4);
    },
    builder: () {
      return GoldenTestGroup(
        scenarioConstraints:
            const BoxConstraints(maxWidth: 1200, minWidth: 600),
        children: [
          GoldenTestScenario(
            name: 'Animation',
            child: const Column(
              children: [
                CircularProgressIndicator(
                  color: Colors.red,
                ),
                SizedBox.square(
                  dimension: 120,
                  child: Image(image: AssetImage(UiKitImages.cluster)),
                ),
              ],
            ),
          ),
        ],
      );
    },
  );
@vlkonoshenko vlkonoshenko added the bug Something isn't working label Nov 15, 2024
@vlkonoshenko
Copy link
Author

#137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant