title: Simple integration testing using Flutter
body: <p>I am testing a flutter application. I am to run an integration testing, just like Espresso and Selenium allow UI testing, based on my reading, I got to understand that testing Flutter UI will require setting up the integration model. In Selenium <code>findById</code> and Espresso, we can use , <code>R.id.unique_element_id</code>.</p>
  
  <p>I have tried undertsanding the unique id to reference widgets in Flutter but do not understand. Any simple test for a form like this</p>
  
  <pre><code>mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              new Text(
                'You have pushed the button this many times:',
              ),
              new TextFormField(
                decoration: new InputDecoration(
                    labelText: 'Enter your username'
                ),
              ),
              new TextFormField(
                decoration: new InputDecoration(
                    labelText: 'Enter your phone number'
                ),
                keyboardType: TextInputType.number,
              ),
  
              new Text(
                '$_counter',
                style: Theme.of(context).textTheme.display1,
              ),
            ],
  </code></pre>
  
  <p>Setup the test file like this</p>
  
  <pre><code>    import 'package:flutter_driver/flutter_driver.dart';
      import 'package:test/test.dart';
  
      void main() {
        FlutterDriver driver;
  
        setUpAll(() async {
          driver = await FlutterDriver.connect();
        });
  
        tearDownAll(() async {
          if(driver != null){
            driver.close();
          }
        });
  
  
  test('tap on the button, verify result', () async {
      final SerializableFinder username = find.byValueKey('usernametextfield');
      expect(username, isNotNull);
      //insert value into username
  
      final SerializableFinder phonenumber = find.byValueKey('phone');
      expect(phonenumber, isNotNull);
      //insert value into phonenumber
  });
  </code></pre>
  
  <p>How do I create such a tetscase and run. the comments <code>//insert value into username</code> and <code>//insert value into phonenumber</code> are actual testcases I want to complete.</p>