use of org.mifos.test.acceptance.framework.MifosPage in project head by mifos.
the class SystemInfoDateTimeTest method tearDown.
@AfterMethod
public void tearDown() {
(new MifosPage(selenium)).logout();
new DateTimeUpdaterRemoteTestingService(selenium).resetDateTime();
}
use of org.mifos.test.acceptance.framework.MifosPage in project head by mifos.
the class MainPenaltyTest method fillFormAndGotoPreviewPage.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
private MifosPage fillFormAndGotoPreviewPage(final PenaltyFormPage penaltyFormPage, final PenaltyFormParameters parameters, final int i, final boolean isCreatePage) throws Exception {
parameters.setFrequency(PenaltyFormParameters.FREQUENCY_DAILY);
parameters.setGlCode("31102 - Penalty");
parameters.setDuration("1");
parameters.setMax("15");
parameters.setMin("1");
if (i == 0) {
parameters.setName(AMOUNT_PENALTY_NAME);
parameters.setApplies(PenaltyFormParameters.APPLIES_SAVINGS);
parameters.setPeriod(PenaltyFormParameters.PERIOD_DAYS);
parameters.setAmount("2200.5");
parameters.setRate("");
} else if (i == 1) {
parameters.setName(RATE_PENALTY_NAME);
parameters.setApplies(PenaltyFormParameters.APPLIES_LOANS);
parameters.setPeriod(PenaltyFormParameters.PERIOD_INSTALLMENTS);
parameters.setRate("7.5");
parameters.setFormula(PenaltyFormParameters.FORMULA_OUTSTANDING_LOAN);
parameters.setAmount("");
}
MifosPage previewPage = null;
if (isCreatePage) {
previewPage = penaltyFormPage.fillParameters(parameters).submitPageAndGotoPenaltyPreviewPage(NewPenaltyPreviewPage.class);
((NewPenaltyPreviewPage) previewPage).verifyData(parameters);
} else {
parameters.setStatus(PenaltyFormParameters.STATUS_INACTIVE);
previewPage = penaltyFormPage.fillParameters(parameters).submitPageAndGotoPenaltyPreviewPage(EditPenaltyPreviewPage.class);
((EditPenaltyPreviewPage) previewPage).verifyData(parameters);
}
return previewPage;
}
use of org.mifos.test.acceptance.framework.MifosPage in project head by mifos.
the class PersonnelTest method changePasswordTest.
//http://mifosforge.jira.com/browse/MIFOSTEST-296
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void changePasswordTest() throws Exception {
HomePage homePage = loginSuccessfully();
AdminPage adminPage = homePage.navigateToAdminPage();
CreateUserParameters userParameters = adminPage.getAdminUserParameters();
ChooseOfficePage createUserPage = adminPage.navigateToCreateUserPage();
createUserPage.verifyPage();
CreateUserEnterDataPage userEnterDataPage = createUserPage.selectOffice("MyOfficeDHMFT");
CreateUserPreviewDataPage userPreviewDataPage = userEnterDataPage.submitAndGotoCreateUserPreviewDataPage(userParameters);
CreateUserConfirmationPage userConfirmationPage = userPreviewDataPage.submit();
//Then
userConfirmationPage.verifyPage();
UserViewDetailsPage userDetailsPage = userConfirmationPage.navigateToUserViewDetailsPage();
userDetailsPage.verifyPage();
Assert.assertTrue(userDetailsPage.getFullName().contains(userParameters.getFirstName() + " " + userParameters.getLastName()));
//When
EditUserDataPage editUserPage = userDetailsPage.navigateToEditUserDataPage();
CreateUserParameters passwordParameters = new CreateUserParameters();
passwordParameters.setPassword("tester1");
passwordParameters.setPasswordRepeat("tester");
//Then
editUserPage = editUserPage.submitWithInvalidData(passwordParameters);
editUserPage.verifyPasswordChangeError();
//When
passwordParameters.setPasswordRepeat("tester1");
//Then
EditUserPreviewDataPage editPreviewDataPage = editUserPage.submitAndGotoEditUserPreviewDataPage(passwordParameters);
UserViewDetailsPage submitUserpage = editPreviewDataPage.submit();
submitUserpage.verifyPage();
//When
LoginPage loginPage = (new MifosPage(selenium)).logout();
// tester1
ChangePasswordPage changePasswordPage = loginPage.loginAndGoToChangePasswordPageAs(userParameters.getUserName(), passwordParameters.getPassword());
ChangePasswordPage.SubmitFormParameters changePasswordParameters = new ChangePasswordPage.SubmitFormParameters();
// wrong old password
changePasswordParameters.setOldPassword("tester");
// empty new password
changePasswordParameters.setNewPassword("");
changePasswordParameters.setConfirmPassword("");
//Then
changePasswordPage = changePasswordPage.submitWithInvalidData(changePasswordParameters);
//When
//wrong old password with good new
changePasswordParameters.setNewPassword("tester2");
changePasswordParameters.setConfirmPassword("tester2");
//Then
changePasswordPage = changePasswordPage.submitWithInvalidData(changePasswordParameters);
//When
// good old password and good new
changePasswordParameters.setOldPassword("tester1");
changePasswordParameters.setNewPassword("tester2");
changePasswordParameters.setConfirmPassword("tester2");
//Then
HomePage homePage2 = changePasswordPage.submitAndGotoHomePage(changePasswordParameters);
Assert.assertTrue(homePage2.getWelcome().contains(userParameters.getFirstName()));
loginPage = (new MifosPage(selenium)).logout();
homePage = loginPage.loginSuccessfulAs(userParameters.getUserName(), "tester2");
changePasswordPage = homePage.navigateToYourSettingsPage().navigateToChangePasswordPage();
changePasswordPage = changePasswordPage.submitWithInvalidData(changePasswordParameters);
//When
//wrong old password with good new
changePasswordParameters.setNewPassword("tester2");
changePasswordParameters.setConfirmPassword("tester2");
//Then
changePasswordPage = changePasswordPage.submitWithInvalidData(changePasswordParameters);
//When
// good old password and good new
changePasswordParameters.setOldPassword("tester2");
changePasswordParameters.setNewPassword("tester3");
changePasswordParameters.setConfirmPassword("tester3");
changePasswordPage.submitAndGotoHomePage(changePasswordParameters);
loginPage = (new MifosPage(selenium)).logout();
homePage = loginPage.loginSuccessfulAs(userParameters.getUserName(), changePasswordParameters.getNewPassword());
Assert.assertTrue(homePage.getWelcome().contains(userParameters.getFirstName()));
}
use of org.mifos.test.acceptance.framework.MifosPage in project head by mifos.
the class PersonnelTest method loginSuccessfully.
private HomePage loginSuccessfully() {
(new MifosPage(selenium)).logout();
LoginPage loginPage = new AppLauncher(selenium).launchMifos();
loginPage.verifyPage();
HomePage homePage = loginPage.loginSuccessfullyUsingDefaultCredentials();
homePage.verifyPage();
return homePage;
}
use of org.mifos.test.acceptance.framework.MifosPage in project head by mifos.
the class ImportTransactionsTest method importExcelFormatAudiBankTransactions.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void importExcelFormatAudiBankTransactions() throws Exception {
pluginsUtil.loadPlugin();
navigationHelper = new NavigationHelper(selenium);
String importFile = this.getClass().getResource("/AudiUSD-SevenTransactions.xls").toString();
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "mpesa_export_dbunit.xml", dataSource, selenium);
importTransaction(importFile, EXCEL_IMPORT_TYPE);
// TODO - add proper UI verifications and enable this test after MIFOS-4651 is fixed
(new MifosPage(selenium)).logout();
pluginsUtil.unloadPlugin();
}
Aggregations