sangmingming / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

could not run the cases of the same test class together #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.run the cases one by one,all the cases pass
2.run the cases of the same test class,only the first case pass
What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
robotium 2.4

Please provide any additional information below.

Original issue reported on code.google.com by lengguan...@gmail.com on 2 Aug 2011 at 3:27

GoogleCodeExporter commented 9 years ago
I think there may be some thing wrong in setUp or tearDown

       protected void setUp() throws Exception {
        super.setUp();
        mInst = getInstrumentation();
        mActivity = launchActivity();
        mSolo = new Solo(mInst, mActivity);
        SystemClock.sleep(2000);
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
        if (mActivity != null) {
            mActivity.finish();
            SystemClock.sleep(2000);
            mActivity = null;
        }
        mSolo = null;
        mInst = null;
    }

Original comment by lengguan...@gmail.com on 2 Aug 2011 at 3:35

GoogleCodeExporter commented 9 years ago
Use solo.finalize() in your teardown. 

Original comment by renasr...@gmail.com on 2 Aug 2011 at 7:34

GoogleCodeExporter commented 9 years ago
I get the same result when I call solo.finalize() in teardown
thank you

Original comment by lengguan...@gmail.com on 3 Aug 2011 at 1:36

GoogleCodeExporter commented 9 years ago
if I remove mSolo = null from teardown,all the cases passed

Original comment by lengguan...@gmail.com on 3 Aug 2011 at 2:49