• Often in the test you need to swipe or scroll. Writing const Offset scrollDown = Offset(0, -120) every time is inconvenient. If you need to change - cumbersome. Therefore, there are files with gestures that are called in steps.

    For example, gestures for scrolling screens in general gestures.

     

    Functions

    We have added new functions for working with autotests in Flutter quality assurance process to make your work more convenient and optimal.

     

    For example,

    pump

    In Widget and E2E tests, you need to make a pump between actions, which constantly helps the application spin further. You have to tell the test environment yourself that you want to rebuild the Widget. If you don't do Pump, the application stands still.


    votre commentaire
  • It is more convenient to store all keys in the application folder. So developers and testers always know what key is needed for. If the key is not a test key, then most likely it is needed for something.

     

    A plus:

     

    • Improves code readability.
    • Auto-completion helps in compiling locators.
    • There are no errors or typos in the text of the keys: they are unique and refer to a variable.
    • Screen and key classes do not need to be initialized: they have no physical meaning.

     

    Reusable Methods

    The Reusable methods шт quality assurance mirror the screens but provide methods for the steps to avoid duplicating code. Almost always in utils you need access to WidgetTester, and passing it as a function parameter is not very nice, so we use extension.

     

    extension AuthExtendedWidgetTester on WidgetTester {

    /// Method for entering a pin code [pin]. The screen is given by [pinNumber]

    /// because The Finder of the button depends on the screen AND the number of the pin, so we get the Finder in this method

     

      Future<void> enterPin(String pin, Finder Function(String) pinNumber) async {

        final streamPin = Stream.fromIterable(pin.split(''));

        await pumpForDuration(const Duration(milliseconds: 500));

        await for (final String ch in streamPin) {

          await implicitTap(pinNumber(ch));

        }

      }

    }


    votre commentaire



    Suivre le flux RSS des articles
    Suivre le flux RSS des commentaires