title: Android Instrumentation Test for multiple screen sizes / layouts
body: <p>I have some screen that are split-screen on large screens, but single screen in small screens, as described here: <a href="http://developer.android.com/training/basics/fragments/fragment-ui.html" rel="nofollow">http://developer.android.com/training/basics/fragments/fragment-ui.html</a></p>
  
  <p>I am attempting to write a test case that runs all the functions of my application, and I have mocked all the network calls, and so forth.</p>
  
  <p>The only remaining question I know I have is if there is a proper way to test the multiple layouts.</p>
  
  <p>Right now, I would need to manually run the test case on various AVD with the configurations I want to test, and I have calls in this format:</p>
  
  <pre><code>if( uiDevice.getDisplaySizeDp().x &lt; 600) {
      // we are using the standard layout, so the fragment was opened on top of the stack, instead of side-by-side
      // press Back to get back to the list of objects
      pressBack();
  }
  </code></pre>
  
  <p>I am running Espresso tests with <code>AndroidJUnit4</code> and <code>android.support.test.runner.AndroidJUnitRunner</code>.  </p>
  
  <p>The question is:  Is there a standard/documented method I can share with my team to handle the different layout qualifiers: <code>sw600dp</code>, <code>w900dp</code>, <code>landscape</code>, and so forth.</p>
  
  <p>Alternatively is there a way to specify which test cases would be run for a device that matches the qualifiers?</p>
  
  <p>Update based on drfrag01 answer:</p>
  
  <p>I think I'm looking more for something that might be able to automatically pick which test cases to run, once the runner starts up on the device.  MY best scenario would probably be something where I add annotations @SW600 or @Normal, and then when the test are running on the device, the @SW600 are skipped for a small phone, instead of me setting up all the suites.</p>
  
  <p>It look like this may not be possible, without a custom Test Runner.</p>