Examples of goToNextPage()


Examples of org.jsurveylib.Survey.goToNextPage()

        m.getQuestionByID("Z").setAnswer("yes");    //this will make a mandatory question on page 0 become visible
        assertTrue(m.getQuestionByID("X").isVisible());
        assertFalse(firstPage.areRequirementsMet());
        m.getQuestionByID("X").setAnswer("yes");
        assertTrue(firstPage.areRequirementsMet());
        m.goToNextPage();
        Page secondPage = m.getCurrentPage();
        assertFalse(secondPage.areRequirementsMet());   //page 0's "Y" must be set to "no" for question "B" to be valid
        assertFalse(m.getQuestionByID("B").isValid());

        m.getQuestionByID("Y").setAnswer("no");
View Full Code Here

Examples of org.jsurveylib.Survey.goToNextPage()

        assertEquals(3, survey.getPages().size());
        assertEquals(2, survey.getTotalPagesExcludingSkipped());

        assertEquals(0, survey.getCurrentPageNumber());
        assertEquals(0, survey.getCurrentPageNumberExcludingSkipped());
        survey.goToNextPage();
        assertEquals(2, survey.getCurrentPageNumber()); //we skipped a page
        assertEquals(1, survey.getCurrentPageNumberExcludingSkipped());
        assertTrue(survey.isLastPageAndComplete());
        survey.goToPreviousPage();
        assertEquals(0, survey.getCurrentPageNumber());
View Full Code Here

Examples of org.jsurveylib.Survey.goToNextPage()

        assertTrue(mandatory.isMandatory() && !mandatory.isAnswered());
        Question invalid = survey.getQuestionByID("invalid");
        assertFalse(invalid.isValid());
        assertTrue(survey.getPages().get(1).areRequirementsMet());

        survey.goToNextPage()//last page
        assertTrue(survey.isLastPageAndComplete());               
    }

    @Test(expected = IllegalArgumentException.class)
    public void visitSkippedPage() throws Exception {
View Full Code Here

Examples of org.jsurveylib.Survey.goToNextPage()

        assertEquals(0, survey.getCurrentPageNumber());
        assertEquals(0, survey.getCurrentPageNumberExcludingSkipped());
        assertEquals(2, survey.getTotalPagesExcludingSkipped());
        assertEquals(4, survey.getPages().size());

        survey.goToNextPage();
        assertEquals(1, survey.getCurrentPageNumber());
        assertEquals(1, survey.getCurrentPageNumberExcludingSkipped());
        assertEquals(2, survey.getTotalPagesExcludingSkipped());
        assertEquals(4, survey.getPages().size());
View Full Code Here

Examples of org.jsurveylib.Survey.goToNextPage()

        assertTrue(model.isNextPageAvailable());
        assertFalse(model.isPreviousPageAvailable());
        assertFalse(model.isLastPageAndComplete());

        model.goToNextPage();
        assertEquals(2, model.getCurrentPageNumber());

        assertFalse(model.isNextPageAvailable());
        assertTrue(model.isPreviousPageAvailable());
        assertTrue(model.isLastPageAndComplete());
View Full Code Here

Examples of org.jsurveylib.Survey.goToNextPage()

    public void pages() {
        Survey s = (Survey) new GettingStarted().getSurvey();
        PageTranslator pt = new PageTranslator(s);
        String[][] t = pt.translate();
        hasArray(t, new String[] {"P", "0", "Congratulations"});
        s.goToNextPage();

        pt = new PageTranslator(s);
        t = pt.translate();
        hasArray(t, new String[] {"P", "1", "Question Types"});
    }
View Full Code Here

Examples of org.jsurveylib.Survey.goToNextPage()

        Survey survey = getSurvey(surveyProvider);

        if (PREVIOUS_BUTTON.equals(buttonName) && survey.isPreviousPageAvailable()) {
            survey.goToPreviousPage();
        } else if (NEXT_BUTTON.equals(buttonName) && survey.isNextPageAvailable()) {
            survey.goToNextPage();
        } else if (FINISH_BUTTON.equals(buttonName) && survey.isLastPageAndComplete()) {
            survey.finish();
        } else {
            System.err.println("Unknown button name: " + buttonName);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.