Search in sources :

Example 16 with TeamCityApplication

use of com.github.vase4kin.teamcityapp.TeamCityApplication in project TeamCityApp by vase4kin.

the class ArtifactListFragmentTest method setUp.

@Before
public void setUp() {
    TeamCityApplication app = (TeamCityApplication) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();
    app.getRestApiInjector().sharedUserStorage().clearAll();
    app.getRestApiInjector().sharedUserStorage().saveGuestUserAccountAndSetItAsActive(Mocks.URL);
    ConditionWatcher.setTimeoutLimit(TIMEOUT);
}
Also used : TeamCityApplication(com.github.vase4kin.teamcityapp.TeamCityApplication) Before(org.junit.Before)

Example 17 with TeamCityApplication

use of com.github.vase4kin.teamcityapp.TeamCityApplication in project TeamCityApp by vase4kin.

the class SplashActivityTest method setUp.

@Before
public void setUp() {
    TeamCityApplication app = (TeamCityApplication) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();
    app.getAppInjector().sharedUserStorage().clearAll();
}
Also used : TeamCityApplication(com.github.vase4kin.teamcityapp.TeamCityApplication) Before(org.junit.Before)

Example 18 with TeamCityApplication

use of com.github.vase4kin.teamcityapp.TeamCityApplication in project TeamCityApp by vase4kin.

the class SplashActivityTest method testUserNavigatesToRootProjectsActivity.

/**
 * Workaround test to test that root projects activity is opened
 */
@Test
public void testUserNavigatesToRootProjectsActivity() throws Exception {
    // Prepate data
    TeamCityApplication app = (TeamCityApplication) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();
    app.getAppInjector().sharedUserStorage().saveGuestUserAccountAndSetItAsActive(Mocks.URL);
    // Launch activity
    mActivityRule.launchActivity(null);
    // Check that root projects activity is opened
    matchToolbarTitle("Projects");
}
Also used : TeamCityApplication(com.github.vase4kin.teamcityapp.TeamCityApplication) Test(org.junit.Test)

Aggregations

TeamCityApplication (com.github.vase4kin.teamcityapp.TeamCityApplication)18 Before (org.junit.Before)10 Test (org.junit.Test)7 RootProjectsActivity (com.github.vase4kin.teamcityapp.root.view.RootProjectsActivity)6 SharedUserStorage (com.github.vase4kin.teamcityapp.storage.SharedUserStorage)5 Request (okhttp3.Request)5 Mockito.doAnswer (org.mockito.Mockito.doAnswer)5 InvocationOnMock (org.mockito.invocation.InvocationOnMock)5 Answer (org.mockito.stubbing.Answer)5 Response (okhttp3.Response)3 Ignore (org.junit.Ignore)3 Builds (com.github.vase4kin.teamcityapp.buildlist.api.Builds)1 FilterBuildsModule (com.github.vase4kin.teamcityapp.filter_builds.dagger.FilterBuildsModule)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1