oscarxie / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

Performing click on fullscreen does not work (Fullscreen Activity Code Template) #140

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
*What steps will reproduce the problem?*
1. Create a new project in android studio using fullscreen activity code 
template
2. Write an espresso test for the activity to perform click

public class FullscreenActivityTest extends ActivityInstrumentationTestCase2 { public FullscreenActivityTest() { super(FullscreenActivity.class); }

@Override
protected void setUp() throws Exception {
    super.setUp();
    getActivity();
}

public void testClickingOnLayout() {
    onView(withId(R.id.fullscreen_content)).perform(click());
}

}

3. Run this test on emulator (any android version from ginger bread to 
lollipop).

*I get this error*
https://gist.github.com/rpattabi/c8bff2e6556bbbeb65ad#file-espresso_fullscreen_c
lick_error

*I have ensured the following:*

 - No lock screen on the emulator
 - All animations turned off
 - No on-screen keyboard, or anything overlayed on top of the app.

*What is the expected output? What do you see instead?*
Click should work on fullscreen too just like non-fullscreen activities

*What version of the product are you using? On what operating system?*
Espresso 2.0; Ubuntu 14.04 64bit

*Additional Info*

I have attached the zip of the sources which reproduce the problem.

Original issue reported on code.google.com by ragunath...@gmail.com on 29 Mar 2015 at 1:26

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to mention. When I create a non-fullscreen app (using blank template), 
performing click works fine. So, the issue is only with fullscreen app.

Original comment by ragunath...@gmail.com on 29 Mar 2015 at 1:30

GoogleCodeExporter commented 9 years ago
Thanks for the detailed bug report. We can investigate further, but my first 
reaction to seeing the error is that it might be impossible to do anything in 
this case.

Are there specific bugs that you're hoping to catch with full screen mode that 
might not show up if you test the activity in normal mode?

Original comment by vale...@google.com on 30 Mar 2015 at 8:47

GoogleCodeExporter commented 9 years ago
The app starts fullscreen. Fullscreen activity code template which provides 
this behavior out of the box. In order to come to normal mode, performing 
action (say click) is required. So this is catch 22.

Even if the app does not start on fullscreen mode, there are typical scenarios 
any app would need to test on fullscreen. For instance, if you take Pocket 
(https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro&hl
=en), scrolling down or swipe up  takes the activity to fullscreen; scrolling 
up or swipe down or touch brings back the action bar, navigation, etc. Espresso 
shall support testing such transitions.

Also, due to additional screen real estate, apps have the option to expose 
extra features (say through buttons) which may go away in normal mode. Not sure 
if this is standard UX on android, yet given a design like this, espresso would 
be expected to help in testing these fullscreen only features.

Original comment by ragunath...@gmail.com on 30 Mar 2015 at 11:43

GoogleCodeExporter commented 9 years ago

Original comment by nkors...@google.com on 5 May 2015 at 5:41

GoogleCodeExporter commented 9 years ago

Original comment by slinz...@google.com on 15 Sep 2015 at 10:58