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.client;
18 import static org.junit.Assert.assertFalse;
19 import static org.junit.Assert.assertNull;
21 import org.junit.Before;
22 import org.junit.Test;
23 import org.openqa.selenium.Keys;
24 import org.openqa.selenium.interactions.Actions;
26 import com.vaadin.testbench.elements.GridElement.GridCellElement;
27 import com.vaadin.testbench.elements.GridElement.GridRowElement;
28 import com.vaadin.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest;
30 public class DisabledGridClientTest extends GridBasicClientFeaturesTest {
35 selectMenuPath("Component", "State", "Enabled");
39 public void testSelection() {
40 selectMenuPath("Component", "State", "Selection mode", "single");
42 GridRowElement row = getGridElement().getRow(0);
43 GridCellElement cell = getGridElement().getCell(0, 0);
45 assertFalse("disabled row should not be selected", row.isSelected());
49 public void testEditorOpening() {
50 selectMenuPath("Component", "Editor", "Enabled");
51 GridRowElement row = getGridElement().getRow(0);
52 GridCellElement cell = getGridElement().getCell(0, 0);
54 assertNull("Editor should not open", getEditor());
56 new Actions(getDriver()).sendKeys(Keys.ENTER).perform();
57 assertNull("Editor should not open", getEditor());