aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java
blob: d2209c4a020719d55641a040055f6e9c0880f667 (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
package com.vaadin.tests.components.tabsheet;

import java.io.IOException;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import com.vaadin.tests.tb3.MultiBrowserTest;

public class TabSheetFocusingTest extends MultiBrowserTest {

    @Test
    public void addAndFocusTabs() throws IOException {
        openTestURL();
        WebElement addButton = getButton("Add tab");
        for (int i = 1; i <= 15; i++) {
            addButton.click();
            getButton("Tab " + i);
        }
        compareScreen("tabsAdded");
    }

    private WebElement getButton(String caption) {
        return driver.findElement(By.xpath(
                "//span[@class='v-button-caption'][text()='" + caption + "']"));
    }
}