The purpose of this post is to shed some light onto the order of operations for test cases written using Espresso’s new ActivityTestRule. Specifically, discussing when methods like beforeActivityLaunched(), afterActivityLaunched(), and afterActivityFinished() are called relative to both the test and activity lifecycle. History Lesson: ActivityInstrumentationTestCase2 First, the old way of instrume
Testing quite often is one of the most neglected aspect in many Software projects, and in Android this has been particulary a common issue since the beginning of the platform. Even Google didn’t seem to be making big efforts to encourage testing: Documentation was almost nonexistent, the tools and frameworks were confusing or hard to use and there was almost impossible to find an open source proje
I've been doing Android instrumentation testing with Dagger, Espresso and Mockito, and I love it. To commemorate the launch of Dagger 2 out of SNAPSHOT, I am sharing a demo repo with Dagger 2, Espresso 2 and Mockito: https://github.com/chiuki/android-test-demo Dagger Components Dependency injection allows our app and test obtain different modules. This is very useful for creating repeatable test c
Introducing Native Driverの超訳。 Native DriverはWeb Driver APIの実装で、WebアプリケーションではなくネイティブアプリケーションのUIを叩くもの。Android版がダウンロード出来るようになったので、ユーザとコントリビュータをゆっくり募集。Google Code (http://nativedriver.googlecode.com/ )に置いてある。iPhone(iOS)版も開発中でもうすぐ使える。 WebDriverはブラウザの機能を綺麗でオブジェクト指向なAPIとして見せてくれるので、Googleでは多くのプラットフォーム上でWebアプリケーションをテストするのにWebDriverを使っている。(WebDriverについては、このブログ記事を参照) なぜWebDriver APIをネイティブアプリケーションに使うのか不思議に思うか
昨日、パプテマス Scirocco 触ってたら中はRobotiumというのを使っていたので調べてみたら、そこそこメジャーなシナリオテストツールだったので、触ってみました。 Robotium とは Androidのシナリオテストを簡単に書けるライブラリです。UIスレッドを意識せずに書けるので、テスト仕様書に近いコードを書くことができます。ブラウザテストツールのSeleniumを意識してるみたいですね。 公式サイト robotium - It's like Selenium, but for Android™ - Google Project Hosting サンプルプロジェクトを動かす。 とりあえずサンプルプロジェクトを動かします。やることは二つ。 SDKのサンプルアプリ notePad をインポート ExampleTestProjectをインポート テスト対象となるプロジェクトはSDKに含
テスト大好きしかだよ。Scirocco っていうUIテスト自動化ツールがリリースされたので触ってみました。 Scirocco Zガンダムのパプテマス・シロッコと関係があるかわからないですが、UIテストの後スクリーンショットを撮って保存したり、レポートを出力することが出来るみたいです。さらに、TMSってのを使うと、プロジェクトメンバーと共有もできるらしい。業務支援ですな。 中ではrobotiumを動かしてるので、記述は簡略されてます。 公式サイトのQuick Start をやってみます。 http://code.google.com/p/scirocco/wiki/QuickStartScirocco Eclipse Plug-in インストール Eclipse Plug-in があるとは!早速インストールしてみます。URLからインストールできます。 http://184.73.200.19
テスト大好きしかだよ。Scirocco っていうUIテスト自動化ツールがリリースされたので触ってみました。 Scirocco Zガンダムのパプテマス・シロッコと関係があるかわからないですが、UIテストの後スクリーンショットを撮って保存したり、レポートを出力することが出来るみたいです。さらに、TMSってのを使うと、プロジェクトメンバーと共有もできるらしい。業務支援ですな。 中ではrobotiumを動かしてるので、記述は簡略されてます。 公式サイトのQuick Start をやってみます。 http://code.google.com/p/scirocco/wiki/QuickStartScirocco Eclipse Plug-in インストール Eclipse Plug-in があるとは!早速インストールしてみます。URLからインストールできます。 http://184.73.200.19
「Java News.jp(Javaに関する最新ニュース)」の安藤幸央氏が、CoolなプログラミングのためのノウハウやTIPS、筆者の経験などを「Rundown」(駆け足の要点説明)でお届けします(編集部) 売れるアプリを作るために重要な“使い心地” iPhoneやAndroidといった携帯電話端末が広まり、本記事の読者はもちろんのこと、通勤電車などでもごく普通にスマートフォンの利用者を見かけるようになりました。単に、iPhone・Androidアプリの利用者としてかかわっている人もいれば、実際にアプリの開発に携わっている人もいるでしょう。 各種スマートフォンアプリを使っていて、何を感じるでしょうか? さまざまなアプリの中にはシンプルで細かいところまで行き届いており、使いやすいアプリもあれば、遅くて使いづらく、頻繁に強制終了してしまうようなアプリまで、玉石混淆(ぎょくせきこんこう)です。
前回の記事で作成したプロジェクトのテストケースを作成 そして、テストでハマったことを中心に記事ってみました するテスト Buttonを押してイメージを表示 イメージをDragAndDrop 画面遷移して、遷移したActivityをfinish(これが一番大変だった) JUnitProjectの作成 Project→New Project → Android Test Projectを選択 Test Target Browseボタン→An existing Android projectを選択 ※ここではDragAndDropSample projectを設定すると自動的にTestProjectNameが設定される Finish 空のTestProjectが生成される ■テストプロジェクトの確認 TestProject右クリック→BuildPath→ダイアログ表示→Projectsタブにテス
この記事を参考にさせていただきました。 以下がサンプルコード。 やりたかったアクティビティからアクティビティの呼び出しが行われたかの確認のみに特化。 テスト対象コード。アクティビティを呼び出す方 package net.krks.android.junitsample; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class JUnitSampleActivity extends Activity { /** Called when the activity
作成したアプリケーションは、どのように動作確認していますか? Androidには、Javaの単体テストのフレームワークである「JUnit」を使用することができます。今回は、その使用方法について説明します。 <1>アプリケーションの仕様を決める まず、作成するアプリケーションの仕様を決定しないといけませんが、今回は下のようなAndroidアプリケーションを作成します。 画面の一番上にEditTextを貼り付ける。 EditTextの下に、TextViewを貼り付ける。 EditText、TextViewの初期値は空文字。 TextViewの下には「コピー」という文字が入ったボタンを貼り付ける。 「コピー」ボタンは、EditTextに文字が入力されていない場合は、ボタンを押下することはできない(無効になっている)。 「コピー」ボタンを押下すると、EditTextの内容がTextViewにコピー
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く