Package org.seleniuminspector.openfaces

Examples of org.seleniuminspector.openfaces.DateChooserInspector


    public void testChangeLocaleFromBinding() {
        Selenium selenium = getSelenium();
        liveDemoPage("/datechooser/DateChooser.jsf");
        assertPageContainsErrorIcon(false);

        DateChooserInspector defaultDateChooser = dateChooser("dcForm:dcDefault");
        defaultDateChooser.field().clear();
        defaultDateChooser.field().type("Oct 17, 2006sdfsdf");
        DateChooserInspector mMddDateChooser = dateChooser("dcForm:dcMMdd");
        mMddDateChooser.field().clear();
        mMddDateChooser.field().type("10/17/2006");
        assertPageContainsErrorIcon(true);
        defaultDateChooser.field().clear();
        defaultDateChooser.field().type("Oct 10, 2006");
        mMddDateChooser.field().clear();
        mMddDateChooser.field().type("10/17/2006");
        assertPageContainsErrorIcon(false);
        tabSet("dcForm:localeSelector").setTabIndex(1, OpenFacesAjaxLoadingMode.getInstance());
        assertEquals("Date Chooser \u2014 OpenFaces Demo", selenium.getTitle());
        assertPageContainsErrorIcon(false);
        defaultDateChooser.field().clear();
        defaultDateChooser.field().type("Oct 17, 2006sdfsdf");
        mMddDateChooser.field().clear();
        mMddDateChooser.field().type("10/17/2006");
        assertPageContainsErrorIcon(true);
        defaultDateChooser.field().clear();
        defaultDateChooser.field().type("17 oct. 2006");
        assertPageContainsErrorIcon(false);
    }
View Full Code Here


    public void testDateChooserInside() {
        testAppFunctionalPage("/components/foldingpanel/dateChooserIn.jsf");

        foldingPanel("fn:dateChooserFoldingPanel").toggle().clickAndWait(OpenFacesAjaxLoadingMode.getInstance());

        DateChooserInspector dateChooser = dateChooser("fn:dateChooserID");
        dateChooser.field().assertElementExists();
        dateChooser.field().assertValue("Jul 30, 2006");
        dateChooser.button().assertElementExists();
    }
View Full Code Here

    public void testDropDownInside() {
        testAppFunctionalPage("/components/foldingpanel/dropDownIn.jsf");

        foldingPanel("fn:dropDownFoldingPanel").toggle().clickAndWait(OpenFacesAjaxLoadingMode.getInstance());

        DateChooserInspector dateChooser = dateChooser("fn:dropDownID");
        dateChooser.assertElementExists();
        dateChooser.button().click();
        dateChooser.popup().items().get(1).click();
        dateChooser.field().assertValue("Yellow");
    }
View Full Code Here

        waitForPageToLoad();
        assertEquals(2, localeSelector.getTabIndex());
        localeSelector.tabs().get(0).click();
        waitForPageToLoad();
        assertEquals(0, localeSelector.getTabIndex());
        DateChooserInspector dateChooser = dateChooser("dcForm:dcMMdd");
        dateChooser.field().type("wrong");
        localeSelector.tabs().get(1).click();
        assertEquals(0, localeSelector.getTabIndex());
        dateChooser.field().assertValue("wrong");
    }
View Full Code Here

    public void testDateChooserEvents() {
        Selenium selenium = getSelenium();
        testAppFunctionalPage("/components/datechooser/dateChooser.jsf");

        //onkeypress
        DateChooserInspector keyPressDateChooser = dateChooser("formID:keypressID");
        keyPressDateChooser.field().keyPress(KeyEvent.VK_Z);
        assertTrue(selenium.isTextPresent("onkeypress works"));
        assertTrue(selenium.isTextPresent("keypress"));

        //ondblclick
        element("formID:doubleclickID").doubleClick();
        assertTrue(selenium.isTextPresent("ondblclick works"));
        assertTrue(selenium.isTextPresent("dblclick"));

        //onmousedown
        element("formID:mousedownID").mouseDown();
        assertTrue(selenium.isTextPresent("onmousedown works"));
        assertTrue(selenium.isTextPresent("mousedown"));

        //onmouseover
        element("formID:mouseoverID").mouseOver();
        assertTrue(selenium.isTextPresent("onmouseover works"));
        assertTrue(selenium.isTextPresent("mouseover"));

        //onmousemove
        element("formID:mousemoveID").mouseMove();
        assertTrue(selenium.isTextPresent("onmousemove works"));
        assertTrue(selenium.isTextPresent("mousemove"));

        //onmouseout
        element("formID:mouseoutID").mouseOut();
        assertTrue(selenium.isTextPresent("onmouseout works"));
        assertTrue(selenium.isTextPresent("mouseout"));

        //onmouseup
        element("formID:mouseupID").mouseUp();
        assertTrue(selenium.isTextPresent("onmouseup works"));
        assertTrue(selenium.isTextPresent("mouseup"));

        //todo: uncomment if JSFC-1431 is fixed
/*    //onfocus
    assertTrue(selenium.isTextPresent("onfocus works"));
    assertTrue(selenium.isTextPresent("focus"));

    //onblur
    assertTrue(selenium.isTextPresent("onblur works"));
    assertTrue(selenium.isTextPresent("blur"));*/

        //onkeydown
        DateChooserInspector keyDownDateChooser = dateChooser("formID:keydownID");
        keyDownDateChooser.field().keyDown(KeyEvent.VK_Z);
        assertTrue(selenium.isTextPresent("onkeydown works"));
        assertTrue(selenium.isTextPresent("keydown"));

        //onkeyup
        DateChooserInspector keyUpDateChooser = dateChooser("formID:keyupID");
        keyUpDateChooser.field().keyUp(KeyEvent.VK_Z);
        assertTrue(selenium.isTextPresent("onkeyup works"));
        assertTrue(selenium.isTextPresent("keyup"));

        //onchange
        DateChooserInspector changeInputText = dateChooser("formID:changeID");
        changeInputText.field().type("Aug 01, 2007");
        assertTrue(selenium.isTextPresent("onchange works"));
        assertTrue(selenium.isTextPresent("change"));
    }
View Full Code Here

        final String selectedValue = "05.12.2007";
        final String changedCalendarDate = "05 December, 2007";
        final String typedDate = "07.12.2007";
        final String expectedTypedDate = "07 December, 2007";

        DateChooserInspector dateChooser = dateChooser("formID:changeSelectedDate");
        ElementInspector selectedDateOutput = element("formID:selectedDate");
        ElementInspector selectedDateGetter = element("selectedDate");
        ElementInspector selectedDateInfo = element("selectedDateInfo");
        ElementInspector submitter = element("formID:submit");

        checkBeforeChangingSelectedDate(dateChooser, initialValue, selectedDateOutput, selectedDateGetter, initialDate,
                selectedDateInfo);

        checkChangingSelectedDate(dateChooser.calendar(), initialValue, selectedValue, new int[]{1, 2}, selectedDateOutput, submitter);

        checkAfterChangingSelectedDate(dateChooser, selectedValue, selectedDateOutput, selectedDateGetter,
                changedCalendarDate, selectedDateInfo, typedDate, submitter, expectedTypedDate);
    }
View Full Code Here

        closeBrowser();
        testAppFunctionalPage("/components/datechooser/dateChooserChangeDateMonthYear.jsf");

        final String selectedDate = "06.03.2007";

        DateChooserInspector dateChooser = dateChooser("formID:changeYearMonth");
        ElementInspector submitter = element("formID:submit");
        ElementInspector selectedMonthOutput = element("formID:selectedMonth");

        dateChooser.button().click();

        prepareCheckingMonthChange(dateChooser.calendar(), "December", "January", "December", 2, new int[]{1, 2});
        dateChooser.field().assertValue(selectedDate);

        dateChooser.button().click();
        checkMonthChange(dateChooser.calendar(), "March", selectedMonthOutput, submitter, selectedDate);
        dateChooser.field().assertValue(selectedMonthOutput.text());
    }
View Full Code Here

    public void testYearChange() {
        testAppFunctionalPage("/components/datechooser/dateChooserChangeDateMonthYear.jsf");

        final String selectedDate = "06.12.2005";

        DateChooserInspector dateChooser = dateChooser("formID:changeYearMonth");
        ElementInspector submitter = element("formID:submit");
        ElementInspector selectedYearOutput = element("formID:selectedMonth");

        dateChooser.button().mouseDown();

        prepareCheckingYearChange(dateChooser.calendar(), "2007", "2008", "2007", 2, new int[]{1, 2});
        dateChooser.field().assertValue(selectedDate);

        checkYearChange(dateChooser.calendar(), "2005", selectedYearOutput, submitter, selectedDate);
        dateChooser.field().assertValue(selectedYearOutput.text());
    }
View Full Code Here

    public void testTodayNoneButtons() {
        testAppFunctionalPage("/components/datechooser/dateChooserTodayNoneButton.jsf");

        final String dateFormat = "dd MMMM, yyyy";

        DateChooserInspector todayDateChooser = dateChooser("formID:today");
        DateChooserInspector noneDateChooser = dateChooser("formID:none");
        ElementInspector todayDateOutput = element("formID:todayDateString");
        ElementInspector selectedDateButton = element("selectedDate");
        ElementInspector selectedDateOutput = element("selectedDateInfo");
        ElementInspector todayStyleButton = element("todayStyleButton");
        ElementInspector noneStyleButton = element("noneStyleButton");
        ElementInspector todayInfoOutput = element("todayInfo");
        ElementInspector noneInfoOutput = element("noneInfo");
        ElementInspector submitter = element("formID:submit");
        ElementInspector noneSelectedDateButton = element("noneSelectedDate");
        ElementInspector noneSelectedDateOutput = element("noneSelectedDateInfo");
        ElementInspector noneDateOutput = element("formID:noneDateString");
        ElementInspector todayStyleButton1 = element("todayStyleButton1");
        ElementInspector noneStyleButton1 = element("noneStyleButton1");
        ElementInspector todayInfoOutput1 = element("todayInfo1");
        ElementInspector noneInfoOutput1 = element("noneInfo1");

        String todayDate = checkAndGetCurrentDateSelected(dateFormat, todayDateOutput, selectedDateButton, selectedDateOutput);

        todayDateChooser.field().assertValue(selectedDateOutput.text());
        todayDateChooser.field().assertValue(todayDateOutput.text());
        checkButtonPairState(todayStyleButton, todayInfoOutput, noneStyleButton, noneInfoOutput);

        todayDateChooser.button().mouseDown();
        //click 'None' button and check this button state
        checkButtonStateAndSelectedDateOnEmptiness(todayDateChooser.calendar(), todayDateOutput, selectedDateButton,
                selectedDateOutput, todayStyleButton, noneStyleButton, todayInfoOutput,
                noneInfoOutput, submitter, noneSelectedDateButton, noneSelectedDateOutput,
                noneDateOutput);

//    assertEquals("", selenium.getValue(noneFieldId));
        noneDateChooser.field().assertValue("");
        checkButtonPairState(noneStyleButton1, noneInfoOutput1, todayStyleButton1, todayInfoOutput1);

        noneDateChooser.button().mouseDown();
        checkTodayNoneButtons(noneDateChooser.calendar(), submitter, noneSelectedDateButton, noneSelectedDateOutput,
                noneDateOutput, todayDate);

        noneSelectedDateButton.click();
        noneDateChooser.field().assertValue(noneSelectedDateOutput.text());
        noneDateChooser.field().assertValue(noneDateOutput.text());

        checkButtonPairState(todayStyleButton1, todayInfoOutput1, noneStyleButton1, noneInfoOutput1);
    }
View Full Code Here

        ElementInspector asAttributeOutput = element("formID:asAttributeOutput");
        asAttributeOutput.assertText("false");
        ElementInspector asTagOutput = element("formID:asTagOutput");
        asTagOutput.assertText("false");

        DateChooserInspector attributeDateChooser = dateChooser("formID:asAttributeDC");
        attributeDateChooser.button().mouseDown();
        attributeDateChooser.calendar().selectCalendarCell(3, 3);

        DateChooserInspector asTagDateChooser = dateChooser("formID:asTagDC");
        asTagDateChooser.button().mouseDown();
        asTagDateChooser.calendar().selectCalendarCell(3, 3);

        element("formID:submit").clickAndWait();
        asAttributeOutput.assertText("true");
        asTagOutput.assertText("true");
    }
View Full Code Here

TOP

Related Classes of org.seleniuminspector.openfaces.DateChooserInspector

Copyright © 2018 www.massapicom. 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.