summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/CollapsibleTableColumn.java80
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/DisabledLabel.java54
-rw-r--r--uitest/src/test/java/com/vaadin/tests/themes/valo/CollapsibleTableColumnTest.java55
-rw-r--r--uitest/src/test/java/com/vaadin/tests/themes/valo/DisabledLabelTest.java46
4 files changed, 235 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CollapsibleTableColumn.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CollapsibleTableColumn.java
new file mode 100644
index 0000000000..f18b1e578e
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CollapsibleTableColumn.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.themes.valo;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Table;
+
+/**
+ * Test UI for non-collapsible column distinction in the table.
+ *
+ * @author Vaadin Ltd
+ */
+@Theme("valo")
+public class CollapsibleTableColumn extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Table table = new Table();
+ BeanItemContainer<Bean> container = new BeanItemContainer<Bean>(
+ Bean.class);
+ Bean bean = new Bean();
+ bean.setName("name");
+ bean.setId(1);
+ container.addBean(bean);
+ table.setContainerDataSource(container);
+ table.setColumnCollapsingAllowed(true);
+ table.setColumnCollapsible("name", false);
+ addComponent(table);
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 15489;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Non-collapsible column should be visibly distinct (has an opacity) from "
+ + "collapsible column in table column config menu.";
+ }
+
+ public static class Bean {
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ private String name;
+
+ private int id;
+ }
+}
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/DisabledLabel.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/DisabledLabel.java
new file mode 100644
index 0000000000..ce199992f2
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/DisabledLabel.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.themes.valo;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Label;
+
+/**
+ * Test UI for disbaled label.
+ *
+ * @author Vaadin Ltd
+ */
+@Theme("valo")
+public class DisabledLabel extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Label enabled = new Label("enabled");
+ enabled.addStyleName("my-enabled");
+ addComponent(enabled);
+
+ Label disabled = new Label("disabled");
+ disabled.setEnabled(false);
+ disabled.addStyleName("my-disabled");
+
+ addComponent(disabled);
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 15489;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Disabled label should be visibly disabled (has an opacity).";
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/CollapsibleTableColumnTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/CollapsibleTableColumnTest.java
new file mode 100644
index 0000000000..6e01e01996
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/CollapsibleTableColumnTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.themes.valo;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.TableElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Test for non-collapsible column opacity for item in column configuration
+ * menu.
+ *
+ * @author Vaadin Ltd
+ */
+public class CollapsibleTableColumnTest extends MultiBrowserTest {
+
+ @Test
+ public void nonCollapsibleColumnOpacity() {
+ openTestURL();
+
+ // click on the header to make the column selector visible
+ $(TableElement.class).first().getHeaderCell(0).click();
+ waitForElementVisible(By.className("v-table-column-selector"));
+
+ findElement(By.className("v-table-column-selector")).click();
+
+ List<WebElement> items = findElements(By.className("v-on"));
+ String collapsibleColumnOpacity = items.get(0).getCssValue("opacity");
+ String nonCollapsibleColumnOpacity = items.get(1)
+ .getCssValue("opacity");
+
+ Assert.assertNotEquals("Opacity value is the same for collapsible "
+ + "and non-collapsible column item", collapsibleColumnOpacity,
+ nonCollapsibleColumnOpacity);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/DisabledLabelTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/DisabledLabelTest.java
new file mode 100644
index 0000000000..dfbaaa5849
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/DisabledLabelTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.themes.valo;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Test for disabled label opacity.
+ *
+ * @author Vaadin Ltd
+ */
+public class DisabledLabelTest extends MultiBrowserTest {
+
+ @Test
+ public void disabledLabelOpacity() {
+ openTestURL();
+
+ WebElement enabled = findElement(By.className("my-enabled"));
+ String enabledOpacity = enabled.getCssValue("opacity");
+
+ WebElement disabled = findElement(By.className("my-disabled"));
+ String disabledOpacity = disabled.getCssValue("opacity");
+
+ Assert.assertNotEquals(
+ "Opacity value is the same for enabled and disabled label",
+ enabledOpacity, disabledOpacity);
+ }
+}