summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2016-08-29 13:21:49 +0300
committerAleksi Hietanen <aleksi@vaadin.com>2016-08-29 13:21:49 +0300
commitcbad1f0a214ac85de502fcb979dd14b7a2ad9703 (patch)
tree58ebe345b166a7c095b29f12e5084c268ec4c9f2 /uitest
parent91a7d965db6f4071e30c1892726099a0983de973 (diff)
downloadvaadin-framework-cbad1f0a214ac85de502fcb979dd14b7a2ad9703.tar.gz
vaadin-framework-cbad1f0a214ac85de502fcb979dd14b7a2ad9703.zip
Fix Label widths in ValoThemeUITests
New Label implementation no longer sets the width to 100% in the constructor, breaking some screenshot tests. Change-Id: Ib627ce3d08449df98a0b54d96fa88a0b06fc2384
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/Accordions.java24
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java1
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java13
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/SplitPanels.java12
4 files changed, 37 insertions, 13 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Accordions.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Accordions.java
index 3c7ad2ad33..7a54385fd4 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Accordions.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Accordions.java
@@ -51,29 +51,37 @@ public class Accordions extends VerticalLayout implements View {
ac.addTab(new VerticalLayout() {
{
setMargin(true);
- addComponent(new Label(
- "Fabio vel iudice vincam, sunt in culpa qui officia. Ut enim ad minim veniam, quis nostrud exercitation."));
+ Label label = new Label(
+ "Fabio vel iudice vincam, sunt in culpa qui officia. Ut enim ad minim veniam, quis nostrud exercitation.");
+ label.setWidth("100%");
+ addComponent(label);
}
}, "First Caption", testIcon.get());
ac.addTab(new VerticalLayout() {
{
setMargin(true);
- addComponent(new Label(
- "Gallia est omnis divisa in partes tres, quarum."));
+ Label label = new Label(
+ "Gallia est omnis divisa in partes tres, quarum.");
+ label.setWidth("100%");
+ addComponent(label);
}
}, "Second Caption", testIcon.get());
ac.addTab(new VerticalLayout() {
{
setMargin(true);
- addComponent(new Label(
- "Nihil hic munitissimus habendi senatus locus, nihil horum? Sed haec quis possit intrepidus aestimare tellus."));
+ Label label = new Label(
+ "Nihil hic munitissimus habendi senatus locus, nihil horum? Sed haec quis possit intrepidus aestimare tellus.");
+ label.setWidth("100%");
+ addComponent(label);
}
}, "Third Caption", testIcon.get());
ac.addTab(new VerticalLayout() {
{
setMargin(true);
- addComponent(new Label(
- "Inmensae subtilitatis, obscuris et malesuada fames. Quisque ut dolor gravida, placerat libero vel, euismod."));
+ Label label = new Label(
+ "Inmensae subtilitatis, obscuris et malesuada fames. Quisque ut dolor gravida, placerat libero vel, euismod.");
+ label.setWidth("100%");
+ addComponent(label);
}
}, "Custom Caption Style", testIcon.get()).setStyleName("color1");
return ac;
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java
index 97f9d29226..99c83a7132 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java
@@ -126,6 +126,7 @@ public class CommonParts extends VerticalLayout implements View {
Label spinnerDesc = new Label(
"The theme also provides a mixin that you can use to include a spinner anywhere in your application. Below is a Label with a custom style name, for which the spinner mixin is added.");
+ spinnerDesc.setWidth("100%");
spinnerDesc.addStyleName(ValoTheme.LABEL_SMALL);
spinnerDesc.setCaption("Spinner");
content.addComponent(spinnerDesc);
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
index 245dcd8b03..40b6ab86e7 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
@@ -18,12 +18,12 @@ package com.vaadin.tests.themes.valo;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;
-import com.vaadin.shared.ui.label.ContentMode;
/**
*
@@ -47,11 +47,13 @@ public class Labels extends VerticalLayout implements View {
split.addComponent(left);
Label huge = new Label("Huge type for display text.");
+ huge.setWidth("100%");
huge.addStyleName(ValoTheme.LABEL_HUGE);
left.addComponent(huge);
Label large = new Label(
"Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
+ large.setWidth("100%");
large.addStyleName(ValoTheme.LABEL_LARGE);
left.addComponent(large);
@@ -62,6 +64,7 @@ public class Labels extends VerticalLayout implements View {
Label normal = new Label(
"Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
ContentMode.HTML);
+ normal.setWidth("100%");
left.addComponent(normal);
Label h3 = new Label("Small Title");
@@ -70,10 +73,12 @@ public class Labels extends VerticalLayout implements View {
Label small = new Label(
"Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
+ small.setWidth("100%");
small.addStyleName(ValoTheme.LABEL_SMALL);
left.addComponent(small);
Label tiny = new Label("Tiny type for minor text.");
+ tiny.setWidth("100%");
tiny.addStyleName(ValoTheme.LABEL_TINY);
left.addComponent(tiny);
@@ -83,6 +88,7 @@ public class Labels extends VerticalLayout implements View {
normal = new Label(
"Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
+ normal.setWidth("100%");
left.addComponent(normal);
Panel p = new Panel("Additional Label Styles");
@@ -95,24 +101,29 @@ public class Labels extends VerticalLayout implements View {
Label label = new Label(
"Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
+ label.setWidth("100%");
label.addStyleName(ValoTheme.LABEL_BOLD);
right.addComponent(label);
label = new Label(
"Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
+ label.setWidth("100%");
label.addStyleName(ValoTheme.LABEL_LIGHT);
right.addComponent(label);
label = new Label(
"Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
+ label.setWidth("100%");
label.addStyleName(ValoTheme.LABEL_COLORED);
right.addComponent(label);
label = new Label("A label for success");
+ label.setWidth("100%");
label.addStyleName(ValoTheme.LABEL_SUCCESS);
right.addComponent(label);
label = new Label("A label for failure");
+ label.setWidth("100%");
label.addStyleName(ValoTheme.LABEL_FAILURE);
right.addComponent(label);
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/SplitPanels.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/SplitPanels.java
index 6f4e4ded3d..e113cf677e 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/SplitPanels.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/SplitPanels.java
@@ -33,8 +33,10 @@ public class SplitPanels extends VerticalLayout implements View {
h1.addStyleName(ValoTheme.LABEL_H1);
addComponent(h1);
- addComponent(new Label(
- "Outlines are just to show the areas of the SplitPanels. They are not part of the actual component style."));
+ Label label = new Label(
+ "Outlines are just to show the areas of the SplitPanels. They are not part of the actual component style.");
+ label.setWidth("100%");
+ addComponent(label);
HorizontalLayout row = new HorizontalLayout();
row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
@@ -81,8 +83,10 @@ public class SplitPanels extends VerticalLayout implements View {
return new VerticalLayout() {
{
setMargin(true);
- addComponent(new Label(
- "Fictum, deserunt mollit anim laborum astutumque!"));
+ Label label = new Label(
+ "Fictum, deserunt mollit anim laborum astutumque!");
+ label.setWidth("100%");
+ addComponent(label);
}
};
}