Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Action


        selectItem(picker.pick(advanced().getItemsElements()));
        return getPuttingSelectedItem();
    }

    protected void selectItem(final WebElement item) {
        new Actions(driver).keyDown(Keys.CONTROL).click(item).keyUp(Keys.CONTROL).addAction(new Action() {
            @Override
            public void perform() {
                Graphene.waitGui().until().element(item).attribute("class").contains(advanced().getStyleForSelectedItem());
            }
        }).perform();
View Full Code Here


        if (!advanced().getSelectedItemsElements().isEmpty()) {
            new Actions(driver)
                .click(advanced().getItemsElements().get(0))
                .keyDown(Keys.CONTROL).click(advanced().getItemsElements().get(0))
                .keyUp(Keys.CONTROL)
                .addAction(new Action() {
                    @Override
                    public void perform() {
                        Graphene.waitGui().until().element(advanced().getItemsElements().get(0)).attribute("class").not().contains("rf-ord-sel");
                    }
                }).perform();
View Full Code Here

    @Override
    public void select(boolean deselectOthers) {
        if (deselectOthers) {
            new Actions(driver)
                .click(getRootElement())
                .addAction(new Action() {
                    @Override
                    public void perform() {
                        Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem());
                    }
                })
                .perform();
        } else {
            if (!isSelected()) {
                new Actions(driver)
                    .keyDown(Keys.CONTROL)
                    .click(getRootElement())
                    .keyUp(Keys.CONTROL)
                    .addAction(new Action() {
                        @Override
                        public void perform() {
                            Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem());
                        }
                    })
View Full Code Here

        if (isSelected()) {
            new Actions(driver)
                .keyDown(Keys.CONTROL)
                .click(getRootElement())
                .keyUp(Keys.CONTROL)
                .addAction(new Action() {
                    @Override
                    public void perform() {
                        Graphene.waitGui().until().element(getRootElement()).attribute("class").not().contains(getStyleClassForSelectedItem());
                    }
                })
View Full Code Here

    protected void filterTextInput(WebElement input, String value, boolean valid) {
        input.click();
        input.clear();
        input.sendKeys(value);
        Action blur = valid ? Graphene.guardAjax(fireEventAction(input, "blur")) : fireEventAction(input, "blur");
        blur.perform();
    }
View Full Code Here

        browser.get(contextPath.toExternalForm() + "dnd.jsf");
       
        WebElement framework = browser.findElements(By.cssSelector(".ui-draggable")).get(0);

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDrop(framework, phpTarget).build();
        guardAjax(dragAndDrop).perform();

        Assert.assertEquals(1, phpTarget.findElements(By.cssSelector("td")).size());
    }
View Full Code Here

        // given
        browser.get(contextPath.toExternalForm() + "width.jsf");
        WebElement column1ResizeHandle = header.findElement(By.cssSelector(".rf-edt-hdr .rf-edt-td-column1 .rf-edt-rsz"));

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDropBy(column1ResizeHandle, 60, 0).build();

        // when / then
        Warp.initiate(new Activity() {
            @Override
            public void perform() {
View Full Code Here

        WebElement column1 = header.findElement(By.cssSelector(".rf-edt-hdr-c.rf-edt-c-column1"));
        WebElement column3 = header.findElement(By.cssSelector(".rf-edt-c-column3 .rf-edt-hdr-c-cnt"));

        Actions builder = new Actions(browser);

        final Action dragAndDrop = builder.clickAndHold(column3)
            .moveToElement(column1)
            .release(column1)
            .build();

        // when / then
View Full Code Here

    public void column_resize_smaller() {
        browser.get(contextPath.toExternalForm());
        WebElement column1ResizeHandle = header.findElement(By.cssSelector(".rf-edt-hdr .rf-edt-td-column1 .rf-edt-rsz"));

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDropBy(column1ResizeHandle, -20, 0).build();
        dragAndDrop.perform();

        Assert.assertEquals("181px", firstRow.findElement(By.cssSelector("td")).getCssValue("width"));
        Assert.assertEquals("180px", firstRow.findElement(By.cssSelector("td .rf-edt-c-column1")).getCssValue("width"));
    }
View Full Code Here

    public void column_resize_bigger() {
        browser.get(contextPath.toExternalForm());
        WebElement column1ResizeHandle = header.findElement(By.cssSelector(".rf-edt-hdr .rf-edt-td-column1 .rf-edt-rsz"));

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDropBy(column1ResizeHandle, 20, 0).build();
        dragAndDrop.perform();

        Assert.assertEquals("221px", firstRow.findElement(By.cssSelector("td")).getCssValue("width"));
        Assert.assertEquals("220px", firstRow.findElement(By.cssSelector("td .rf-edt-c-column1")).getCssValue("width"));
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.interactions.Action

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.