0
は私circleci config fileあるFAILED:テストはここ
@Test
public void test_ListRepos_ClickOnOneRepo_DisplayDetailWithOnlyThisRepo() {
Given:
{
final String lsOneRepoJSONData = mLocalifyClient.localify().loadRawFile(fr.guddy.androidstarter.test.R.raw.repos_octocat);
final MockResponse loMockResponseWithOneRepo = new MockResponse().setResponseCode(200);
loMockResponseWithOneRepo.setBody(lsOneRepoJSONData);
mMockWebServer.enqueue(loMockResponseWithOneRepo);
try {
mMockWebServer.start(4000);
} catch (@NonNull final Exception loException) {
loException.printStackTrace();
}
mActivity = mActivityTestRule.launchActivity(null);
}
When:
{
mSolo.clickOnText("git-consortium");
}
Then:
{
mSolo.assertCurrentActivity("should be on ActivityRepoDetail", ActivityRepoDetail.class);
final boolean lbFoundTheRepo = mSolo.waitForText("This repo is for demonstration purposes only.", 1, 5000L, true);
assertThat(lbFoundTheRepo).isTrue();
}
}
、次のビルドで、私はテストの失敗を取得します:ここで
# Build configuration file for Circle CI
# needs to be named `circle.yml` and should be in the top level dir of the repo
general:
artifacts:
- "~/build_output.zip" # Save APK's, Lint Results, and Test Results
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
java:
version: oraclejdk8
dependencies:
cache_directories:
- ~/.android
- ~/android
override:
- (echo "Downloading Android SDK v24...")
- (source environmentSetup.sh && getAndroidSDK)
test:
override:
# start the emulator
- emulator -avd circleci-android22 -no-audio -no-window:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
# unlock the emulator screen
- sleep 30
- adb shell input keyevent 82
# run tests against the emulator.
- ./gradlew connectedAndroidTest
# run jUnit tests
- ./gradlew test
# copy the build outputs to artifacts
- cp -r app/build/outputs $CIRCLE_ARTIFACTS
# copy the test results to the test results directory.
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
test methodあるhttps://circleci.com/gh/RoRoche/AndroidStarter/tree/master
同じコマンドをローカルで実行すると、次の結果が得られます。
junit.framework.AssertionFailedError:
[
GIVEN A single GitHub repo from the API
WHEN Click on its name and on the back button
THEN It should display the list
]
[
Message: Text string: 'git-consortium' is not found!
]
at junit.framework.Assert.fail(Assert.java:50)
at com.robotium.solo.Clicker.clickOnText(Clicker.java:451)
at com.robotium.solo.Solo.clickOnText(Solo.java:1502)
at fr.guddy.androidstarter.tests.ui.TestActivityRepoList.test_DetailRepos_ClickOnBack_DisplayListRepos(TestActivityRepoList.java:156)
私のcircleciビルドをどのようにして構成することができますか? ありがとうございます。
これらの手順に従うと、私のビルドは合格になります:https://circleci.com/docs/oom/ –
ありがとう、私は私の答えを更新しました。 – FelicianoTech