Search in sources :

Example 81 with AdminPage

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

the class QuestionGroupTest method createAndEditQuestionsTest.

/**
     * Creating and editing Questions
     * http://mifosforge.jira.com/browse/MIFOSTEST-700
     *
     * @throws Exception
     */
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createAndEditQuestionsTest() throws Exception {
    //When
    testValidationAddQuestion();
    CreateQuestionPage createQuestionPage = questionGroupTestHelper.navigateToCreateQuestionPage();
    CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
    createQuestionParameters.setText("TextQuestionTest");
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    createQuestionPage.addQuestion(createQuestionParameters);
    createQuestionParameters.setText("DateQuestionTest");
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_DATE);
    createQuestionPage.addQuestion(createQuestionParameters);
    createQuestionParameters.setText("NumberQuestionTest");
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_NUMBER);
    createQuestionParameters.setNumericMin(1);
    createQuestionParameters.setNumericMax(10);
    createQuestionPage.addQuestion(createQuestionParameters);
    createQuestionParameters.setText("MultiSelectQuestionTest");
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_MULTI_SELECT);
    List<Choice> choices = new ArrayList<Choice>();
    Choice c = new Choice("choice 1", EMPTY_LIST);
    choices.add(c);
    c = new Choice("choice 2", EMPTY_LIST);
    choices.add(c);
    c = new Choice("choice 3", EMPTY_LIST);
    choices.add(c);
    createQuestionParameters.setChoices(choices);
    createQuestionPage.addQuestion(createQuestionParameters);
    createQuestionParameters.setText("SingleSelectQuestionTest");
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    createQuestionParameters.setChoices(choices);
    createQuestionPage.addQuestion(createQuestionParameters);
    createQuestionParameters.setText("SmartSelectQuestionTest");
    createQuestionParameters.setChoices(choices);
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_SMART_SELECT);
    createQuestionPage.addQuestion(createQuestionParameters);
    AdminPage adminPage = createQuestionPage.submitQuestions();
    ViewAllQuestionsPage viewAllQuestionsPage = adminPage.navigateToViewAllQuestions();
    //Then
    viewAllQuestionsPage.verifyQuestions(QUESTIONS.keySet());
    //When
    c = new Choice("answerChoice1", EMPTY_LIST);
    choices.add(c);
    c = new Choice("answerChoice3", EMPTY_LIST);
    choices.add(c);
    for (String question : QUESTIONS.keySet()) {
        QuestionDetailPage questionDetailPage = viewAllQuestionsPage.navigateToQuestionDetail(question);
        EditQuestionPage editQuestionPage = questionDetailPage.navigateToEditQuestionPage();
        createQuestionParameters.setText("");
        editQuestionPage.tryUpdate(createQuestionParameters);
        //Then
        editQuestionPage.verifyTextPresent("Please specify the question", "No text <Please specify the question> present on the page");
        questionDetailPage = editQuestionPage.cancelEdit();
        //When
        editQuestionPage = questionDetailPage.navigateToEditQuestionPage();
        for (String characters : charactersList) {
            editQuestionPage.setQuestionName(characters);
            editQuestionPage.verifyQuestionName(characters);
        }
        if ("NumberQuestionTest".equals(question)) {
            editQuestionPage.setNumberQuestion(noNumber, noNumber);
            editQuestionPage.verifyNumberQuestion("", "");
            editQuestionPage.setNumberQuestion("", "");
        } else if ("MultiSelectQuestionTest".equals(question) || "SingleSelectQuestionTest".equals(question)) {
            editQuestionPage.addAnswerChoices(asList("answerChoice1", "answerChoice2", "answerChoice3"));
            editQuestionPage.removeAnswerChoice("4");
        } else if ("SmartSelectQuestionTest".equals(question)) {
            editQuestionPage.addSmartAnswerChoices(asList("answerChoice1", "answerChoice2", "answerChoice3"));
            editQuestionPage.removeAnswerChoice("4");
        }
        editQuestionPage.setQuestionName(question + "Edit");
        questionDetailPage = editQuestionPage.deactivate();
        //Then
        questionDetailPage.verifyQuestionTitle(question + "Edit");
        if ("MultiSelectQuestionTest".equals(question) || "SingleSelectQuestionTest".equals(question) || "SmartSelectQuestionTest".equals(question)) {
            questionDetailPage.assertForChoices(QUESTIONS.get(question), choices);
        }
        viewAllQuestionsPage = questionDetailPage.navigateToViewAllQuestionsPage();
    }
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) Choice(org.mifos.test.acceptance.framework.questionnaire.Choice) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ArrayList(java.util.ArrayList) QuestionDetailPage(org.mifos.test.acceptance.framework.questionnaire.QuestionDetailPage) CreateQuestionPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage) EditQuestionPage(org.mifos.test.acceptance.framework.questionnaire.EditQuestionPage) ViewAllQuestionsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionsPage) Test(org.testng.annotations.Test)

Example 82 with AdminPage

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

the class CreateSavingsAccountTest method verifyPaymentTypesForWithdrawalsAndDeposits.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(singleThreaded = true, groups = { "savings", "acceptance", "ui", "no_db_unit" })
public void verifyPaymentTypesForWithdrawalsAndDeposits() throws Exception {
    //When
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.VOUCHER);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.createSavingsAccountWithQG(searchParameters, submitAccountParameters);
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("test");
    savingsAccountDetailPage = savingsAccountHelper.changeStatus(savingsAccountDetailPage.getAccountId(), editAccountStatusParameters);
    SavingsDepositWithdrawalPage savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
    //When
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
    //When
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000002");
    savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DefineAcceptedPaymentTypesPage(org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) SavingsDepositWithdrawalPage(org.mifos.test.acceptance.framework.savings.SavingsDepositWithdrawalPage) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 83 with AdminPage

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

the class QuestionGroupTest method checkQuestionGroupPermission.

@Test(enabled = true)
public void checkQuestionGroupPermission() {
    AdminPage adminPage = getAdminPage();
    CreateQuestionGroupPage createQuestionGroupPage = getCreateQuestionGroupPage(adminPage);
    CreateQuestionGroupParameters parameters = new CreateQuestionGroupParameters();
    parameters.setTitle(qgTitle4);
    parameters.setAppliesTo(APPLIES_TO_CREATE_CLIENT);
    parameters.setAnswerEditable(true);
    for (String question : asList(qTitle1, qTitle2)) {
        parameters.addExistingQuestion(SECTION_DEFAULT, question);
    }
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.submit(parameters);
    ViewRolesPage rolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = rolesPage.navigateToManageRolePage(ADMIN_ROLE);
    manageRolePage.verifyPermissionText(QUESTION_PERMISSION_ID, QUESTION_PERMISSION_HEADER + qgTitle4);
    manageRolePage.disablePermission(QUESTION_PERMISSION_ID);
    manageRolePage.submitAndGotoViewRolesPage();
    adminPage = getAdminPage();
    Assert.assertTrue(adminPage.navigateToViewAllQuestionGroups().navigateToQuestionGroupDetailPage(qgTitle4).isAccessDeniedDisplayed());
    //set question group on inactive
    adminPage.navigateBack();
    adminPage.navigateToAdminPageUsingHeaderTab();
    manageRolePage = adminPage.navigateToViewRolesPage().navigateToManageRolePage(ADMIN_ROLE);
    manageRolePage.verifyPermissionText(QUESTION_PERMISSION_ID, QUESTION_PERMISSION_HEADER + qgTitle4);
    manageRolePage.enablePermission(QUESTION_PERMISSION_ID);
    manageRolePage.submitAndGotoViewRolesPage().navigateToAdminPage().navigateToViewAllQuestionGroups().navigateToQuestionGroupDetailPage(qgTitle4);
    questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle4);
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage) Test(org.testng.annotations.Test)

Example 84 with AdminPage

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

the class ViewReportCategoriesTest method loginAndGoToAdminPage.

private AdminPage loginAndGoToAdminPage() {
    HomePage homePage = appLauncher.launchMifos().loginSuccessfullyUsingDefaultCredentials();
    homePage.verifyPage();
    AdminPage adminPage = homePage.navigateToAdminPage();
    adminPage.verifyPage();
    return adminPage;
}
Also used : HomePage(org.mifos.test.acceptance.framework.HomePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage)

Example 85 with AdminPage

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

the class ViewReportCategoriesTest method verifyReportCategoriesExist.

/**
     * Verify that expected Report Categories exist on the page
     */
public void verifyReportCategoriesExist() {
    AdminPage adminPage = loginAndGoToAdminPage();
    ViewReportCategoriesPage page = adminPage.navigateToViewReportCategories();
    page.verifyPage();
    String[] expectedData = new String[] { "Client Detail", "Performance", "Center", "Loan Product Detail", "Status", "Analysis", "Miscellaneous" };
    page.verifyReportCategoriesExist(expectedData);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewReportCategoriesPage(org.mifos.test.acceptance.framework.admin.ViewReportCategoriesPage)

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