aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/window/ToolTipInWindowTest.java
blob: ac091b6941fe2591b1f5a14655ea8133efce7b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.vaadin.tests.components.window;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.util.List;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.vaadin.tests.tb3.MultiBrowserTest;

public class ToolTipInWindowTest extends MultiBrowserTest {

    @Test
    public void testToolTipInHeader() throws Exception {

        openTestURL();

        WebElement header = driver
                .findElement(By.className("v-window-outerheader"));
        new Actions(driver)
                .moveToElement(driver.findElement(By.className("v-ui")), 0, 0)
                .perform();
        sleep(500);
        new Actions(driver).moveToElement(header).perform();
        sleep(1100);

        WebElement ttip = findElement(By.className("v-tooltip"));
        assertNotNull(ttip);
        assertEquals("Tooltip", ttip.getText());

    }

    @Test
    public void testToolTipInContent() throws Exception {

        openTestURL();

        WebElement header = driver
                .findElement(By.className("v-window-contents"));
        new Actions(driver)
                .moveToElement(driver.findElement(By.className("v-ui")), 0, 300)
                .perform();
        sleep(500);
        new Actions(driver).moveToElement(header).perform();
        sleep(1000);

        WebElement ttip = findElement(By.className("v-tooltip"));
        assertNotNull(ttip);
        assertEquals("Tooltip", ttip.getText());

    }

    @Override
    public List<DesiredCapabilities> getBrowsersToTest() {
        // Test with the same browsers as in the other tooltip tests
        return getBrowsersSupportingTooltip();
    }

}