答えて

1

あなたが使用してテスト結果をエクスポートすることができ.htmlを、またはの.xmlファイルにオプション「エクスポートテスト結果」。

Export Test Results img

それが十分でない場合は、Androidのテスト出力コンソールを見てください。たとえば、コマンドをコピーして貼り付けて、独自のスクリプトを作成できます。パワーシェル、またはあなたが望む何か。 ああ、私はきちんと読んでいないと思います申し訳ありません。またthis link

Export Test Results Script img

編集を確認してください。テストごとにコード内のオブジェクトとして結果をキャッチしたいのですか?だから.. @afterを使用することはできません - あなたの関数はパラメータを取ることができません。 TestWatcherを使用すると、Descriptionオブジェクトを取得できますが、テスト時間に関する情報は表示されません。あなたは...あなた自身の時間を計算する場合でも、

@RunWith(AndroidJUnit4.class) 
public class TestClass { 

    private long startTime; 

    @Rule 
    public TestRule watcher = new TestWatcher() { 

     @Override 
     protected void failed(Throwable e, Description description) { 
      long estimatedTime = System.currentTimeMillis() - startTime; 
     } 

     @Override 
     protected void succeeded(Description description) { 
      long estimatedTime = System.currentTimeMillis() - startTime; 
     } 
    }; 

    @org.junit.Test 
    public void Test() { 
     startTime = System.currentTimeMillis(); 
     //your test here 
    } 
} 

はそれが役に立てば幸い!

関連する問題