• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FlakyTest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.test.filters.FlakyTest的典型用法代码示例。如果您正苦于以下问题:Java FlakyTest类的具体用法?Java FlakyTest怎么用?Java FlakyTest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FlakyTest类属于android.support.test.filters包,在下文中一共展示了FlakyTest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: notCrashWhenLaunchingActivityAndRotatingTheScreenSeveralTimes

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@Ignore("seems to be VERY flacky")
@FlakyTest
public void notCrashWhenLaunchingActivityAndRotatingTheScreenSeveralTimes() throws Exception {
  launchActivityWithPermissionsGranted();
  wait300millis();

  activityRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  assertLocationInfoIsShown();
  activityRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  assertLocationInfoIsShown();
  activityRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  assertLocationInfoIsShown();
  activityRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  assertLocationInfoIsShown();
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:17,代码来源:LocationPickerActivityShould.java


示例2: preview_isShowing

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void preview_isShowing() throws Exception {
    onView(withId(R.id.camera))
            .perform(waitFor(1000))
            .check(showingPreview());
}
 
开发者ID:vshkl,项目名称:PXLSRT,代码行数:8,代码来源:CameraViewTest.java


示例3: showMapWhenTheActivityStarts

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void showMapWhenTheActivityStarts() throws Exception {
  launchActivityWithPermissionsGranted();

  onView(withId(R.id.map)).check(matches(isDisplayed()));
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:8,代码来源:LocationPickerActivityShould.java


示例4: showLocationInfoWhenTheActivityStartsAndHasALocationProvided

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void showLocationInfoWhenTheActivityStartsAndHasALocationProvided() throws Exception {
  launchActivityWithPermissionsGranted();
  wait300millis();
  wait300millis();

  assertLocationInfoIsShown();
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:10,代码来源:LocationPickerActivityShould.java


示例5: showLocationInfoWhenClickingTheMapAndNewLocationIsSelected

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@Ignore("it needs the map to be shown, it probably means the maps api key")
@FlakyTest
public void showLocationInfoWhenClickingTheMapAndNewLocationIsSelected() throws Exception {
  launchActivityWithPermissionsGranted();
  onView(withId(R.id.map)).perform(click());
  wait300millis();

  assertLocationInfoIsShown();
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:11,代码来源:LocationPickerActivityShould.java


示例6: showSuggestedLocationListWhenATextSearchIsPerformed

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void showSuggestedLocationListWhenATextSearchIsPerformed() throws Exception {
  launchActivityWithPermissionsGranted();
  wait300millis();
  onView(withId(R.id.leku_search)).perform(typeText("calle mallorca"));
  onView(withId(R.id.leku_search))
      .check(matches(hasImeAction(EditorInfo.IME_ACTION_SEARCH)))
      .perform(pressImeActionButton());
  wait300millis();
  wait300millis();
  wait300millis();

  onView(withId(R.id.resultlist)).check(matches(isDisplayed()));
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:16,代码来源:LocationPickerActivityShould.java


示例7: notCrashWhenLaunchingActivityAndPermissionsAreNotGranted

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void notCrashWhenLaunchingActivityAndPermissionsAreNotGranted() throws Exception {
  launchActivityWithoutLocationAndPermissions();
  wait300millis();

  onView(withId(R.id.map)).check(matches(isDisplayed()));
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:9,代码来源:LocationPickerActivityShould.java


示例8: notCrashWhenPermissionsAreNotGrantedAndClickToFloatingAction

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void notCrashWhenPermissionsAreNotGrantedAndClickToFloatingAction() throws Exception {
  launchActivityWithoutLocationAndPermissions();
  wait300millis();

  onView(withId(R.id.btnFloatingAction)).perform(click());
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:9,代码来源:LocationPickerActivityShould.java


示例9: hideStreetTextWhenALocationIsSelectedAndStreetTextViewIsHiddenByBundle

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@Ignore("seems to be VERY flacky")
@FlakyTest
public void hideStreetTextWhenALocationIsSelectedAndStreetTextViewIsHiddenByBundle() throws Exception {
  launchActivityWithPermissionsGranted();
  wait300millis();

  onView(withId(R.id.street)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.INVISIBLE)));
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:10,代码来源:LocationPickerActivityShould.java


示例10: showStreetAndZipCodeTextWhenALocationIsSelected

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void showStreetAndZipCodeTextWhenALocationIsSelected() throws Exception {
  launchActivityWithPermissionsGranted();
  wait300millis();

  onView(withId(R.id.city)).check(matches(isDisplayed()));
  onView(withId(R.id.zipCode)).check(matches(isDisplayed()));
}
 
开发者ID:SchibstedSpain,项目名称:Leku,代码行数:10,代码来源:LocationPickerActivityShould.java


示例11: preview_isShowing

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void preview_isShowing() throws Exception {
    onView(withId(com.google.android.cameraview.test.R.id.camera))
            .perform(waitFor(1000))
            .check(showingPreview());
}
 
开发者ID:TheAndroidMaster,项目名称:SimpleCamera,代码行数:8,代码来源:CameraViewTest.java


示例12: submitFeedback_WhenClicked_IntentFired_Flaky

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest // due to intent checking
public void submitFeedback_WhenClicked_IntentFired_Flaky() {
    // When clicking on the submit feedback button
    onView(withId(R.id.give_feedback_button)).perform(click());

    // Then the intent to open the feedback activity for that session is fired
    intended(CoreMatchers.allOf(
            hasComponent(SessionFeedbackActivity.class.getName()),
            hasAction(equalTo(Intent.ACTION_VIEW)),
            hasData(mSessionUri)));
}
 
开发者ID:google,项目名称:iosched,代码行数:13,代码来源:SessionDetailActivity_InScheduleStarredSessionTest.java


示例13: cbtInstructionsAll

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
public void cbtInstructionsAll() {

    goToMainScreen();

    onView(withText("E.coli - Aquagenx CBT")).perform(click());

    takeScreenshot("ed4db0fd3386", -1);

    ViewInteraction appCompatButton2 = onView(
            allOf(withId(R.id.button_instructions), withText("Instructions"),
                    childAtPosition(
                            childAtPosition(
                                    withClassName(is("android.widget.LinearLayout")),
                                    1),
                            1),
                    isDisplayed()));
    appCompatButton2.perform(click());

    for (int i = 0; i < 17; i++) {

        try {
            takeScreenshot("ed4db0fd3386", i);

            onView(withId(R.id.image_pageRight)).perform(click());

        } catch (Exception e) {
            TestUtil.sleep(600);
            Espresso.pressBack();
            TestUtil.sleep(600);
            Espresso.pressBack();
            break;
        }
    }

}
 
开发者ID:akvo,项目名称:akvo-caddisfly,代码行数:38,代码来源:CbtInstructions.java


示例14: testVideoSourceRestart

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
//@SmallTest
public void testVideoSourceRestart() throws InterruptedException {
  Log.d(TAG, "testVideoSourceRestart");
  loopback = true;

  MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_RENDERER_NAME);
  MockRenderer remoteRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, REMOTE_RENDERER_NAME);

  pcClient = createPeerConnectionClient(localRenderer, remoteRenderer,
      createParametersForVideoCall(VIDEO_CODEC_VP8),
      createCameraCapturer(false /* captureToTexture */), null);

  // Wait for local SDP, rename it to answer and set as remote SDP.
  assertTrue("Local SDP was not set.", waitForLocalSDP(WAIT_TIMEOUT));
  SessionDescription remoteSdp = new SessionDescription(
      SessionDescription.Type.fromCanonicalForm("answer"), localSdp.description);
  pcClient.setRemoteDescription(remoteSdp);

  // Wait for ICE connection.
  assertTrue("ICE connection failure.", waitForIceConnected(ICE_CONNECTION_WAIT_TIMEOUT));

  // Check that local and remote video frames were rendered.
  assertTrue("Local video frames were not rendered before video restart.",
      localRenderer.waitForFramesRendered(WAIT_TIMEOUT));
  assertTrue("Remote video frames were not rendered before video restart.",
      remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT));

  // Stop and then start video source a few times.
  for (int i = 0; i < VIDEO_RESTART_ATTEMPTS; i++) {
    pcClient.stopVideoSource();
    Thread.sleep(VIDEO_RESTART_TIMEOUT);
    pcClient.startVideoSource();

    // Reset video renders and check that local and remote video frames
    // were rendered after video restart.
    localRenderer.reset(EXPECTED_VIDEO_FRAMES);
    remoteRenderer.reset(EXPECTED_VIDEO_FRAMES);
    assertTrue("Local video frames were not rendered after video restart.",
        localRenderer.waitForFramesRendered(WAIT_TIMEOUT));
    assertTrue("Remote video frames were not rendered after video restart.",
        remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT));
  }
  pcClient.close();
  assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT));
  Log.d(TAG, "testVideoSourceRestart done.");
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:49,代码来源:PeerConnectionClientTest.java


示例15: testCaptureFormatChange

import android.support.test.filters.FlakyTest; //导入依赖的package包/类
@Test
@FlakyTest
//@SmallTest
public void testCaptureFormatChange() throws InterruptedException {
  Log.d(TAG, "testCaptureFormatChange");
  loopback = true;

  MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_RENDERER_NAME);
  MockRenderer remoteRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, REMOTE_RENDERER_NAME);

  pcClient = createPeerConnectionClient(localRenderer, remoteRenderer,
      createParametersForVideoCall(VIDEO_CODEC_VP8),
      createCameraCapturer(false /* captureToTexture */), null);

  // Wait for local SDP, rename it to answer and set as remote SDP.
  assertTrue("Local SDP was not set.", waitForLocalSDP(WAIT_TIMEOUT));
  SessionDescription remoteSdp = new SessionDescription(
      SessionDescription.Type.fromCanonicalForm("answer"), localSdp.description);
  pcClient.setRemoteDescription(remoteSdp);

  // Wait for ICE connection.
  assertTrue("ICE connection failure.", waitForIceConnected(ICE_CONNECTION_WAIT_TIMEOUT));

  // Check that local and remote video frames were rendered.
  assertTrue("Local video frames were not rendered before camera resolution change.",
      localRenderer.waitForFramesRendered(WAIT_TIMEOUT));
  assertTrue("Remote video frames were not rendered before camera resolution change.",
      remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT));

  // Change capture output format a few times.
  for (int i = 0; i < 2 * CAPTURE_FORMAT_CHANGE_ATTEMPTS; i++) {
    if (i % 2 == 0) {
      pcClient.changeCaptureFormat(WIDTH_VGA, HEIGHT_VGA, MAX_VIDEO_FPS);
    } else {
      pcClient.changeCaptureFormat(WIDTH_QVGA, HEIGHT_QVGA, MAX_VIDEO_FPS);
    }

    // Reset video renders and check that local and remote video frames
    // were rendered after capture format change.
    localRenderer.reset(EXPECTED_VIDEO_FRAMES);
    remoteRenderer.reset(EXPECTED_VIDEO_FRAMES);
    assertTrue("Local video frames were not rendered after capture format change.",
        localRenderer.waitForFramesRendered(WAIT_TIMEOUT));
    assertTrue("Remote video frames were not rendered after capture format change.",
        remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT));
  }

  pcClient.close();
  assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT));
  Log.d(TAG, "testCaptureFormatChange done.");
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:52,代码来源:PeerConnectionClientTest.java



注:本文中的android.support.test.filters.FlakyTest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java View类代码示例发布时间:2022-05-22
下一篇:
Java PublicId类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap