mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Setup and tear down server between tests
This commit is contained in:
parent
7958467503
commit
111212b391
@ -37,6 +37,12 @@ public abstract class AbstractEndToEndTest<T extends Activity> extends ActivityI
|
|||||||
if (bypassWelcome) {
|
if (bypassWelcome) {
|
||||||
bypassWelcomeScreen();
|
bypassWelcomeScreen();
|
||||||
}
|
}
|
||||||
|
state.stubMailServer = new StubMailServer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tearDown() throws Exception {
|
||||||
|
state.stubMailServer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bypassWelcomeScreen() {
|
private void bypassWelcomeScreen() {
|
||||||
@ -51,10 +57,7 @@ public abstract class AbstractEndToEndTest<T extends Activity> extends ActivityI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected StubMailServer setupMailServer() {
|
public StubMailServer stubMailServer() {
|
||||||
if (null == state.stubMailServer) {
|
|
||||||
state.stubMailServer = new StubMailServer();
|
|
||||||
}
|
|
||||||
return state.stubMailServer;
|
return state.stubMailServer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,11 +45,9 @@ public class AccountSetupFlow {
|
|||||||
|
|
||||||
IncomingServerSettingsPage incoming = accountTypePage.clickImap();
|
IncomingServerSettingsPage incoming = accountTypePage.clickImap();
|
||||||
|
|
||||||
StubMailServer stubMailServer = test.setupMailServer();
|
OutgoingServerSettingsPage outgoing = setupIncomingServerAndClickNext(incoming, test.stubMailServer());
|
||||||
|
|
||||||
OutgoingServerSettingsPage outgoing = setupIncomingServerAndClickNext(incoming, stubMailServer);
|
AccountOptionsPage accountOptionsPage = setupOutgoingServerAndClickNext(outgoing, test.stubMailServer());
|
||||||
|
|
||||||
AccountOptionsPage accountOptionsPage = setupOutgoingServerAndClickNext(outgoing, stubMailServer);
|
|
||||||
|
|
||||||
AccountSetupNamesPage accountSetupNamesPage = accountOptionsPage.clickNext();
|
AccountSetupNamesPage accountSetupNamesPage = accountOptionsPage.clickNext();
|
||||||
|
|
||||||
@ -61,7 +59,7 @@ public class AccountSetupFlow {
|
|||||||
|
|
||||||
accountsPage.assertAccountExists(accountDescription);
|
accountsPage.assertAccountExists(accountDescription);
|
||||||
|
|
||||||
ApplicationState.getInstance().accounts.add(new AccountForTest(ACCOUNT_NAME, accountDescription, stubMailServer));
|
ApplicationState.getInstance().accounts.add(new AccountForTest(ACCOUNT_NAME, accountDescription, test.stubMailServer()));
|
||||||
|
|
||||||
return accountsPage;
|
return accountsPage;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user