Closed Bug 1028929 Opened 6 years ago Closed 6 years ago

Android 2.3 testDoorHanger | Exception caught - junit.framework.AssertionFailedError: Click can not be completed!

Categories

(Firefox for Android :: Testing, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 34

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file, 1 obsolete file)

testDoorHanger has been running reliably on Android 2.3 on ix.

We are now trying to migrate to aws slaves, and when we do, this failure occurs.

https://tbpl.mozilla.org/php/getParsedLog.php?id=42193343&tree=Ash&full=1#error0

20:33:05     INFO -  6 INFO TEST-PASS | testDoorHanger | Geolocation doorhanger has been displayed - true should equal true
20:33:05     INFO -  Exception caught during test!
20:33:05     INFO -  junit.framework.AssertionFailedError: Click can not be completed!
20:33:05     INFO -  	at junit.framework.Assert.fail(Assert.java:47)
20:33:05     INFO -  	at junit.framework.Assert.assertTrue(Assert.java:20)
20:33:05     INFO -  	at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:99)
20:33:05     INFO -  	at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:182)
20:33:05     INFO -  	at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:156)
20:33:05     INFO -  	at com.jayway.android.robotium.solo.Clicker.clickOn(Clicker.java:419)
20:33:05     INFO -  	at com.jayway.android.robotium.solo.Solo.clickOnCheckBox(Solo.java:1152)
20:33:05     INFO -  	at org.mozilla.gecko.tests.testDoorHanger.testDoorHanger(testDoorHanger.java:43)
20:33:05     INFO -  	at java.lang.reflect.Method.invokeNative(Native Method)
20:33:05     INFO -  	at java.lang.reflect.Method.invoke(Method.java:507)
20:33:05     INFO -  	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)
20:33:05     INFO -  	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)
20:33:05     INFO -  	at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)
20:33:06     INFO -  	at org.mozilla.gecko.tests.BaseTest.runTest(BaseTest.java:141)
20:33:06     INFO -  	at junit.framework.TestCase.runBare(TestCase.java:127)
20:33:06     INFO -  	at junit.framework.TestResult$1.protect(TestResult.java:106)
20:33:06     INFO -  	at junit.framework.TestResult.runProtected(TestResult.java:124)
20:33:06     INFO -  	at junit.framework.TestResult.run(TestResult.java:109)
20:33:06     INFO -  	at junit.framework.TestCase.run(TestCase.java:118)
20:33:06     INFO -  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
20:33:06     INFO -  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
20:33:06     INFO -  	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)
20:33:06     INFO -  	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1448)
20:33:06     INFO -  7 INFO TEST-UNEXPECTED-FAIL | testDoorHanger | Exception caught - junit.framework.AssertionFailedError: Click can not be completed!
20:33:06     INFO -  8 INFO TEST-END | testDoorHanger | finished in 70880ms
20:33:06     INFO -  9 INFO TEST-START | Shutdown
Disabled on 2.3: https://hg.mozilla.org/integration/mozilla-inbound/rev/bd745c0dad53
Whiteboard: [leave open] [test disabled on Android 2.3]
Attached patch wip (obsolete) — Splinter Review
This patch is effective and allows this test to be re-enabled, but needs some cleanup.

https://tbpl.mozilla.org/?tree=Try&rev=8ae3377d9b26
This patch addresses 2 issues which occur in numerous places in the test:

 - The test should wait for the door hanger checkbox to be clickable before trying to click it.
 - The test should wait for text to be dismissed before checking that it has been dismissed.

The very last check in the test is particularly problematic: As it was written, LOGIN_MESSAGE is not displayed; then we reload a page and check that LOGIN_MESSAGE is still not displayed. How do we know when to check / how long to wait? Since this is just a repeat of a previous test sequence (done more sanely, earlier in the test), I did not see much value to it, and simply removed this last check. 

The result is a rock-solid sea of green:

https://tbpl.mozilla.org/?tree=Try&rev=a97c3baae037
Attachment #8451626 - Attachment is obsolete: true
Attachment #8459028 - Flags: review?(wjohnston)
Comment on attachment 8459028 [details] [diff] [review]
make testDoorHanger more robust

Review of attachment 8459028 [details] [diff] [review]:
-----------------------------------------------------------------

Good to have these running :) I wonder if we could file a follow up to make these more componentized. i.e. It would be nice to wrap these patterns up in one of the components classes so that these would look something like:

DoorHangers.findFor("Some message")
           .hasCheckbox()
           .clickButton("OK")
           .isDismissed();

mcomella would know better what matches our existing patterns there though.

::: mobile/android/base/tests/testDoorHanger.java
@@ +161,3 @@
>  
> +    // wait for a CheckBox view that is clickable
> +    private void waitForCheckBox() {

It might be nice to pass in the text here and also check that the label was correct.
Attachment #8459028 - Flags: review?(wjohnston) → review+
I appreciate the suggestions, but really just want to get the test running for now, so checked in as-is:

https://hg.mozilla.org/integration/mozilla-inbound/rev/d6f1a64f5ab0
Whiteboard: [leave open] [test disabled on Android 2.3]
https://hg.mozilla.org/mozilla-central/rev/d6f1a64f5ab0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
You need to log in before you can comment on or make changes to this bug.