2 * Copyright 2000-2016 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.tests.components.grid.basicfeatures;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertTrue;
21 import java.util.List;
23 import org.junit.Test;
24 import org.openqa.selenium.By;
25 import org.openqa.selenium.remote.DesiredCapabilities;
27 public class GridDescriptionGeneratorTest extends GridBasicFeaturesTest {
30 public void testCellDescription() {
32 selectMenuPath("Component", "State", "Cell description generator");
34 getGridElement().getCell(1, 0).showTooltip();
35 String tooltipText = findElement(By.className("v-tooltip-text"))
37 assertEquals("Tooltip text", "Cell tooltip for row 1, column 0",
40 getGridElement().getCell(1, 1).showTooltip();
41 assertTrue("Tooltip should not be present in cell (1, 1) ",
42 findElement(By.className("v-tooltip-text")).getText()
47 public void testRowDescription() {
49 selectMenuPath("Component", "State", "Row description generator");
51 getGridElement().getCell(5, 3).showTooltip();
52 String tooltipText = findElement(By.className("v-tooltip-text"))
54 assertEquals("Tooltip text", "Row tooltip for row 5", tooltipText);
56 getGridElement().getCell(15, 3).showTooltip();
57 tooltipText = findElement(By.className("v-tooltip-text")).getText();
58 assertEquals("Tooltip text", "Row tooltip for row 15", tooltipText);
62 public void testRowAndCellDescription() {
64 selectMenuPath("Component", "State", "Row description generator");
65 selectMenuPath("Component", "State", "Cell description generator");
67 getGridElement().getCell(5, 0).showTooltip();
68 String tooltipText = findElement(By.className("v-tooltip-text"))
70 assertEquals("Tooltip text", "Cell tooltip for row 5, column 0",
73 getGridElement().getCell(5, 3).showTooltip();
74 tooltipText = findElement(By.className("v-tooltip-text")).getText();
75 assertEquals("Tooltip text", "Row tooltip for row 5", tooltipText);
79 public List<DesiredCapabilities> getBrowsersToTest() {
80 return getBrowsersExcludingFirefox();