Package org.xwiki.test.ui.po.editor

Examples of org.xwiki.test.ui.po.editor.UserPicker.sendKeys()


        UserPicker userPicker = userField.getUserPicker();

        // Select 2 users.
        userPicker.sendKeys("tmortagne").waitForSuggestions().sendKeys(Keys.ENTER).waitForSuggestionsToFadeOut();
        Assert.assertFalse(userPicker.getClearSelectionLink().isDisplayed());
        userPicker.sendKeys("2002").waitForSuggestions().select("Enygma").waitForSuggestionsToFadeOut();
        Assert.assertTrue(userPicker.getClearSelectionLink().isDisplayed());
        List<UserElement> selectedUsers = userPicker.getAcceptedSuggestions();
        Assert.assertEquals(2, selectedUsers.size());
        assertUserElement(selectedUsers.get(0), "Thomas Mortagne");
        assertUserElement(selectedUsers.get(1), "Eduard Moraru", "Enygma2002");
View Full Code Here


        // Delete the first selected user.
        selectedUsers.get(0).delete();
        Assert.assertFalse(userPicker.getClearSelectionLink().isDisplayed());

        // Select another user.
        userPicker.sendKeys("admin").waitForSuggestions().sendKeys(Keys.ENTER).waitForSuggestionsToFadeOut();
        selectedUsers = userPicker.getAcceptedSuggestions();
        Assert.assertEquals(2, selectedUsers.size());
        assertUserElement(selectedUsers.get(0), "Eduard Moraru", "Enygma2002");
        assertUserElement(selectedUsers.get(1), "Administrator", "Admin", "noavatar.png");
        Assert.assertEquals("", userPicker.getValue());
View Full Code Here

    @Test
    public void testSaveAndInitialSelection()
    {
        UserPicker userPicker = new UserClassFieldEditPane(editor.addField("User").getName()).getUserPicker();
        userPicker.sendKeys("thomas").waitForSuggestions().sendKeys(Keys.ENTER);
        editor.clickSaveAndView().edit();

        UserClassFieldEditPane userField = new UserClassFieldEditPane("user1");
        userPicker = userField.getUserPicker().waitToLoad();
        List<UserElement> selectedUsers = userPicker.getAcceptedSuggestions();
View Full Code Here

        assertUserElement(selectedUsers.get(0), "Thomas Mortagne");
        assertUserElement(selectedUsers.get(1), "Administrator", "Admin", "noavatar.png");
        Assert.assertEquals("", userPicker.getValue());

        // We should be able to input free text also.
        userPicker.sendKeys("foobar").waitForSuggestions().sendKeys(Keys.ESCAPE).waitForSuggestionsToFadeOut();
        editor.clickSaveAndContinue();
        editor.clickCancel().edit();

        userPicker = new UserClassFieldEditPane("user1").getUserPicker().waitToLoad();
        selectedUsers = userPicker.getAcceptedSuggestions();
View Full Code Here

    @Test
    public void testApplicationEntry()
    {
        // Create the application class.
        UserPicker userPicker = new UserClassFieldEditPane(editor.addField("User").getName()).getUserPicker();
        userPicker.sendKeys("thomas").waitForSuggestions().sendKeys(Keys.ENTER);
        editor.clickSaveAndView();

        // Create the application entry.
        ClassSheetPage classSheetPage = new ClassSheetPage();
        EntryEditPage entryEditPage =
View Full Code Here

        Assert.assertEquals(1, selectedUsers.size());
        assertUserElement(selectedUsers.get(0), "Thomas Mortagne");
        Assert.assertEquals("", userPicker.getValue());

        // Change the selected user.
        userPicker.sendKeys("eduard").waitForSuggestions().sendKeys(Keys.ENTER).waitForSuggestionsToFadeOut();
        // We wait for the page to load because Selenium doesn't do it all the time when Save & View is clicked.
        entryEditPage.clickSaveAndView().waitUntilPageIsLoaded();

        // Assert the view mode.
        List<WebElement> users = getDriver().findElements(By.className("user"));
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.