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

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

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

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class TabSheetScrolledRemoveAllButLastTest
        extends MultiBrowserTest {

    @Test
    public void closeTabs() {
        openTestURL("debug");
        WebElement firstTab = findElement(
                By.className("v-tabsheet-tabitemcell-first"));
        assertNotEquals(
                "Tab bar should be scrolled, unexpected first visible tab",
                "Tab #1", firstTab.getText());

        $(ButtonElement.class).first().click();
        assertEquals("Unexpected error notification(s),", 0,
                findElements(By.className("v-Notification-error")).size());
    }
}