草庐IT

run_test

全部标签

android - 如何使用android espresso test设置textview的可见性

我想设置测试用例中TextView的可见性。我正在使用Espresso来测试UI。我使用viewAction将文本设置为TextView。但我想为TextView设置可见性。请任何人帮助我解决这个问题。这是我将文本设置为TextView的代码。publicViewActionsetTextInTextView(finalStringvalue){returnnewViewAction(){@SuppressWarnings("unchecked")@Overridepublicvoidperform(UiControlleruiController,Viewview){((TextVi

安卓/Admob : Can I set a list of testing devices in the Layout XML for the AdView?

因此,目前我的布局中有一个AdView,如下所示:而且效果很好。但是,我必须在源代码中获取AdView,以便向它传递对Emulator和我的个人电话的请求,使其成为TestingDevices而不会接收真实广告。有没有办法可以直接在XML中列出这些内容?或者甚至强制AdView仅显示测试广告,这样我就不必拥有那段代码,并且可以将AdView设置为loadAdOnCreate?谢谢。 最佳答案 当然,将此添加到xml中:ads:testDevices="TEST_EMULATOR,TEST_DEVICE_ID"我在这里找到它:http

安卓测试 : TestCase is run but ActivityInstrumentationTestCase2 not

我正在使用AndroidStudio。我有两个测试。一个扩展importjunit.framework.TestCase另一个importandroid.test.ActivityInstrumentationTestCase2;第一个是从AndroidStudio和命令行运行的:~/Software/android-studio/sdk/platform-tools/adbshellaminstrument-w-r-edebugfalsecom.gruszczy.eisenhower.test/android.test.InstrumentationTestRunnerINSTRUM

android - DownloadManager - 收到 ACTION_DOWNLOAD_COMPLETE,但状态为 STATUS_RUNNING

我在ACTION_DOWNLOAD_COMPLETE的list中注册了一个BroadcastReceiver播送。当我收到这个广播时,我提取下载id:publicclassDownloadCompleteBroadcastReceiverextendsBroadcastReceiver{@OverridepublicvoidonReceive(Contextcontext,Intentintent){if(intent!=null){Stringaction=intent.getAction();if(DownloadManager.ACTION_DOWNLOAD_COMPLETE.e

android - Robolectric 与 test.R.java

我在API21有一个使用robolectric3.0的库项目,带有com.android.tools.build:gradle:1.3.1。我想使用测试资源(好像在src/androidTest/res/...下),即com.mypackage.test.R.java(如反对用于生产的com.mypackage.R.java)在robolectric测试中。我目前拥有的:目录结构为src/main/javarestest/java//noresherebecauseit'snotpickedupandroidTest/res//pickedupbyandroidTestbuildvar

unit-testing - flutter 单元测试失败

我试图在Flutter中进行单元测试。在pubspec.yaml中包含依赖项:测试:任意运行flutteranalyze不会显示任何警告。在我的项目的test文件夹下创建了一个unit_test.dart:import'package:test/test.dart';voidmain(){test('thisisatest',(){expect(42,equals(42));//expect(42,42);});}运行fluttertest显示以下错误:➜HelloFlutterfluttertesttest/unit_test.dart00:00+0:loading/home/tr/

unit-testing - flutter 单元测试失败

我试图在Flutter中进行单元测试。在pubspec.yaml中包含依赖项:测试:任意运行flutteranalyze不会显示任何警告。在我的项目的test文件夹下创建了一个unit_test.dart:import'package:test/test.dart';voidmain(){test('thisisatest',(){expect(42,equals(42));//expect(42,42);});}运行fluttertest显示以下错误:➜HelloFlutterfluttertesttest/unit_test.dart00:00+0:loading/home/tr/

java - 安卓 2.2 : How to make an app to run automaticly on startup & how to make an app start another app

主题几乎说明了一切。 最佳答案 使用BroadcastReceiver接收ActionBOOT_COMPLETED的Intent。在onReceive()方法中为您的Activity创建一个Intent:@OverridepublicvoidonReceive(Contextcontext,Intentintent){IntentmyIntent=newIntent(context,YourActivity.class);context.startActivity(myIntent);}

android - Roboguice 和模拟 : How to have roboguice inject a mock service when testing but use the REAL otherwise?

刚接触roboguice,我喜欢它!我有很多方法依赖于DB和LocationManger等,因此当我测试它们时,它使用真实的对象,我想模拟这些对象,这样当我测试时我就不必依赖在任何事情上。我也一直在使用mockito,但我不确定我该怎么做?我知道android系统带有各种mock,但我认为用mockito推出我自己的mock会更好吗?无论哪种情况,我都需要在测试时注入(inject)它们。有人对此有任何想法吗?提前致谢 最佳答案 看看https://github.com/roboguice/roboguice/blob/master

android - Google Cloud Test Lab 是否支持 Appium 测试?

我们正在使用带有testNG的Appium来测试我们的android应用程序。在研究云测试实验室时,我没有找到任何关于支持appium测试的GoogleCloudTestLab的文档。那么,googletestcloud支持Appium测试吗?进一步的研究使我转向了Amazon网络服务、Sauce实验室和Xamarin测试云。以下哪项最适合Android应用测试?提前致谢。 最佳答案 目前GoogleCloud测试实验室(现为Firebase测试实验室)不支持运行Appium测试。 关于