Search in sources :

Example 11 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupHelper method createQuestionGroupSmart.

@SuppressWarnings("unchecked")
public void createQuestionGroupSmart(String questionGroupTitle, String appliesTo, String question1, String choice1, String choice2, List<String> tag1, List<String> tag2) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionPage createQuestionPage = adminPage.navigateToCreateQuestionPage();
    createQuestionPage.addQuestion(getCreateQuestionParams(question1, "Smart Select", asList(choice1, choice2), asList(tag1, tag2)));
    adminPage = createQuestionPage.submitQuestions();
    CreateQuestionGroupPage createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    CreateQuestionGroupParameters parameters = getCreateQuestionGroupParameters(questionGroupTitle, question1, appliesTo);
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.markEveryOtherQuestionsMandatory(asList(question1));
    createQuestionGroupPage.submit(parameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) CreateQuestionPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Example 12 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupHelper method createQuestionGroup.

public void createQuestionGroup(String questionGroupTitle, String question1, String question2, String appliesTo) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionPage createQuestionPage = adminPage.navigateToCreateQuestionPage();
    createQuestionPage.addQuestion(getCreateQuestionParams(question1, CreateClientLoanAccountTest.DATE, null));
    createQuestionPage.addQuestion(getCreateQuestionParams(question2, CreateClientLoanAccountTest.SINGLE_SELECT, asList("Choice1", "Choice2")));
    adminPage = createQuestionPage.submitQuestions();
    CreateQuestionGroupPage createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    CreateQuestionGroupParameters parameters = getCreateQuestionGroupParameters(questionGroupTitle, question1, question2, appliesTo);
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.markEveryOtherQuestionsMandatory(asList(question1));
    createQuestionGroupPage.submit(parameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) CreateQuestionPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Example 13 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class MpesaImportTest method importTransaction.

private ImportTransactionsPage importTransaction(String importFile) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage.verifyPage();
    importTransactionsPage.reviewTransactions(importFile, EXCEL_IMPORT_TYPE);
    return importTransactionsPage;
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)

Example 14 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class MpesaImportTest method importTransactionsFromFileWithNoErrors.

/**
     * MPESA - Import transactions from file with no errors
     * http://mifosforge.jira.com/browse/MIFOSTEST-688
     * @throws Exception
     */
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
@Test(enabled = true)
public void importTransactionsFromFileWithNoErrors() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewRolesPage viewRolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("8_3");
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    adminPage = viewRolesPage.navigateToAdminPage();
    adminPage = adminPage.failNavigationToImportTransactionsPage();
    adminPage.verifyError("You do not have permissions to perform " + "this activity. Contact your system administrator " + "to grant you the required permissions and try again.");
    viewRolesPage = adminPage.navigateToViewRolesPage();
    manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("8_3");
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
    ImportTransactionsPage importTransactionsPage = importTransaction(path);
    checkIfOutputMatchesExpected(path);
    importTransactionsPage.cancelImportTransaction();
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountPage.verifyExactLoanAmount("2,000");
    SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("0");
    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);
    importTransactionsConfirmationPage.verifyImportSuccess("You have successfully imported transactions.");
    loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    loanAccountPage.verifyPerformanceHistory("11", "11");
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistoryPage();
    transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
    transactionHistoryPage.verifyPostedBy("mifos", 48);
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 15 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class MpesaImportTest method importMpesaTransactions.

@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
@Test(enabled = true)
public void importMpesaTransactions() throws Exception {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewOrganizationSettingsPage viewOrganizationSettingsPage = adminPage.navigateToViewOrganizationSettingsPage();
    viewOrganizationSettingsPage.verifyMiscellaneous(new String[] { "Max MPESA Disbursal Limit: 50000.0" });
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    for (String importFile : TEST_FILES) {
        String path = this.getClass().getResource("/mpesa/" + importFile).toString();
        importTransaction(path);
        checkIfOutputMatchesExpected(path);
    }
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewOrganizationSettingsPage(org.mifos.test.acceptance.framework.admin.ViewOrganizationSettingsPage) Test(org.testng.annotations.Test)

Aggregations

AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)87 Test (org.testng.annotations.Test)33 HomePage (org.mifos.test.acceptance.framework.HomePage)9 CreateQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)8 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)7 CreateUserParameters (org.mifos.test.acceptance.framework.user.CreateUserParameters)7 DateTime (org.joda.time.DateTime)6 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)6 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)6 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)6 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)6 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)5 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)5 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)5 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)5 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 EditLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage)4 EditLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage)4 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)4 ViewLoanProductsPage (org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage)4