bazookon / giphy_get

Flutter plugin
MIT License
27 stars 67 forks source link

writing integration tests with giphy get #24

Open Bhupesh-V opened 2 years ago

Bhupesh-V commented 2 years ago

Any ideas on how to write integration tests for widgets having giphy_get?

A normal flow would be like

  1. Clicking on a button
  2. Giphy get bottom sheet pops up
  3. Get GIFs/Images in View using Finder
  4. Click on a certain GIF

optional steps:

  1. Switching b/w GIFs/Stickers/Emojis tab
  2. Searching for gifs

Any tips would be helpful

Bhupesh-V commented 2 years ago

Update found how to find gifs in view

 // Check giphy_get codebase, file: giphy_tab_detail.dart
    final allGIFs = find.descendant(
      of: find.byType(InkWell),
      matching: find.byType(ExtendedImage),
    );
    expect(allGIFs, findsWidgets);
    // click on 2nd gif
    await tester.tap(allGIFs.at(2));
    await tester.pumpAndSettle();
bazookon commented 2 years ago

Can you add it to the example app?

Bhupesh-V commented 2 years ago

Can you add it to the example app?

Sure will send a PR for widget tests in example app. I see there a non right now 👍 Do you have any other guidelines for me while writing tests for the example app?

bazookon commented 2 years ago

I wrote a simple integration test from documentation, if you add it to that, apreciate!

Bhupesh-V commented 2 years ago

Sure 👍🏽 will be sending a PR soon