2 * Copyright 2000-2014 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.server;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertTrue;
21 import org.junit.Test;
23 import com.vaadin.testbench.elements.ButtonElement;
24 import com.vaadin.testbench.elements.NotificationElement;
25 import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
27 public class GridStaticSectionComponentTest extends GridBasicFeaturesTest {
30 public void testNativeButtonInHeader() throws Exception {
33 selectMenuPath("Component", "Columns", "Column 1", "Header Type",
36 getGridElement().$(ButtonElement.class).first().click();
38 assertEquals("3. Button clicked!", getLogRow(0));
42 public void testNativeButtonInFooter() throws Exception {
45 selectMenuPath("Component", "Footer", "Visible");
46 selectMenuPath("Component", "Footer", "Append row");
47 selectMenuPath("Component", "Columns", "Column 1", "Footer Type",
50 getGridElement().$(ButtonElement.class).first().click();
52 assertEquals("5. Button clicked!", getLogRow(0));
56 public void testRemoveComponentFromHeader() throws Exception {
58 selectMenuPath("Component", "Columns", "Column 1", "Header Type",
60 selectMenuPath("Component", "Columns", "Column 1", "Header Type",
62 assertTrue("No notifications should've been shown",
63 !$(NotificationElement.class).exists());
64 assertEquals("Header should've been reverted back to text header",
65 "text header", getGridElement().getHeaderCell(0, 1).getText()