Search in sources :

Example 1 with QuestionGroupHelper

use of org.mifos.test.acceptance.loan.QuestionGroupHelper in project head by mifos.

the class QuestionGroupLoanAccountTest method verifyKeyFinderInQuestionary.

@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyKeyFinderInQuestionary() {
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    QuestionGroupHelper questionGroupHelper = new QuestionGroupHelper(navigationHelper);
    Random random = new Random();
    boolean keyUnpressed = true;
    boolean keyPressed = false;
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "DT_6245";
    String choiceAnswer1 = "choiceTest13242";
    String choiceAnswer2 = "choiceTest34003";
    List<String> tag1 = new ArrayList<String>();
    List<String> tag2 = new ArrayList<String>();
    tag1.add("tag");
    tag2.add("tag1");
    questionGroupHelper.createQuestionGroupSmart(questionGroupTitle, "Create Loan", question1, choiceAnswer1, choiceAnswer2, tag1, tag2);
    loanProductTestHelper.editLoanProductIncludeQuestionsGroups("ClientEmergencyLoan", questionGroupTitle);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("ClientWithLoan 20110221");
    searchParameters.setLoanProduct("ClientEmergencyLoan");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    CreateLoanAccountEntryPage createLoanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    createLoanAccountEntryPage.submitAndNavigateToQuestionResponsePage();
    searchParameters.setSearchString("ClientWithLoan 20110221");
    Assert.assertEquals((boolean) createLoanAccountEntryPage.isAnswerExist(keyUnpressed), true);
    Assert.assertEquals((boolean) createLoanAccountEntryPage.isAnswerExist(keyPressed), false);
    createLoanAccountEntryPage.setInputFilterChoices("2");
    Assert.assertEquals((boolean) createLoanAccountEntryPage.isAnswerExist(keyPressed), true);
    navigationHelper.navigateToAdminPage().navigateToViewAllQuestions().navigateToQuestionDetail(question1).navigateToEditQuestionPage().deactivate();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) Random(java.util.Random) ArrayList(java.util.ArrayList) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) QuestionGroupHelper(org.mifos.test.acceptance.loan.QuestionGroupHelper) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) Test(org.testng.annotations.Test)

Example 2 with QuestionGroupHelper

use of org.mifos.test.acceptance.loan.QuestionGroupHelper in project head by mifos.

the class DefineNewLoanProductTest method setUp.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod
@Override
public void setUp() throws Exception {
    super.setUp();
    questionGroupHelper = new QuestionGroupHelper(new NavigationHelper(selenium));
    random = new Random();
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) Random(java.util.Random) QuestionGroupHelper(org.mifos.test.acceptance.loan.QuestionGroupHelper) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Random (java.util.Random)2 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)2 QuestionGroupHelper (org.mifos.test.acceptance.loan.QuestionGroupHelper)2 ArrayList (java.util.ArrayList)1 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)1 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)1 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)1 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Test (org.testng.annotations.Test)1