title: Rotated button Espresso Test Click Not Working
body: <p>I was playing with espresso around and I noticed that one of my buttons is failing to click. I tried to move it around on the screen and everything to make it be automatically clicked, but failed. Then I noticed that it had a <code>rotation=180</code>. And by removing it The problem seemed to be resolved, but it is needed.</p>
  
  <p>Here is my code for the test:</p>
  
  <pre><code>@Test
  public void orderUp() throws Exception {
      onView(ViewMatchers.withId(R.id.move_up)).perform(ViewActions.click());
      onView(withText("Up")).inRoot(withDecorView(not(is(menuActivityTestRule.getActivity().getWindow().getDecorView())))).check(matches(isDisplayed()));
  }
  </code></pre>
  
  <p>So, <strong>how to make the test case work for a rotated button?</strong>  </p>
  
  <p>Edit: 'Error Log indicating that The Toast wasn't found I Think'</p>
  
  <pre><code>android.support.test.espresso.NoMatchingRootException: Matcher 'with decor view not is &lt;DecorView@1ec572[MainActivity]&gt;' did not match any of the following roots: [Root{application-window-token=android.view.ViewRootImpl$W@449fd58, window-token=android.view.ViewRootImpl$W@449fd58, has-window-focus=true, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) ty=1 fl=#81810100 pfl=0x20000 wanim=0x103046c needsMenuKey=2 naviIconColor=0}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=1080, height=1920, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) ty=1 fl=#81810100 pfl=0x20000 wanim=0x103046c needsMenuKey=2 naviIconColor=0}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}}]
  at dalvik.system.VMStack.getThreadStackTrace(Native Method)
  at java.lang.Thread.getStackTrace(Thread.java:1567)
  at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:90)
  at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:52)
  at android.support.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:312)
  at android.support.test.espresso.ViewInteraction.check(ViewInteraction.java:291)
  at com.tabbara.mohammad.trailedsheetexample.ExampleInstrumentedTest.orderUp(ExampleInstrumentedTest.java:57)
  at java.lang.reflect.Method.invoke(Native Method)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:433)
  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at org.junit.runners.Suite.runChild(Suite.java:128)
  at org.junit.runners.Suite.runChild(Suite.java:27)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
  at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:58)
  at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:375)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1967)
  </code></pre>