summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-08-17 10:50:59 +0300
committerArtur Signell <artur@vaadin.com>2014-08-17 10:50:59 +0300
commit835f2633f9a661e4e463e5466b12b90f76cae1fc (patch)
treed5e82fdd0ba6140366f24671e3c6740a13f2af90
parentba8d4ded29322d54d4b68b6f86cd8e7f90ad64a8 (diff)
parent4556b4e80b4334d581d010089293219b4f42d438 (diff)
downloadvaadin-framework-835f2633f9a661e4e463e5466b12b90f76cae1fc.tar.gz
vaadin-framework-835f2633f9a661e4e463e5466b12b90f76cae1fc.zip
Merge remote-tracking branch 'origin/master' into 7.3
-rw-r--r--WebContent/VAADIN/themes/tests-valo/_valotest.scss4
-rw-r--r--WebContent/VAADIN/themes/valo/components/_button.scss16
-rw-r--r--WebContent/VAADIN/themes/valo/components/_combobox.scss10
-rw-r--r--WebContent/VAADIN/themes/valo/components/_datefield.scss10
-rw-r--r--WebContent/VAADIN/themes/valo/components/_formlayout.scss1
-rw-r--r--WebContent/VAADIN/themes/valo/components/_label.scss13
-rw-r--r--WebContent/VAADIN/themes/valo/components/_menubar.scss103
-rw-r--r--WebContent/VAADIN/themes/valo/components/_textarea.scss10
-rw-r--r--WebContent/VAADIN/themes/valo/components/_textfield.scss14
-rw-r--r--WebContent/VAADIN/themes/valo/components/_tree.scss9
-rw-r--r--WebContent/VAADIN/themes/valo/shared/_variables.scss12
-rw-r--r--build.properties2
-rwxr-xr-xclient/src/com/vaadin/DefaultWidgetSet.gwt.xml3
-rw-r--r--server/src/com/vaadin/ui/themes/ValoTheme.java74
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html136
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java13
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRangeTest.java510
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html63
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java32
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidthTest.java45
-rw-r--r--uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html136
-rw-r--r--uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAriaTest.java128
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ButtonsAndLinks.java8
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java16
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/DateFields.java12
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Forms.java3
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Labels.java13
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/MenuBars.java71
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/TextFields.java20
29 files changed, 1063 insertions, 424 deletions
diff --git a/WebContent/VAADIN/themes/tests-valo/_valotest.scss b/WebContent/VAADIN/themes/tests-valo/_valotest.scss
index 7c024b323e..568dfec0b8 100644
--- a/WebContent/VAADIN/themes/tests-valo/_valotest.scss
+++ b/WebContent/VAADIN/themes/tests-valo/_valotest.scss
@@ -141,4 +141,8 @@
.v-accordion-item-color1 .v-accordion-item-caption {
@include valo-accordion-item-caption-style($background-color: $color2);
}
+
+ .v-menubar-color1 {
+ @include valo-menubar-style($background-color: $v-selection-color, $unit-size: null);
+ }
}
diff --git a/WebContent/VAADIN/themes/valo/components/_button.scss b/WebContent/VAADIN/themes/valo/components/_button.scss
index ec74f70eaf..42953ea610 100644
--- a/WebContent/VAADIN/themes/valo/components/_button.scss
+++ b/WebContent/VAADIN/themes/valo/components/_button.scss
@@ -45,6 +45,10 @@
@include valo-link-style;
}
+ .#{$primary-stylename}-tiny {
+ @include valo-button-style($unit-size: $v-unit-size--tiny, $bevel: null, $shadow: null, $background-color: null, $font-size: $v-font-size--tiny, $font-weight: null);
+ }
+
.#{$primary-stylename}-small {
@include valo-button-style($unit-size: $v-unit-size--small, $bevel: null, $shadow: null, $background-color: null, $font-size: $v-font-size--small, $font-weight: null);
}
@@ -53,6 +57,10 @@
@include valo-button-style($unit-size: $v-unit-size--large, $bevel: null, $shadow: null, $background-color: null, $font-size: $v-font-size--large, $font-weight: null);
}
+ .#{$primary-stylename}-huge {
+ @include valo-button-style($unit-size: $v-unit-size--huge, $bevel: null, $shadow: null, $background-color: null, $font-size: $v-font-size--huge, $font-weight: null);
+ }
+
.#{$primary-stylename}-icon-align-right {
@include valo-button-icon-align-right-style;
}
@@ -65,6 +73,10 @@
width: $v-unit-size;
padding: 0;
+ &.#{$primary-stylename}-tiny {
+ width: $v-unit-size--tiny;
+ }
+
&.#{$primary-stylename}-small {
width: $v-unit-size--small;
}
@@ -73,6 +85,10 @@
width: $v-unit-size--large;
}
+ &.#{$primary-stylename}-huge {
+ width: $v-unit-size--huge;
+ }
+
.#{$primary-stylename}-caption {
display: none;
}
diff --git a/WebContent/VAADIN/themes/valo/components/_combobox.scss b/WebContent/VAADIN/themes/valo/components/_combobox.scss
index 4e5cd5bbac..538a5e2694 100644
--- a/WebContent/VAADIN/themes/valo/components/_combobox.scss
+++ b/WebContent/VAADIN/themes/valo/components/_combobox.scss
@@ -78,6 +78,11 @@
text-align: center;
}
+ .#{$primary-stylename}-tiny {
+ @include valo-combobox-style($unit-size: $v-unit-size--tiny, $bevel: null, $shadow: null, $gradient: null, $border: null, $border-radius: null, $background-color: null, $states: normal);
+ font-size: $v-font-size--tiny;
+ }
+
.#{$primary-stylename}-small {
@include valo-combobox-style($unit-size: $v-unit-size--small, $bevel: null, $shadow: null, $gradient: null, $border: null, $border-radius: null, $background-color: null, $states: normal);
font-size: $v-font-size--small;
@@ -87,6 +92,11 @@
@include valo-combobox-style($unit-size: $v-unit-size--large, $bevel: null, $shadow: null, $gradient: null, $border: null, $border-radius: null, $background-color: null, $states: normal);
font-size: $v-font-size--large;
}
+
+ .#{$primary-stylename}-huge {
+ @include valo-combobox-style($unit-size: $v-unit-size--huge, $bevel: null, $shadow: null, $gradient: null, $border: null, $border-radius: null, $background-color: null, $states: normal);
+ font-size: $v-font-size--huge;
+ }
}
}
diff --git a/WebContent/VAADIN/themes/valo/components/_datefield.scss b/WebContent/VAADIN/themes/valo/components/_datefield.scss
index 1538681740..8854992032 100644
--- a/WebContent/VAADIN/themes/valo/components/_datefield.scss
+++ b/WebContent/VAADIN/themes/valo/components/_datefield.scss
@@ -59,6 +59,11 @@
text-align: center;
}
+ .#{$primary-stylename}-tiny {
+ @include valo-datefield-style($unit-size: $v-unit-size--tiny, $bevel: null, $shadow: null, $border: null, $background-color: null, $states: normal);
+ font-size: $v-font-size--tiny;
+ }
+
.#{$primary-stylename}-small {
@include valo-datefield-style($unit-size: $v-unit-size--small, $bevel: null, $shadow: null, $border: null, $background-color: null, $states: normal);
font-size: $v-font-size--small;
@@ -68,6 +73,11 @@
@include valo-datefield-style($unit-size: $v-unit-size--large, $bevel: null, $shadow: null, $border: null, $background-color: null, $states: normal);
font-size: $v-font-size--large;
}
+
+ .#{$primary-stylename}-huge {
+ @include valo-datefield-style($unit-size: $v-unit-size--huge, $bevel: null, $shadow: null, $border: null, $background-color: null, $states: normal);
+ font-size: $v-font-size--huge;
+ }
}
}
diff --git a/WebContent/VAADIN/themes/valo/components/_formlayout.scss b/WebContent/VAADIN/themes/valo/components/_formlayout.scss
index 25dbfbef28..fc065cec3d 100644
--- a/WebContent/VAADIN/themes/valo/components/_formlayout.scss
+++ b/WebContent/VAADIN/themes/valo/components/_formlayout.scss
@@ -198,7 +198,6 @@
> .v-label-h3,
> .v-label-h4 {
border-bottom: none;
- color: $v-selection-color;
}
> .v-label-h3,
diff --git a/WebContent/VAADIN/themes/valo/components/_label.scss b/WebContent/VAADIN/themes/valo/components/_label.scss
index 29d811fc9a..e61aa4ec11 100644
--- a/WebContent/VAADIN/themes/valo/components/_label.scss
+++ b/WebContent/VAADIN/themes/valo/components/_label.scss
@@ -1,6 +1,7 @@
$v-font-weight--header: $v-font-weight - 100 !default;
$v-line-height--header: 1.1 !default;
$v-font-family--header: null !default;
+$v-font-color--colored: $v-selection-color !default;
$v-font-size--h1: 2.4em !default;
$v-font-size--h2: 1.6em !default;
@@ -104,6 +105,10 @@ $v-letter-spacing--h4: 0 !default;
@if $include-additional-styles {
+ .#{$primary-stylename}-colored {
+ color: $v-font-color--colored;
+ }
+
.#{$primary-stylename}-large {
font-size: $v-font-size--large;
}
@@ -112,6 +117,14 @@ $v-letter-spacing--h4: 0 !default;
font-size: $v-font-size--small;
}
+ .#{$primary-stylename}-tiny {
+ font-size: $v-font-size--tiny;
+ }
+
+ .#{$primary-stylename}-huge {
+ font-size: $v-font-size--huge;
+ }
+
.#{$primary-stylename}-bold {
font-weight: $v-font-weight + 200;
}
diff --git a/WebContent/VAADIN/themes/valo/components/_menubar.scss b/WebContent/VAADIN/themes/valo/components/_menubar.scss
index e79e6898a9..f03bc3d022 100644
--- a/WebContent/VAADIN/themes/valo/components/_menubar.scss
+++ b/WebContent/VAADIN/themes/valo/components/_menubar.scss
@@ -1,24 +1,8 @@
@mixin valo-menubar ($primary-stylename: v-menubar, $include-additional-styles: contains($v-included-additional-styles, menubar)) {
.#{$primary-stylename} {
- @include valo-button-static-style($states: normal, $vertical-centering: false);
- @include valo-button-style($states: normal, $cursor: default);
- padding: 0;
- text-align: left;
- overflow: hidden;
-
- &:focus:not(.v-disabled) {
- @include valo-button-focus-style($border-fallback: none, $include-box-shadow: false);
- $box-shadow: valo-bevel-and-shadow($bevel: $v-bevel, $shadow: $v-shadow, $gradient: $v-gradient);
- @if type-of($v-focus-style) == list {
- $box-shadow: $box-shadow, $v-focus-style;
- }
- @include box-shadow($box-shadow);
- }
-
- &.v-disabled {
- @include opacity($v-disabled-opacity);
- }
+ @include valo-button-static-style($states: normal focus disabled, $vertical-centering: false);
+ @include valo-menubar-style;
}
.#{$primary-stylename}:active:after {
@@ -60,6 +44,20 @@
.#{$primary-stylename} .#{$primary-stylename}-submenu-indicator {
display: none;
+
+ + .#{$primary-stylename}-menuitem-caption:after {
+ font-family: FontAwesome;
+ content: "\f078";
+ font-size: 0.7em;
+ vertical-align: .15em;
+ margin: 0 -.2em 0 .5em;
+ // IE filters are not supported on pseudo elements
+ opacity: .5;
+ }
+
+ + .#{$primary-stylename}-menuitem-caption:empty:after {
+ margin-left: -.2em;
+ }
}
.#{$primary-stylename}-popup {
@@ -70,10 +68,10 @@
}
}
-
+
@if $include-additional-styles {
.#{$primary-stylename}-small {
- @include valo-menubar-small-style($unit-size: $v-unit-size--small);
+ @include valo-menubar-style($background-color: null, $unit-size: $v-unit-size--small);
font-size: $v-font-size--small;
}
@@ -87,6 +85,27 @@
+@mixin valo-menubar-style ($primary-stylename: v-menubar, $background-color: $v-background-color, $unit-size: $v-unit-size) {
+ @include valo-button-style($states: normal focus, $cursor: default, $background-color: $background-color, $unit-size: $unit-size);
+ padding: 0;
+ text-align: left;
+
+ @if $unit-size {
+ line-height: $unit-size - first-number($v-border) * 2 - 1px;
+
+ > .#{$primary-stylename}-menuitem {
+ padding: 0 round($unit-size/2.6);
+
+ &[class*="-icon-only"] {
+ width: $unit-size;
+ }
+ }
+ }
+}
+
+
+
+
@mixin valo-menubar-menuitem-style {
$border-width: first-number($v-border);
position: relative;
@@ -95,31 +114,37 @@
@include box-sizing(border-box);
@include valo-button-style($states: normal, $border-radius: 0, $shadow: null, $font-color: inherit, $cursor: pointer);
background: transparent;
+ @include box-shadow(none);
border-width: 0 $border-width 0 0;
+ border-color: inherit;
height: 100%;
+ line-height: inherit;
vertical-align: top;
- line-height: $v-unit-size - $border-width*2 - 1px;
text-align: center;
@if $border-width == 0 {
margin-right: 1px;
}
- $br: $v-border-radius - $border-width - 1px;
+ $br: max(0, $v-border-radius - $border-width);
&:first-child {
border-left-width: 0;
- border-radius: $br 0 0 $br;
+ @if $v-border-radius > 0 {
+ border-radius: $br 0 0 $br;
+ }
}
&:last-child {
- border-radius: 0 $br $br 0;
- margin-right: -$border-width;
+ @if $v-border-radius > 0 {
+ border-radius: 0 $br $br 0;
+ }
+ border-right-width: 0;
}
&:first-child:last-child {
- border-radius: $br;
- border-right-width: 0;
- margin-right: 0;
+ @if $v-border-radius > 0 {
+ border-radius: $br;
+ }
}
&:before {
@@ -253,20 +278,6 @@
}
-
-@mixin valo-menubar-small-style ($primary-stylename: v-menubar, $unit-size: round($v-unit-size * 0.8)) {
- height: $unit-size;
-
- .#{$primary-stylename}-menuitem {
- line-height: $unit-size - first-number($v-border)*2;
- padding: 0 round($unit-size/2.5);
-
- &[class*="-icon-only"] {
- width: $unit-size;
- }
- }
-}
-
@mixin valo-menubar-borderless-style ($primary-stylename: v-menubar) {
border: none;
border-radius: 0;
@@ -275,9 +286,8 @@
background: transparent;
color: inherit;
- &:not(.v-disabled):focus {
- border: none;
- @include box-shadow(none);
+ &:focus:after {
+ display: none;
}
.#{$primary-stylename}-menuitem {
@@ -294,7 +304,8 @@
}
&:first-child,
- &:last-child {
+ &:last-child,
+ &:first-child:last-child {
border-radius: $v-border-radius;
}
diff --git a/WebContent/VAADIN/themes/valo/components/_textarea.scss b/WebContent/VAADIN/themes/valo/components/_textarea.scss
index 4c5d99b8e2..5e524bfb9e 100644
--- a/WebContent/VAADIN/themes/valo/components/_textarea.scss
+++ b/WebContent/VAADIN/themes/valo/components/_textarea.scss
@@ -19,6 +19,11 @@
@include valo-textfield-borderless-style;
}
+ .#{$primary-stylename}-tiny {
+ @include valo-textarea-style($unit-size: $v-unit-size--tiny, $states: normal, $background-color: null, $border: null, $bevel: null, $shadow: null);
+ font-size: $v-font-size--tiny;
+ }
+
.#{$primary-stylename}-small {
@include valo-textarea-style($unit-size: $v-unit-size--small, $states: normal, $background-color: null, $border: null, $bevel: null, $shadow: null);
font-size: $v-font-size--small;
@@ -29,6 +34,11 @@
font-size: $v-font-size--large;
}
+ .#{$primary-stylename}-huge {
+ @include valo-textarea-style($unit-size: $v-unit-size--huge, $states: normal, $background-color: null, $border: null, $bevel: null, $shadow: null);
+ font-size: $v-font-size--huge;
+ }
+
.#{$primary-stylename}-align-right {
text-align: right;
}
diff --git a/WebContent/VAADIN/themes/valo/components/_textfield.scss b/WebContent/VAADIN/themes/valo/components/_textfield.scss
index 75cfc5ef85..0b4fa50fb2 100644
--- a/WebContent/VAADIN/themes/valo/components/_textfield.scss
+++ b/WebContent/VAADIN/themes/valo/components/_textfield.scss
@@ -1,5 +1,5 @@
$v-textfield-background-color: if(is-dark-color($v-app-background-color), darken($v-app-background-color, 4%), lighten($v-app-background-color, 8%)) !default;
-$v-textfield-background-color--readonly: $v-app-background-color;
+$v-textfield-background-color--readonly: darkest-color($v-app-background-color, darken($v-textfield-background-color, 2%));
$v-textfield-bevel: inset 0 1px 0 v-shade !default;
$v-textfield-shadow: 0 1px 0 (v-tint 2) !default;
$v-textfield-font-weight: 400 !default;
@@ -30,6 +30,11 @@ $v-textfield-disabled-opacity: $v-disabled-opacity !default;
@include valo-textfield-borderless-style;
}
+ .#{$primary-stylename}-tiny {
+ @include valo-textfield-style($unit-size: $v-unit-size--tiny, $states: normal, $background-color: null, $border: null, $gradient: null, $bevel: null, $shadow: null);
+ font-size: $v-font-size--tiny;
+ }
+
.#{$primary-stylename}-small {
@include valo-textfield-style($unit-size: $v-unit-size--small, $states: normal, $background-color: null, $border: null, $gradient: null, $bevel: null, $shadow: null);
font-size: $v-font-size--small;
@@ -40,9 +45,16 @@ $v-textfield-disabled-opacity: $v-disabled-opacity !default;
font-size: $v-font-size--large;
}
+ .#{$primary-stylename}-huge {
+ @include valo-textfield-style($unit-size: $v-unit-size--huge, $states: normal, $background-color: null, $border: null, $gradient: null, $bevel: null, $shadow: null);
+ font-size: $v-font-size--huge;
+ }
+
@include valo-textfield-inline-icon($stylenames: inline-icon);
+ @include valo-textfield-inline-icon($stylenames: inline-icon tiny, $unit-size: $v-unit-size--tiny, $font-size: $v-font-size--tiny);
@include valo-textfield-inline-icon($stylenames: inline-icon small, $unit-size: $v-unit-size--small, $font-size: $v-font-size--small);
@include valo-textfield-inline-icon($stylenames: inline-icon large, $unit-size: $v-unit-size--large, $font-size: $v-font-size--large);
+ @include valo-textfield-inline-icon($stylenames: inline-icon huge, $unit-size: $v-unit-size--huge, $font-size: $v-font-size--huge);
.#{$primary-stylename}-align-right {
text-align: right;
diff --git a/WebContent/VAADIN/themes/valo/components/_tree.scss b/WebContent/VAADIN/themes/valo/components/_tree.scss
index 7e00f4ec09..93553fe55a 100644
--- a/WebContent/VAADIN/themes/valo/components/_tree.scss
+++ b/WebContent/VAADIN/themes/valo/components/_tree.scss
@@ -218,7 +218,8 @@ $v-tree-expand-animation-enabled: false !default;
// Drag'n'drop styles
.#{$primary-stylename}-node-drag-top:before,
- .#{$primary-stylename}-node-drag-bottom:after {
+ .#{$primary-stylename}-node-drag-bottom:after,
+ .#{$primary-stylename}-node-drag-bottom.#{$primary-stylename}-node-dragfolder.#{$primary-stylename}-node-expanded > .#{$primary-stylename}-node-children:before {
content: "\2022";
display: block;
position: absolute;
@@ -230,6 +231,12 @@ $v-tree-expand-animation-enabled: false !default;
color: $v-focus-color;
text-indent: round($v-font-size/-4);
text-shadow: 0 0 1px $v-background-color, 0 0 1px $v-background-color;
+ opacity: 1;
+ visibility: visible;
+ }
+
+ .#{$primary-stylename}-node-drag-bottom.#{$primary-stylename}-node-dragfolder.#{$primary-stylename}-node-expanded:after {
+ content: none;
}
.#{$primary-stylename}-node-caption-drag-center {
diff --git a/WebContent/VAADIN/themes/valo/shared/_variables.scss b/WebContent/VAADIN/themes/valo/shared/_variables.scss
index b1c113b2cc..7dd3827298 100644
--- a/WebContent/VAADIN/themes/valo/shared/_variables.scss
+++ b/WebContent/VAADIN/themes/valo/shared/_variables.scss
@@ -60,14 +60,20 @@ $v-required-field-indicator-color : $v-error-indicator-color
$v-friendly-color : #2c9720 !default;
-$v-scaling-factor--small : 0.8 !default;
+$v-scaling-factor--tiny : 0.75 !default;
+$v-scaling-factor--small : 0.85 !default;
$v-scaling-factor--large : 1.2 !default;
+$v-scaling-factor--huge : 1.6 !default;
+$v-unit-size--tiny : round($v-unit-size * $v-scaling-factor--tiny) !default;
$v-unit-size--small : round($v-unit-size * $v-scaling-factor--small) !default;
$v-unit-size--large : round($v-unit-size * $v-scaling-factor--large) !default;
+$v-unit-size--huge : round($v-unit-size * $v-scaling-factor--huge) !default;
-$v-font-size--small : round($v-font-size * $v-scaling-factor--small) !default;
-$v-font-size--large : round($v-font-size * $v-scaling-factor--large) !default;
+$v-font-size--tiny : ceil($v-font-size * $v-scaling-factor--tiny) !default;
+$v-font-size--small : ceil($v-font-size * $v-scaling-factor--small) !default;
+$v-font-size--large : ceil($v-font-size * $v-scaling-factor--large) !default;
+$v-font-size--huge : ceil($v-font-size * $v-scaling-factor--huge) !default;
diff --git a/build.properties b/build.properties
index bd31158a3e..0a25dab4b9 100644
--- a/build.properties
+++ b/build.properties
@@ -6,5 +6,5 @@ vaadin.url=http://vaadin.com
vaadin.java.version=1.6
vaadin.version=0.0.0.unversioned-development-build
vaadin.sass.version=0.9.9
-gwt.version=2.6.0.vaadin4
+gwt.version=2.6.0.vaadin5
commons-io.version=2.4
diff --git a/client/src/com/vaadin/DefaultWidgetSet.gwt.xml b/client/src/com/vaadin/DefaultWidgetSet.gwt.xml
index 461bd5ed1b..8512d547e3 100755
--- a/client/src/com/vaadin/DefaultWidgetSet.gwt.xml
+++ b/client/src/com/vaadin/DefaultWidgetSet.gwt.xml
@@ -15,7 +15,4 @@
larger. -->
<collapse-all-properties />
- <!-- Workaround for http://dev.vaadin.com/ticket/14051 -->
- <set-property name="compiler.useSymbolMaps" value="true" />
-
</module>
diff --git a/server/src/com/vaadin/ui/themes/ValoTheme.java b/server/src/com/vaadin/ui/themes/ValoTheme.java
index ad949c6a32..d6bd97ed72 100644
--- a/server/src/com/vaadin/ui/themes/ValoTheme.java
+++ b/server/src/com/vaadin/ui/themes/ValoTheme.java
@@ -25,9 +25,10 @@ import com.vaadin.ui.Table.ColumnHeaderMode;
* </p>
*
* <p>
- * These styles are only available if the Valo theme (or any of it's variants)
- * is built with the <code>$valo-include-common-stylenames</code> Sass variable
- * set to <code>true</code>.
+ * These styles are only available if the
+ * <code>$v-included-additional-styles</code> Sass list variable contains the
+ * name of the component for that additional style name (e.g.
+ * <code>button, textfield, table</code>).
* </p>
*
* <p>
@@ -149,6 +150,12 @@ public class ValoTheme {
public static final String LABEL_NO_MARGIN = "no-margin";
/**
+ * Tiny font size. Suitable for additional/supplementary UI text. Can be
+ * combined with any other Label style.
+ */
+ public static final String LABEL_TINY = "tiny";
+
+ /**
* Small font size. Suitable for additional/supplementary UI text. Can be
* combined with any other Label style.
*/
@@ -161,6 +168,12 @@ public class ValoTheme {
public static final String LABEL_LARGE = "large";
/**
+ * Huge font size. Suitable for important/prominent UI text. Can be combined
+ * with any other Label style.
+ */
+ public static final String LABEL_HUGE = "huge";
+
+ /**
* Lighter font weight. Suitable for additional/supplementary UI text. Can
* be combined with any other Label style.
*/
@@ -173,6 +186,11 @@ public class ValoTheme {
public static final String LABEL_BOLD = "bold";
/**
+ * Colored text. Can be combined with any other Label style.
+ */
+ public static final String LABEL_COLORED = "colored";
+
+ /**
* Success badge style. Adds a border around the label and an icon next to
* the text. Suitable for UI notifications that need to in the direct
* context of some component. Can be combined with any other Label style.
@@ -252,6 +270,11 @@ public class ValoTheme {
public static final String BUTTON_LINK = "link";
/**
+ * Tiny size button. Can be combined with any other Button style.
+ */
+ public static final String BUTTON_TINY = "tiny";
+
+ /**
* Small size button. Can be combined with any other Button style.
*/
public static final String BUTTON_SMALL = "small";
@@ -262,6 +285,11 @@ public class ValoTheme {
public static final String BUTTON_LARGE = "large";
/**
+ * Huge size button. Can be combined with any other Button style.
+ */
+ public static final String BUTTON_HUGE = "huge";
+
+ /**
* Align the icon to the right side of the button caption. Can be combined
* with any other Button style.
*/
@@ -301,6 +329,11 @@ public class ValoTheme {
**************************************************************************/
/**
+ * Tiny size text field. Can be combined with any other TextField style.
+ */
+ public static final String TEXTFIELD_TINY = "tiny";
+
+ /**
* Small size text field. Can be combined with any other TextField style.
*/
public static final String TEXTFIELD_SMALL = "small";
@@ -311,6 +344,11 @@ public class ValoTheme {
public static final String TEXTFIELD_LARGE = "large";
/**
+ * Huge size text field. Can be combined with any other TextField style.
+ */
+ public static final String TEXTFIELD_HUGE = "huge";
+
+ /**
* Removes the border and background from the text field. Can be combined
* with any other TextField style.
*/
@@ -341,6 +379,11 @@ public class ValoTheme {
**************************************************************************/
/**
+ * Tiny size text area. Can be combined with any other TextArea style.
+ */
+ public static final String TEXTAREA_TINY = "tiny";
+
+ /**
* Small size text area. Can be combined with any other TextArea style.
*/
public static final String TEXTAREA_SMALL = "small";
@@ -351,6 +394,11 @@ public class ValoTheme {
public static final String TEXTAREA_LARGE = "large";
/**
+ * Huge size text area. Can be combined with any other TextArea style.
+ */
+ public static final String TEXTAREA_HUGE = "huge";
+
+ /**
* Removes the border and background from the text area. Can be combined
* with any other TextArea style.
*/
@@ -375,6 +423,11 @@ public class ValoTheme {
**************************************************************************/
/**
+ * Tiny size date field. Can be combined with any other DateField style.
+ */
+ public static final String DATEFIELD_TINY = "tiny";
+
+ /**
* Small size date field. Can be combined with any other DateField style.
*/
public static final String DATEFIELD_SMALL = "small";
@@ -385,6 +438,11 @@ public class ValoTheme {
public static final String DATEFIELD_LARGE = "large";
/**
+ * Huge size date field. Can be combined with any other DateField style.
+ */
+ public static final String DATEFIELD_HUGE = "huge";
+
+ /**
* Removes the border and background from the date field. Can be combined
* with any other DateField style.
*/
@@ -409,6 +467,11 @@ public class ValoTheme {
**************************************************************************/
/**
+ * Tiny size combo box. Can be combined with any other ComboBox style.
+ */
+ public static final String COMBOBOX_TINY = "tiny";
+
+ /**
* Small size combo box. Can be combined with any other ComboBox style.
*/
public static final String COMBOBOX_SMALL = "small";
@@ -419,6 +482,11 @@ public class ValoTheme {
public static final String COMBOBOX_LARGE = "large";
/**
+ * Huge size combo box. Can be combined with any other ComboBox style.
+ */
+ public static final String COMBOBOX_HUGE = "huge";
+
+ /**
* Removes the border and background from the combo box. Can be combined
* with any other ComboBox style.
*/
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html
deleted file mode 100644
index 2783ed2aa3..0000000000
--- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>PopupDateFieldExtendedRange</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">PopupDateFieldExtendedRange</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.datefield.PopupDateFieldExtendedRange?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton</td>
- <td>7,16</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup1-01-2011</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#prevmon</td>
- <td>8,7</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup1-12-2010</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#prevy</td>
- <td>12,6</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup1-12-2009</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton</td>
- <td>10,13</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#popupButton</td>
- <td>14,13</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup2-02-2010</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]</td>
- <td>down</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]</td>
- <td>down</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup2-03-2010</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]</td>
- <td>left</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]</td>
- <td>left</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup2-02-2010-again</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#popupButton</td>
- <td>7,16</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton</td>
- <td>17,10</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]</td>
- <td>shift left</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup3-01-2010</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]</td>
- <td>shift down</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>popup3-01-2009</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton</td>
- <td>10,8</td>
-</tr>
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
index a12bdfa44c..2608e6e081 100644
--- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
@@ -3,20 +3,21 @@ package com.vaadin.tests.components.datefield;
import java.util.Calendar;
import java.util.Locale;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.datefield.Resolution;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.DateField;
import com.vaadin.ui.PopupDateField;
@SuppressWarnings("serial")
-public class PopupDateFieldExtendedRange extends TestBase {
+public class PopupDateFieldExtendedRange extends AbstractTestUI {
private Calendar date = Calendar.getInstance();
@Override
- protected void setup() {
+ protected void setup(VaadinRequest request) {
date.set(2011, 0, 1);
getLayout().setSpacing(true);
@@ -52,7 +53,7 @@ public class PopupDateFieldExtendedRange extends TestBase {
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "Show a few days of the preceding and following months in the datefield popup";
}
@@ -63,7 +64,7 @@ public class PopupDateFieldExtendedRange extends TestBase {
private PopupDateField makeDateField() {
PopupDateField pdf = new PopupDateField();
- pdf.setResolution(DateField.RESOLUTION_DAY);
+ pdf.setResolution(Resolution.DAY);
pdf.setValue(date.getTime());
return pdf;
}
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRangeTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRangeTest.java
new file mode 100644
index 0000000000..6d22048d32
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRangeTest.java
@@ -0,0 +1,510 @@
+/*
+ * 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.components.datefield;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.DateFieldElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests contents and functionality of PopupDateField's popup.
+ *
+ * @author Vaadin Ltd
+ */
+public class PopupDateFieldExtendedRangeTest extends MultiBrowserTest {
+
+ @Override
+ @Before
+ public void setup() throws Exception {
+ super.setup();
+ openTestURL();
+ }
+
+ @Test
+ public void testFirstDateField() {
+ List<DateFieldElement> dateFields = $(DateFieldElement.class).all();
+ assertEquals("unexpected amount of datefields", 3, dateFields.size());
+
+ DateFieldElement dateField = dateFields.get(0);
+
+ // open the popup
+ dateField.findElement(By.tagName("button")).click();
+
+ assertTrue("popup not found when there should be one",
+ isElementPresent(By.className("v-datefield-popup")));
+
+ // verify contents
+ WebElement popup = findElement(By.className("v-datefield-popup"));
+ assertEquals(
+ "unexpected month",
+ "tammikuu 2011",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ List<WebElement> headerElements = popup.findElement(
+ By.className("v-datefield-calendarpanel-weekdays"))
+ .findElements(By.tagName("td"));
+ List<WebElement> weekdays = new ArrayList<WebElement>();
+ for (WebElement headerElement : headerElements) {
+ if ("columnheader".equals(headerElement.getAttribute("role"))) {
+ weekdays.add(headerElement);
+ }
+ }
+ assertEquals("unexpected weekday count", 7, weekdays.size());
+ assertEquals("unexpected first day of week", "MA", weekdays.get(0)
+ .getText());
+ assertEquals(
+ "unexpected weeknumber count",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-weeknumber"))
+ .size());
+ assertEquals(
+ "unexpected selection",
+ "1",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .getText());
+ assertEquals(
+ "unexpected focus",
+ "1",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ List<WebElement> days = popup.findElements(By
+ .className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "27", days.get(0).getText());
+ assertEquals("unexpected day content", "4", days.get(8).getText());
+ assertEquals("unexpected day content", "21", days.get(25).getText());
+ assertEquals("unexpected day content", "6", days.get(41).getText());
+
+ // move to the previous month
+ popup.findElement(By.className("v-datefield-calendarpanel-prevmonth"))
+ .findElement(By.tagName("button")).click();
+
+ // verify contents
+ assertEquals(
+ "unexpected month",
+ "joulukuu 2010",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ "1",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .getText());
+ assertEquals(
+ "unexpected focus",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .size());
+ days = popup
+ .findElements(By.className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "29", days.get(0).getText());
+ assertEquals("unexpected day content", "7", days.get(8).getText());
+ assertEquals("unexpected day content", "24", days.get(25).getText());
+ assertEquals("unexpected day content", "9", days.get(41).getText());
+
+ // move to the previous year
+ popup.findElement(By.className("v-datefield-calendarpanel-prevyear"))
+ .findElement(By.tagName("button")).click();
+
+ // verify contents
+ assertEquals(
+ "unexpected month",
+ "joulukuu 2009",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .size());
+ assertEquals(
+ "unexpected focus",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .size());
+ days = popup
+ .findElements(By.className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "30", days.get(0).getText());
+ assertEquals("unexpected day content", "8", days.get(8).getText());
+ assertEquals("unexpected day content", "25", days.get(25).getText());
+ assertEquals("unexpected day content", "10", days.get(41).getText());
+
+ // close the popup by clicking the button again
+ dateField.findElement(By.tagName("button")).click();
+
+ // TODO: remove this once #14405 has been fixed
+ if (!getBrowsersExcludingIE().contains(getDesiredCapabilities())) {
+ // click something else outside the popup to close it
+ dateField.findElement(By.tagName("input")).click();
+ }
+
+ assertFalse("popup found when there should be none",
+ isElementPresent(By.className("v-datefield-popup")));
+ }
+
+ @Test
+ public void testSecondDateField() throws InterruptedException {
+ DateFieldElement dateField = $(DateFieldElement.class).all().get(1);
+ ButtonElement button = $(ButtonElement.class).first();
+
+ // change the date
+ button.click();
+ sleep(100);
+
+ // open the popup
+ dateField.findElement(By.tagName("button")).click();
+
+ assertTrue("popup not found when there should be one",
+ isElementPresent(By.className("v-datefield-popup")));
+
+ // verify contents
+ WebElement popup = findElement(By.className("v-datefield-popup"));
+ assertEquals(
+ "unexpected month",
+ "February 2010",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ List<WebElement> headerElements = popup.findElement(
+ By.className("v-datefield-calendarpanel-weekdays"))
+ .findElements(By.tagName("td"));
+ List<WebElement> weekdays = new ArrayList<WebElement>();
+ for (WebElement headerElement : headerElements) {
+ if ("columnheader".equals(headerElement.getAttribute("role"))) {
+ weekdays.add(headerElement);
+ }
+ }
+ assertEquals("unexpected weekday count", 7, weekdays.size());
+ assertEquals("unexpected first day of week", "SUN", weekdays.get(0)
+ .getText());
+ assertEquals(
+ "unexpected weeknumber count",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-weeknumber"))
+ .size());
+ assertEquals(
+ "unexpected selection",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .getText());
+ assertEquals(
+ "unexpected focus",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ List<WebElement> days = popup.findElements(By
+ .className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "31", days.get(0).getText());
+ assertEquals("unexpected day content", "8", days.get(8).getText());
+ assertEquals("unexpected day content", "25", days.get(25).getText());
+ assertEquals("unexpected day content", "13", days.get(41).getText());
+
+ // navigate down
+ WebElement popupBody = popup.findElement(By
+ .className("v-datefield-calendarpanel"));
+ popupBody.sendKeys(Keys.ARROW_DOWN);
+
+ // ensure the focus changed
+ assertEquals(
+ "unexpected focus",
+ "23",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+
+ // navigate down
+ popupBody.sendKeys(Keys.ARROW_DOWN);
+
+ // verify contents
+ assertEquals(
+ "unexpected month",
+ "March 2010",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .size());
+ assertEquals(
+ "unexpected focus",
+ "2",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ days = popup
+ .findElements(By.className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "28", days.get(0).getText());
+ assertEquals("unexpected day content", "8", days.get(8).getText());
+ assertEquals("unexpected day content", "25", days.get(25).getText());
+ assertEquals("unexpected day content", "10", days.get(41).getText());
+
+ // navigate left
+ popupBody = popup
+ .findElement(By.className("v-datefield-calendarpanel"));
+ popupBody.sendKeys(Keys.ARROW_LEFT);
+
+ // ensure the focus changed
+ assertEquals(
+ "unexpected focus",
+ "1",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+
+ // navigate left
+ popupBody.sendKeys(Keys.ARROW_LEFT);
+
+ // verify contents
+ assertEquals(
+ "unexpected month",
+ "February 2010",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .getText());
+ assertEquals(
+ "unexpected focus",
+ "28",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ days = popup
+ .findElements(By.className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "31", days.get(0).getText());
+ assertEquals("unexpected day content", "8", days.get(8).getText());
+ assertEquals("unexpected day content", "25", days.get(25).getText());
+ assertEquals("unexpected day content", "13", days.get(41).getText());
+
+ // close the popup by clicking the input field
+ dateField.findElement(By.tagName("input")).click();
+
+ assertFalse("popup found when there should be none",
+ isElementPresent(By.className("v-datefield-popup")));
+ }
+
+ @Test
+ public void testThirdDateField() throws InterruptedException {
+ DateFieldElement dateField = $(DateFieldElement.class).all().get(2);
+ ButtonElement button = $(ButtonElement.class).first();
+
+ // change the date
+ button.click();
+ sleep(100);
+
+ // open the popup
+ dateField.findElement(By.tagName("button")).click();
+
+ assertTrue("popup not found when there should be one",
+ isElementPresent(By.className("v-datefield-popup")));
+
+ // verify contents
+ WebElement popup = findElement(By.className("v-datefield-popup"));
+ assertEquals(
+ "unexpected month",
+ "helmikuu 2010",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ List<WebElement> headerElements = popup.findElement(
+ By.className("v-datefield-calendarpanel-weekdays"))
+ .findElements(By.tagName("td"));
+ List<WebElement> weekdays = new ArrayList<WebElement>();
+ for (WebElement headerElement : headerElements) {
+ if ("columnheader".equals(headerElement.getAttribute("role"))) {
+ weekdays.add(headerElement);
+ }
+ }
+ assertEquals("unexpected weekday count", 7, weekdays.size());
+ assertEquals("unexpected first day of week", "MA", weekdays.get(0)
+ .getText());
+ List<WebElement> weeknumbers = popup.findElements(By
+ .className("v-datefield-calendarpanel-weeknumber"));
+ assertEquals("unexpected weeknumber count", 6, weeknumbers.size());
+ assertEquals("unexpected weeknumber content", "5", weeknumbers.get(0)
+ .getText());
+ assertEquals("unexpected weeknumber content", "10", weeknumbers.get(5)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .getText());
+ assertEquals(
+ "unexpected focus",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ List<WebElement> days = popup.findElements(By
+ .className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "1", days.get(0).getText());
+ assertEquals("unexpected day content", "9", days.get(8).getText());
+ assertEquals("unexpected day content", "26", days.get(25).getText());
+ assertEquals("unexpected day content", "14", days.get(41).getText());
+
+ // navigate to previous month
+ WebElement popupBody = popup.findElement(By
+ .className("v-datefield-calendarpanel"));
+ new Actions(driver).keyDown(Keys.SHIFT).perform();
+ popupBody.sendKeys(Keys.ARROW_LEFT);
+ new Actions(driver).keyUp(Keys.SHIFT).perform();
+
+ // TODO: remove this once #14406 has been fixed
+ if (!getBrowsersExcludingIE().contains(getDesiredCapabilities())
+ && !Browser.IE8.getDesiredCapabilities().equals(
+ getDesiredCapabilities())) {
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-prevmonth"))
+ .findElement(By.tagName("button")).click();
+ }
+
+ // verify contents
+ assertEquals(
+ "unexpected month",
+ "tammikuu 2010",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ weeknumbers = popup.findElements(By
+ .className("v-datefield-calendarpanel-weeknumber"));
+ assertEquals("unexpected weeknumber count", 6, weeknumbers.size());
+ assertEquals("unexpected weeknumber content", "53", weeknumbers.get(0)
+ .getText());
+ assertEquals("unexpected weeknumber content", "5", weeknumbers.get(5)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .size());
+ // TODO: remove this check once #14406 has been fixed -- clicking the
+ // button instead of navigating with arrow keys steals the focus
+ if (getBrowsersExcludingIE().contains(getDesiredCapabilities())
+ || Browser.IE8.getDesiredCapabilities().equals(
+ getDesiredCapabilities())) {
+ assertEquals(
+ "unexpected focus",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ }
+ days = popup
+ .findElements(By.className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "28", days.get(0).getText());
+ assertEquals("unexpected day content", "5", days.get(8).getText());
+ assertEquals("unexpected day content", "22", days.get(25).getText());
+ assertEquals("unexpected day content", "7", days.get(41).getText());
+
+ // navigate to previous year
+ new Actions(driver).keyDown(Keys.SHIFT).perform();
+ popupBody.sendKeys(Keys.ARROW_DOWN);
+ new Actions(driver).keyUp(Keys.SHIFT).perform();
+
+ // TODO: remove this once #14406 has been fixed
+ popup.findElement(By.className("v-datefield-calendarpanel-prevyear"))
+ .findElement(By.tagName("button")).click();
+
+ // verify contents
+ assertEquals(
+ "unexpected month",
+ "tammikuu 2009",
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-month")).get(1)
+ .getText());
+ weeknumbers = popup.findElements(By
+ .className("v-datefield-calendarpanel-weeknumber"));
+ assertEquals("unexpected weeknumber count", 6, weeknumbers.size());
+ assertEquals("unexpected weeknumber content", "1", weeknumbers.get(0)
+ .getText());
+ assertEquals("unexpected weeknumber content", "6", weeknumbers.get(5)
+ .getText());
+ assertEquals(
+ "unexpected selection",
+ 0,
+ popup.findElements(
+ By.className("v-datefield-calendarpanel-day-selected"))
+ .size());
+ // TODO: remove this check once #14406 has been fixed -- clicking the
+ // button instead of navigating with arrow keys steals the focus
+ if (false) {
+ assertEquals(
+ "unexpected focus",
+ "16",
+ popup.findElement(
+ By.className("v-datefield-calendarpanel-day-focused"))
+ .getText());
+ }
+ days = popup
+ .findElements(By.className("v-datefield-calendarpanel-day"));
+ assertEquals("unexpected day count", 42, days.size());
+ assertEquals("unexpected day content", "29", days.get(0).getText());
+ assertEquals("unexpected day content", "6", days.get(8).getText());
+ assertEquals("unexpected day content", "23", days.get(25).getText());
+ assertEquals("unexpected day content", "8", days.get(41).getText());
+
+ // close the popup by clicking an unrelated element
+ button.click();
+
+ assertFalse("popup found when there should be none",
+ isElementPresent(By.className("v-datefield-popup")));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html
deleted file mode 100644
index 6e3d86175a..0000000000
--- a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>TextFieldRelativeWidth</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">TextFieldRelativeWidth</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.table.TextFieldRelativeWidth</td>
- <td></td>
-</tr>
-<!-- Workaround for Opera 10.50 CSS loading problem -->
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.table.TextFieldRelativeWidth</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentstableTextFieldRelativeWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentstableTextFieldRelativeWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[4]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java
index 5c7479d060..4799d05415 100644
--- a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java
+++ b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java
@@ -1,19 +1,19 @@
package com.vaadin.tests.components.table;
import com.vaadin.data.Item;
-import com.vaadin.data.Property;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-public class TextFieldRelativeWidth extends TestBase {
+public class TextFieldRelativeWidth extends AbstractTestUI {
@Override
- public void setup() {
+ public void setup(VaadinRequest request) {
TextField tf = new TextField("test", "testing");
tf.setWidth("100%");
@@ -30,15 +30,12 @@ public class TextFieldRelativeWidth extends TestBase {
private Button addButton = new Button("Add new row", this);
private String inputPrompt;
-
private String inputPromptChild;
-
private int nextItemIndex = 1;
- private static final long serialVersionUID = 3326806911297977454L;
-
+ @SuppressWarnings("unchecked")
public EditTable() {
- setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
+ setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
inputPrompt = "";
setPageLength(100);
setHeight("100%");
@@ -51,20 +48,9 @@ public class TextFieldRelativeWidth extends TestBase {
i.getItemProperty("text").setValue(addButton);
setImmediate(true);
setSelectable(true);
- addListener(new Property.ValueChangeListener() {
- private static final long serialVersionUID = 448896474865195605L;
-
- @Override
- public void valueChange(
- com.vaadin.data.Property.ValueChangeEvent event) {
- // IndexedContainer idc = (IndexedContainer)
- // getContainerDataSource();
-
- }
-
- });
}
+ @SuppressWarnings("unchecked")
public void addNewRow() {
IndexedContainer idc = (IndexedContainer) getContainerDataSource();
int size = idc.size();
@@ -87,8 +73,6 @@ public class TextFieldRelativeWidth extends TestBase {
if (inputPromptChild != null && inputPromptChild.length() > 0) {
tf.setInputPrompt(inputPromptChild);
}
- // tf.setRows(1);
- // tf.setHeight("45px");
tf.setWidth("100%");
tf.addStyleName("childtf");
newItem.getItemProperty("text").setValue(tf);
@@ -119,7 +103,7 @@ public class TextFieldRelativeWidth extends TestBase {
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "The table has 3 columns. The second column is expanded and contains 100% wide textfields. These should fill the available space. The third column is empty.";
}
diff --git a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidthTest.java b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidthTest.java
new file mode 100644
index 0000000000..520ffa1aec
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidthTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.components.table;
+
+import java.io.IOException;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests that a TextField with 100% width fills the expanded column.
+ *
+ * @author Vaadin Ltd
+ */
+public class TextFieldRelativeWidthTest extends MultiBrowserTest {
+
+ @Test
+ public void testWidth() throws IOException {
+ openTestURL();
+
+ compareScreen("initial");
+
+ ButtonElement button = $(ButtonElement.class).first();
+ button.click();
+ button.click();
+
+ compareScreen("after");
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html
deleted file mode 100644
index f5f89d13ef..0000000000
--- a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>ExtraWindowShownWaiAria</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">ExtraWindowShownWaiAria</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.window.ExtraWindowShownWaiAria?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td>
- <td></td>
-</tr>
-<tr>
- <td>assertAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@role</td>
- <td>dialog</td>
-</tr>
-<tr>
- <td>storeAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]@id</td>
- <td>headerid</td>
-</tr>
-<tr>
- <td>assertAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-labelledby</td>
- <td>${headerid}</td>
-</tr>
-<tr>
- <td>storeAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[0]@id</td>
- <td>descriptionid</td>
-</tr>
-<tr>
- <td>assertAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-describedby</td>
- <td>${descriptionid}</td>
-</tr>
-<tr>
- <td>assertAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]@role</td>
- <td>button</td>
-</tr>
-<tr>
- <td>assertAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]@role</td>
- <td>button</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementNotPresent</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VCheckBox[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>storeAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[0]@id</td>
- <td>descriptionid</td>
-</tr>
-<tr>
- <td>storeAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[1]@id</td>
- <td>description2id</td>
-</tr>
-<tr>
- <td>assertAttribute</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-describedby</td>
- <td>${descriptionid} ${description2id}</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementNotPresent</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td>
- <td></td>
-</tr>
-<tr>
- <td>type</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[6]/VTextField[0]</td>
- <td>Important</td>
-</tr>
-<tr>
- <td>type</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[7]/VTextField[0]</td>
- <td> - do ASAP</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>xpath=//div[@class='v-window-header']/span[@class='v-assistive-device-only'][1]</td>
- <td>Important</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>xpath=//div[@class='v-window-header']/span[@class='v-assistive-device-only'][2]</td>
- <td>- do ASAP</td>
-</tr>
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAriaTest.java b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAriaTest.java
new file mode 100644
index 0000000000..44aea3522a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAriaTest.java
@@ -0,0 +1,128 @@
+/*
+ * 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.components.window;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.testbench.elements.WindowElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests dialogs with WAI-ARIA.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class ExtraWindowShownWaiAriaTest extends MultiBrowserTest {
+
+ @Test
+ public void testDialogs() throws InterruptedException {
+ openTestURL();
+
+ List<ButtonElement> buttons = $(ButtonElement.class).all();
+ assertFalse(buttons.isEmpty());
+
+ // open alert dialog
+ buttons.get(0).click();
+
+ // ensure dialog opened
+ List<WindowElement> windows = $(WindowElement.class).all();
+ assertFalse(windows.isEmpty());
+
+ // ensure correct attributes
+ assertEquals("alertdialog", windows.get(0).getAttribute("role"));
+
+ WebElement header = windows.get(0).findElement(
+ By.className("v-window-header"));
+ assertEquals(header.getAttribute("id"),
+ windows.get(0).getAttribute("aria-labelledby"));
+
+ WebElement label = windows.get(0).findElement(By.className("v-label"));
+ assertEquals(label.getAttribute("id"),
+ windows.get(0).getAttribute("aria-describedby"));
+
+ List<WebElement> wButtons = windows.get(0).findElements(
+ By.className("v-button"));
+ assertEquals("button", wButtons.get(0).getAttribute("role"));
+ assertEquals("button", wButtons.get(1).getAttribute("role"));
+
+ // close dialog
+ wButtons.get(0).click();
+
+ // ensure dialog closed
+ windows = $(WindowElement.class).all();
+ assertTrue(windows.isEmpty());
+
+ // check additional description (second checkbox on the page)
+ List<CheckBoxElement> checkBoxes = $(CheckBoxElement.class).all();
+ WebElement input = checkBoxes.get(1).findElement(By.tagName("input"));
+ // ensure that not checked yet
+ assertEquals(null, input.getAttribute("checked"));
+ input.click();
+ // ensure that checked now
+ assertEquals("true", input.getAttribute("checked"));
+
+ // open alert dialog
+ buttons = $(ButtonElement.class).all();
+ buttons.get(0).click();
+
+ // ensure correct attributes
+ windows = $(WindowElement.class).all();
+ List<WebElement> labels = windows.get(0).findElements(
+ By.className("v-label"));
+ assertEquals(labels.get(0).getAttribute("id") + " "
+ + labels.get(1).getAttribute("id"), windows.get(0)
+ .getAttribute("aria-describedby"));
+
+ // close dialog
+ wButtons = windows.get(0).findElements(By.className("v-button"));
+ wButtons.get(0).click();
+
+ // ensure dialog closed
+ windows = $(WindowElement.class).all();
+ assertTrue(windows.isEmpty());
+
+ // add prefix and postfix
+ List<TextFieldElement> textFields = $(TextFieldElement.class).all();
+ textFields.get(0).sendKeys("Important");
+ textFields.get(1).sendKeys(" - do ASAP");
+
+ // open alert dialog
+ buttons = $(ButtonElement.class).all();
+ buttons.get(0).click();
+
+ // ensure the assistive spans have been added to the header
+ windows = $(WindowElement.class).all();
+ header = windows.get(0).findElement(By.className("v-window-header"));
+ List<WebElement> assistiveElements = header.findElements(By
+ .className("v-assistive-device-only"));
+ assertEquals("Important",
+ assistiveElements.get(0).getAttribute("innerHTML"));
+ assertEquals(" - do ASAP",
+ assistiveElements.get(1).getAttribute("innerHTML"));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ButtonsAndLinks.java b/uitest/src/com/vaadin/tests/themes/valo/ButtonsAndLinks.java
index 758d2de200..e66cd2668b 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/ButtonsAndLinks.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/ButtonsAndLinks.java
@@ -136,6 +136,14 @@ public class ButtonsAndLinks extends VerticalLayout implements View {
button = new Button("Three");
group.addComponent(button);
+ button = new Button("Tiny");
+ button.addStyleName("tiny");
+ row.addComponent(button);
+
+ button = new Button("Huge");
+ button.addStyleName("huge");
+ row.addComponent(button);
+
NativeButton nbutton = new NativeButton("Native");
row.addComponent(nbutton);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java b/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java
index 1b8b290d91..98a9cad83c 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java
@@ -162,6 +162,22 @@ public class ComboBoxes extends VerticalLayout implements View {
combo.addItem("Option Three");
combo.addStyleName("borderless");
row.addComponent(combo);
+
+ combo = new ComboBox("Tiny");
+ combo.setInputPrompt("You can type here");
+ combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false));
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
+ combo.addStyleName("tiny");
+ row.addComponent(combo);
+
+ combo = new ComboBox("Huge");
+ combo.setInputPrompt("You can type here");
+ combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false));
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
+ combo.addStyleName("huge");
+ row.addComponent(combo);
}
@Override
diff --git a/uitest/src/com/vaadin/tests/themes/valo/DateFields.java b/uitest/src/com/vaadin/tests/themes/valo/DateFields.java
index 41aa287f9f..7738b2d6db 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/DateFields.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/DateFields.java
@@ -172,6 +172,18 @@ public class DateFields extends VerticalLayout implements View {
date.setDateFormat("E dd/MM/yyyy");
row.addComponent(date);
+ date = new DateField("Tiny");
+ setDate(date);
+ date.setResolution(Resolution.DAY);
+ date.addStyleName("tiny");
+ row.addComponent(date);
+
+ date = new DateField("Huge");
+ setDate(date);
+ date.setResolution(Resolution.DAY);
+ date.addStyleName("huge");
+ row.addComponent(date);
+
date = new InlineDateField("Date picker");
setDate(date);
row.addComponent(date);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Forms.java b/uitest/src/com/vaadin/tests/themes/valo/Forms.java
index c5b08902be..90a6c51496 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Forms.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Forms.java
@@ -59,6 +59,7 @@ public class Forms extends VerticalLayout implements View {
Label section = new Label("Personal Info");
section.addStyleName("h2");
+ section.addStyleName("colored");
form.addComponent(section);
StringGenerator sg = new StringGenerator();
@@ -85,6 +86,7 @@ public class Forms extends VerticalLayout implements View {
section = new Label("Contact Info");
section.addStyleName("h3");
+ section.addStyleName("colored");
form.addComponent(section);
TextField email = new TextField("Email");
@@ -125,6 +127,7 @@ public class Forms extends VerticalLayout implements View {
section = new Label("Additional Info");
section.addStyleName("h4");
+ section.addStyleName("colored");
form.addComponent(section);
TextField website = new TextField("Website");
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Labels.java b/uitest/src/com/vaadin/tests/themes/valo/Labels.java
index 08378ad9e6..b5bab3a1d3 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Labels.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Labels.java
@@ -45,6 +45,10 @@ public class Labels extends VerticalLayout implements View {
left.setMargin(new MarginInfo(false, true, false, false));
split.addComponent(left);
+ Label huge = new Label("Huge type for display text.");
+ huge.addStyleName("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.addStyleName("large");
@@ -68,6 +72,10 @@ public class Labels extends VerticalLayout implements View {
small.addStyleName("small");
left.addComponent(small);
+ Label tiny = new Label("Tiny type for minor text.");
+ tiny.addStyleName("tiny");
+ left.addComponent(tiny);
+
Label h4 = new Label("Section Title");
h4.addStyleName("h4");
left.addComponent(h4);
@@ -94,6 +102,11 @@ public class Labels extends VerticalLayout implements View {
label.addStyleName("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.addStyleName("colored");
+ right.addComponent(label);
+
label = new Label("A label for success");
label.addStyleName("success");
right.addComponent(label);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/MenuBars.java b/uitest/src/com/vaadin/tests/themes/valo/MenuBars.java
index 88eea73513..4a0130931e 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/MenuBars.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/MenuBars.java
@@ -18,6 +18,7 @@ package com.vaadin.tests.themes.valo;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.server.FontAwesome;
+import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.Command;
@@ -53,6 +54,62 @@ public class MenuBars extends VerticalLayout implements View {
menuBar.addStyleName("borderless");
menuBar.addStyleName("small");
addComponent(menuBar);
+
+ Label h2 = new Label("Drop Down Button");
+ h2.addStyleName("h2");
+ addComponent(h2);
+
+ HorizontalLayout wrap = new HorizontalLayout();
+ wrap.addStyleName("wrapping");
+ wrap.setSpacing(true);
+ addComponent(wrap);
+
+ wrap.addComponent(getMenuButton("Normal", false));
+
+ MenuBar split = getMenuButton("Small", false);
+ split.addStyleName("small");
+ wrap.addComponent(split);
+
+ split = getMenuButton("Borderless", false);
+ split.addStyleName("borderless");
+ wrap.addComponent(split);
+
+ split = getMenuButton("Themed", false);
+ split.addStyleName("color1");
+ wrap.addComponent(split);
+
+ split = getMenuButton("Small", false);
+ split.addStyleName("color1");
+ split.addStyleName("small");
+ wrap.addComponent(split);
+
+ h2 = new Label("Split Button");
+ h2.addStyleName("h2");
+ addComponent(h2);
+
+ wrap = new HorizontalLayout();
+ wrap.addStyleName("wrapping");
+ wrap.setSpacing(true);
+ addComponent(wrap);
+
+ wrap.addComponent(getMenuButton("Normal", true));
+
+ split = getMenuButton("Small", true);
+ split.addStyleName("small");
+ wrap.addComponent(split);
+
+ split = getMenuButton("Borderless", true);
+ split.addStyleName("borderless");
+ wrap.addComponent(split);
+
+ split = getMenuButton("Themed", true);
+ split.addStyleName("color1");
+ wrap.addComponent(split);
+
+ split = getMenuButton("Small", true);
+ split.addStyleName("color1");
+ split.addStyleName("small");
+ wrap.addComponent(split);
}
static MenuBar getMenuBar() {
@@ -180,6 +237,20 @@ public class MenuBars extends VerticalLayout implements View {
return menubar;
}
+ static MenuBar getMenuButton(String caption, boolean splitButton) {
+ MenuBar split = new MenuBar();
+ MenuBar.MenuItem dropdown = split.addItem(caption, null);
+ if (splitButton) {
+ dropdown = split.addItem("", null);
+ }
+ dropdown.addItem("Another Action", null);
+ dropdown.addItem("Secondary Action", null);
+ dropdown.addSeparator();
+ dropdown.addItem("Last Action", null);
+
+ return split;
+ }
+
@Override
public void enter(ViewChangeEvent event) {
// TODO Auto-generated method stub
diff --git a/uitest/src/com/vaadin/tests/themes/valo/TextFields.java b/uitest/src/com/vaadin/tests/themes/valo/TextFields.java
index f8606bb7c9..347a683673 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/TextFields.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/TextFields.java
@@ -182,6 +182,16 @@ public class TextFields extends VerticalLayout implements View {
pwf.setIcon(FontAwesome.LOCK);
row.addComponent(pwf);
+ tf = new TextField("Tiny");
+ tf.setValue("Field value");
+ tf.addStyleName("tiny");
+ row.addComponent(tf);
+
+ tf = new TextField("Huge");
+ tf.setValue("Field value");
+ tf.addStyleName("huge");
+ row.addComponent(tf);
+
h1 = new Label("Text Areas");
h1.addStyleName("h1");
addComponent(h1);
@@ -242,6 +252,16 @@ public class TextFields extends VerticalLayout implements View {
ta.setValue("Field value, spanning multiple lines of text");
row.addComponent(ta);
+ ta = new TextArea("Tiny");
+ ta.addStyleName("tiny");
+ ta.setInputPrompt("Write your comment…");
+ row.addComponent(ta);
+
+ ta = new TextArea("Huge");
+ ta.addStyleName("huge");
+ ta.setInputPrompt("Write your comment…");
+ row.addComponent(ta);
+
RichTextArea rta = new RichTextArea();
rta.setValue("<b>Some</b> <i>rich</i> content");
row.addComponent(rta);