Search in sources :

Example 6 with MifosPage

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();
}
Also used : MifosPage(org.mifos.test.acceptance.framework.MifosPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) AfterMethod(org.testng.annotations.AfterMethod)

Example 7 with MifosPage

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;
}
Also used : NewPenaltyPreviewPage(org.mifos.test.acceptance.framework.admin.NewPenaltyPreviewPage) EditPenaltyPreviewPage(org.mifos.test.acceptance.framework.admin.EditPenaltyPreviewPage) MifosPage(org.mifos.test.acceptance.framework.MifosPage)

Example 8 with MifosPage

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()));
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateUserEnterDataPage(org.mifos.test.acceptance.framework.user.CreateUserEnterDataPage) CreateUserConfirmationPage(org.mifos.test.acceptance.framework.user.CreateUserConfirmationPage) ChooseOfficePage(org.mifos.test.acceptance.framework.office.ChooseOfficePage) UserViewDetailsPage(org.mifos.test.acceptance.framework.user.UserViewDetailsPage) EditUserDataPage(org.mifos.test.acceptance.framework.user.EditUserDataPage) MifosPage(org.mifos.test.acceptance.framework.MifosPage) LoginPage(org.mifos.test.acceptance.framework.login.LoginPage) CreateUserPreviewDataPage(org.mifos.test.acceptance.framework.user.CreateUserPreviewDataPage) EditUserPreviewDataPage(org.mifos.test.acceptance.framework.user.EditUserPreviewDataPage) HomePage(org.mifos.test.acceptance.framework.HomePage) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) ChangePasswordPage(org.mifos.test.acceptance.framework.login.ChangePasswordPage)

Example 9 with MifosPage

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;
}
Also used : HomePage(org.mifos.test.acceptance.framework.HomePage) MifosPage(org.mifos.test.acceptance.framework.MifosPage) AppLauncher(org.mifos.test.acceptance.framework.AppLauncher) LoginPage(org.mifos.test.acceptance.framework.login.LoginPage)

Example 10 with MifosPage

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();
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) MifosPage(org.mifos.test.acceptance.framework.MifosPage) Test(org.testng.annotations.Test)

Aggregations

MifosPage (org.mifos.test.acceptance.framework.MifosPage)21 AfterMethod (org.testng.annotations.AfterMethod)10 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)8 HomePage (org.mifos.test.acceptance.framework.HomePage)4 LoginPage (org.mifos.test.acceptance.framework.login.LoginPage)4 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)3 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)2 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)2 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)2 Test (org.testng.annotations.Test)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 DateTimeService (org.mifos.framework.util.DateTimeService)1 EditPenaltyPreviewPage (org.mifos.test.acceptance.framework.admin.EditPenaltyPreviewPage)1 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)1 NewPenaltyPreviewPage (org.mifos.test.acceptance.framework.admin.NewPenaltyPreviewPage)1 ClientSearchResultsPage (org.mifos.test.acceptance.framework.client.ClientSearchResultsPage)1 ChangePasswordPage (org.mifos.test.acceptance.framework.login.ChangePasswordPage)1