Examples of SuggestionFieldInspector


Examples of org.seleniuminspector.openfaces.SuggestionFieldInspector

     @Test
    public void testWithSuggestionField() {
        testAppFunctionalPage("/components/loadbundle/withSuggestionField.jsf");

        String suggestionFieldId = "formID:plants";
        SuggestionFieldInspector suggestionField = suggestionField(suggestionFieldId);
        ElementInspector secondSuggestion = suggestionField.popup().items().get(2);

        // check 'ar' locale
        suggestionField.keyDown(KeyEvent.VK_DOWN);
        secondSuggestion.assertText(WEEK_AR);

        TabSetInspector localeChanger = tabSet("formID:localeChanger");

        // check 'es' locale
        localeChanger.tabs().get(1).clickAndWait();
        testAppFunctionalPage("/components/loadbundle/withSuggestionField.jsf"); // issue a GET request for view to update locale in JSP
        suggestionField.keyDown(KeyEvent.VK_DOWN);
        secondSuggestion.assertText(WEEK_ES);

        // check 'ja' locale
        localeChanger.tabs().get(2).clickAndWait();
        testAppFunctionalPage("/components/loadbundle/withSuggestionField.jsf"); // issue a GET request for view to update locale in JSP
        suggestionField.keyDown(KeyEvent.VK_DOWN);
        secondSuggestion.assertText(WEEK_JA);

        // check 'ru' locale
        localeChanger.tabs().get(3).clickAndWait();
        testAppFunctionalPage("/components/loadbundle/withSuggestionField.jsf"); // issue a GET request for view to update locale in JSP
        suggestionField.keyDown(KeyEvent.VK_DOWN);
        secondSuggestion.assertText(WEEK_RU);

        // reset tab index for further running tests
        localeChanger.tabs().get(0).clickAndWait();
    }
View Full Code Here

Examples of org.seleniuminspector.openfaces.SuggestionFieldInspector

    public void testAjax() {
        Selenium selenium = getSelenium();
        testAppFunctionalPage("/components/foreach/forEach.jsf");

        ForEachInspector forEach = forEach("formID:fe10");
        SuggestionFieldInspector suggestionField = suggestionField(forEach.item(0, "sf1").asSeleniumLocator());

        ElementInspector dropDownItem0 = suggestionField.popup().items().get(0);
        ElementInspector dropDownItem1 = suggestionField.popup().items().get(1);
        ElementInspector dropDownItem2 = suggestionField.popup().items().get(2);

        dropDownItem0.assertElementExists(false);
        dropDownItem1.assertElementExists(false);
        dropDownItem2.assertElementExists(false);
        suggestionField.keyPress('a');
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        dropDownItem0.assertVisible(true);
        dropDownItem1.assertVisible(true);
        dropDownItem2.assertVisible(true);
        dropDownItem0.click();
        sleep(200);
        selenium.submit("formID");
        waitForPageToLoad();
        dropDownItem0.assertElementExists(false);
        dropDownItem1.assertElementExists(false);
        dropDownItem2.assertElementExists(false);

        suggestionField = suggestionField(forEach.item(1, "sf1").asSeleniumLocator());
        dropDownItem0 = suggestionField.popup().items().get(0);
        dropDownItem1 = suggestionField.popup().items().get(1);
        dropDownItem2 = suggestionField.popup().items().get(2);

        dropDownItem0.assertElementExists(false);
        dropDownItem1.assertElementExists(false);
        dropDownItem2.assertElementExists(false);
        sleep(3000);
        suggestionField.keyPress('a');
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        dropDownItem0.assertVisible(true);
        dropDownItem1.assertVisible(true);
        dropDownItem2.assertVisible(true);
        dropDownItem2.click();
        sleep(200);
        selenium.submit("formID");
        waitForPageToLoad();
        dropDownItem0.assertElementExists(false);
        dropDownItem1.assertElementExists(false);
        dropDownItem2.assertElementExists(false);

        suggestionField = suggestionField(forEach.item(2, "sf1").asSeleniumLocator());
        dropDownItem0 = suggestionField.popup().items().get(0);
        dropDownItem1 = suggestionField.popup().items().get(1);
        dropDownItem2 = suggestionField.popup().items().get(2);

        dropDownItem0.assertElementExists(false);
        dropDownItem1.assertElementExists(false);
        dropDownItem2.assertElementExists(false);
        suggestionField.keyPress('a');
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        dropDownItem0.assertVisible(true);
        dropDownItem1.assertVisible(true);
        dropDownItem2.assertVisible(true);
        dropDownItem1.click();
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.