Examples of Mouse


Examples of org.openqa.selenium.interactions.Mouse

        WebElement wnd1Footer = wnd
                .findElement(By.className("v-window-footer"));
        Point startLoc = wnd.getLocation();
        Coordinates footerCoordinates = ((Locatable) wnd1Footer)
                .getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseDown(footerCoordinates);
        mouse.mouseMove(footerCoordinates, 200, 200);
        mouse.mouseUp(footerCoordinates);
        Point endLoc = wnd.getLocation();
        // don't compare to specific coordinate, because in IE9 and IE11
        // the window position is random.
        // So, checkt that the window was moved
        org.junit.Assert.assertNotEquals(startLoc, endLoc);
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

    public void tooltipsHaveQuickOpenDelay() throws InterruptedException {
        openTestURL();
        Coordinates button0Coordinates = getButtonCoordinates("Button 0");
        Coordinates button1Coordinates = getButtonCoordinates("Button 1");

        Mouse mouse = getMouse();
        mouse.mouseMove(button0Coordinates, 10, 10);
        sleep(1000);
        assertThat(getTooltipElement().getLocation().x, is(greaterThan(0)));

        mouse.mouseMove(button1Coordinates, 10, 10);
        assertThat(getTooltipElement().getLocation().x, is(lessThan(-1000)));

        sleep(1000);
        assertThat(getTooltipElement().getLocation().x,
                is(greaterThan(button1Coordinates.onPage().x)));
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

    @Test
    public void tooltipShouldBeStationary() throws InterruptedException {
        openTestURL();

        Mouse mouse = getMouse();

        moveMouseToButtonUpperLeftCorner(mouse);
        sleep(3000); // wait for the tooltip to become visible
        int originalTooltipLocationX = getTooltipLocationX();
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

    }

    private void showTooltip(int index) {
        Coordinates elementCoordinates = ((Locatable) getTab(index))
                .getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseMove(elementCoordinates);
    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

        assertEquals(tooltipText, "Horizontal layout tooltip");
    }

    private void showTooltip(WebElement element) {
        Coordinates elementCoordinates = ((Locatable) element).getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseMove(elementCoordinates);
    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

    };

    @Test
    public void testTooltipLocation() {
        openTestURL();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        WebElement menu = $(MenuBarElement.class).first().getWrappedElement();
        Coordinates menuLocation = ((Locatable) menu).getCoordinates();
        mouse.click(menuLocation);
        mouse.mouseMove(menuLocation, 5, -40);
        WebElement tooltip = getTooltipElement();
        assertThat(tooltip.getLocation().x, is(lessThan(menuLocation.onPage().x
                - tooltip.getSize().getWidth())));

    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

        openTestURL();

        Coordinates elementCoordinates = getCoordinates($(MenuBarElement.class)
                .first());

        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();

        mouse.click(elementCoordinates);
        mouse.mouseMove(elementCoordinates, 15, 40);

        sleep(1000);

        assertThat(getTooltipElement().getLocation().getX(),
                is(lessThan(-1000)));
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

    public static class ActionsProvider extends IndirectProvider<Actions, HasInputDevices> {
        @Override
        public Actions generateProxy(HasInputDevices base) {
            Keyboard keyboard = base.getKeyboard();
            Mouse mouse = base.getMouse();
            return new Actions(keyboard, mouse);
        }
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

            @Override
            public void releaseKey(CharSequence keyToRelease) {
                throw new UnsupportedOperationException("Not supported yet.");
            }
        });
        when(((HasInputDevices) driver).getMouse()).thenReturn(new Mouse() {

            @Override
            public void click(Coordinates where) {
                throw new UnsupportedOperationException("Not supported yet.");
            }
View Full Code Here

Examples of org.openqa.selenium.interactions.Mouse

    @Test
    public void testActionsProviderLookup() {
        // having
        ActionsProvider provider = new ActionsProvider();
        Mouse mouse = mock(Mouse.class);
        Keyboard keyboard = mock(Keyboard.class);
        when(((HasInputDevices) driver).getMouse()).thenReturn(mouse);
        when(((HasInputDevices) driver).getKeyboard()).thenReturn(keyboard);
        // when
        Actions actions = (Actions) provider.lookup(null, null);
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.