JasonWongYH / android-test-kit

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

typeText not working #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
see: http://stackoverflow.com/questions/20436968/espresso-typetext-not-working

What is the expected output? What do you see instead?
Expected that I see text in the EditText. Instead, no text appears.

What version of the product are you using? On what operating system?
espresso-1.0.SNAPSHOT-bundled.
Eclipse ADT 22.0.5 on Windows 7 Pro.

Please provide any additional information below.
Tried in an emulator with soft or hard keyboard, tried on the phone too. Same 
issue. Seems to be a focus issue

Original issue reported on code.google.com by kot...@gmail.com on 13 Dec 2013 at 10:54

GoogleCodeExporter commented 9 years ago
Can you try the same action/assert without the ViewPager (just to eliminate 
that factor). If it still doesn't work, it could me something with the IME.

Original comment by vale...@google.com on 16 Dec 2013 at 6:20

GoogleCodeExporter commented 9 years ago
Does it work when you manually type text into the EditText field?

If so, could you please attach a logcat from the test run?
adb logcat -c
run test
adb logcat > log.txt

Original comment by valera.z...@gmail.com on 18 Dec 2013 at 10:29

GoogleCodeExporter commented 9 years ago
Here you go.
I see it clicking on the input, the cursor shows up, but nothing happens.

Test case is very simple:

public void testCompanySearch() throws InterruptedException {

        //type the search criteria
        onView(withId(R.id.titleInput)).perform(ViewActions.click());

onView(withId(R.id.titleInput)).perform(ViewActions.typeText("Glassdoor"));

onView(withId(R.id.titleInput)).check(matches(withText("Glassdoor")));
}

If I change it to this, it works:

public void testCompanySearch() throws InterruptedException {

        //type the search criteria
        final TextView titleInput =
(TextView)getActivity().findViewById(R.id.titleInput);
        getInstrumentation().runOnMainSync(new Runnable() {
            public void run() {
                titleInput.setText("Glassdoor");
            }
        });

onView(withId(R.id.titleInput)).check(matches(withText("Glassdoor")));
}

Original comment by kot...@gmail.com on 19 Dec 2013 at 8:05

GoogleCodeExporter commented 9 years ago
Any developments on this?

Original comment by kot...@gmail.com on 3 Jan 2014 at 8:51

GoogleCodeExporter commented 9 years ago

OK, some new developments from my side. I did some more testing across a bunch 
of different devices and found that this test actually works, but only on 
Samsung.

Works on the Samsung S4 (GD-I9505G) and Samsung S4 Mini (GT-I9190) running OS 
4.2.2.

It doesn't work on a Nexus 4 phone (running OS 4.2.1)
It doesn't work on my HTC One (running 4.4)
It doesn't work on any emulator. (For emulators, we've tried everything from 
different OS versions to Intel vs ARM emulation, to checking/unchecking the 
hardware keyboard present and various screen size configuration).

I'm really at a loss why it would be working on Samsungs only. The samsungs are 
wifi-only and not on data plan, just like our Nexus 4 testing device. It's 
gotta be something related to the device, but I can't figure out what.

Original comment by kot...@gmail.com on 4 Jan 2014 at 12:43

GoogleCodeExporter commented 9 years ago
Looks like I figured out the issue with the emulators. 
Had to go to Settings -> Language & Input -> switch the Default Input to Sample 
Soft Keyboard. It works now. 

Original comment by kot...@gmail.com on 4 Jan 2014 at 12:58

GoogleCodeExporter commented 9 years ago
And fixed the last two phones by installing a software keyboard from the Play 
store and switching to them. It appears that the native keyboards of HTC One 
and Nexus 4 do not work. 

Original comment by kot...@gmail.com on 4 Jan 2014 at 1:17

GoogleCodeExporter commented 9 years ago
Looks like you figured out the issue.

Original comment by vale...@google.com on 9 Jan 2014 at 7:29

GoogleCodeExporter commented 9 years ago
I'm seeing this issue too. "Install a different keyboard" doesn't really seem 
like a fix?

Original comment by danielgr...@gmail.com on 30 Sep 2014 at 3:10

GoogleCodeExporter commented 9 years ago
This definitely seems like a bug. Calabash is able to type into those text 
fields, and I'm having a problem where it can write in some EditTexts but not 
others.

Original comment by cketc...@etsy.com on 5 Dec 2014 at 8:54