k-9/k9mail/src/androidTest/java/com/fsck/k9/endtoend/A010_AccountIntegrationTest...

48 lines
1.4 KiB
Java
Raw Normal View History

2014-11-09 16:14:34 -05:00
package com.fsck.k9.endtoend;
import com.fsck.k9.activity.Accounts;
import com.fsck.k9.endtoend.framework.AccountForTest;
import com.fsck.k9.endtoend.framework.ApplicationState;
import com.fsck.k9.endtoend.pages.AccountsPage;
2015-01-13 21:09:48 -05:00
import org.junit.Test;
2014-11-09 16:14:34 -05:00
/**
* Creates and removes accounts.
*
* Because of the way K-9 shows the start page, there must already be two accounts
* in existence for this test to work.
*/
public class A010_AccountIntegrationTest extends AbstractEndToEndTest<Accounts>{
public A010_AccountIntegrationTest() {
super(Accounts.class);
}
2015-01-13 21:09:48 -05:00
@Test
public void createAccountDirectly() throws Exception {
new AccountSetupFlow().setupAccountFromAccountsPage(new AccountsPage());
2014-11-09 16:14:34 -05:00
}
2015-01-13 21:09:48 -05:00
@Test
public void deleteAccount() {
2014-11-09 16:14:34 -05:00
AccountsPage accountsPage = new AccountsPage();
2015-01-13 21:09:48 -05:00
// TODO should not have cross-test-dependencies
assertFalse("NB: this test is order dependent and requires A000_WelcomeAndSetupAccountIntegrationTest to run first",
ApplicationState.getInstance().accounts.isEmpty());
2014-11-09 16:14:34 -05:00
AccountForTest accountForTest = ApplicationState.getInstance().accounts.get(0);
accountsPage.assertAccountExists(accountForTest.description);
accountsPage.clickLongOnAccount(accountForTest);
accountsPage.clickRemoveInAccountMenu();
accountsPage.clickOK();
accountsPage.assertAccountDoesNotExist(accountForTest.description);
}
}