mercredi 6 novembre 2019

Platform specific code in Flutter integration tests

I have an integration test that has to open a time picker, but each platform has a different implementation of time picker. Therefor the flow of the integration test must differ between Android and iOS.. how can I achieve this?

I tried using the Platform class like this inside the test file, but it doesnt work:

//* 5) Choose time
      await driver.tap(find.byValueKey('addRideTimePicker'));
      if (Platform.isAndroid) {
        await driver.tap(find.text("V REDU"));
      }

      if (Platform.isIOS) {
        await driver.tap(find.text("OK"));
      }

Any help would be much appreciated, thanks in advance

Aucun commentaire:

Enregistrer un commentaire