diff options
author | Sergey Budkin <sergey@vaadin.com> | 2014-11-25 19:35:13 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-12-10 08:47:51 +0000 |
commit | e1b335022ec359061e696cf2711327663267e704 (patch) | |
tree | 5bf6ac10be445694123d492d72d92e2fe45b9cb7 /uitest/src/com | |
parent | 8ce89592362226d6687e1267632a75d85774b67d (diff) | |
download | vaadin-framework-e1b335022ec359061e696cf2711327663267e704.tar.gz vaadin-framework-e1b335022ec359061e696cf2711327663267e704.zip |
Long events aren't displayed properly when using Container (#15242)
Rewrote event selection.
Change-Id: I8f0dd1c5ec736ea14037619b1656a79b7e3532be
Diffstat (limited to 'uitest/src/com')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerLongEventTest.java | 55 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java | 8 |
2 files changed, 63 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerLongEventTest.java b/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerLongEventTest.java new file mode 100644 index 0000000000..0ec196f266 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerLongEventTest.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.components.calendar; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests if long event which began before the view period is shown (#15242) + */ +public class BeanItemContainerLongEventTest extends MultiBrowserTest { + + @Override + protected String getDeploymentPath() { + return "/run/BeanItemContainerTestUI?restartApplication"; + } + + @Test + public void testEventDisplayedInWeekView() { + openTestURL(); + WebElement target = driver.findElements( + By.className("v-calendar-week-number")).get(1); + target.click(); + target = driver.findElement(By.className("v-calendar-event")); + Assert.assertEquals("Wrong event name", "Long event", target.getText()); + } + + @Test + public void testEventDisplayedInDayView() { + openTestURL(); + WebElement target = driver.findElements( + By.className("v-calendar-day-number")).get(5); + target.click(); + target = driver.findElement(By.className("v-calendar-event")); + Assert.assertEquals("Wrong event name", "Long event", target.getText()); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java b/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java index 83fc4a03cb..bda3b34875 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java +++ b/uitest/src/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java @@ -17,6 +17,7 @@ package com.vaadin.tests.components.calendar; import java.util.Arrays; import java.util.Date; +import java.util.GregorianCalendar; import com.vaadin.data.fieldgroup.FieldGroup; import com.vaadin.data.fieldgroup.FieldGroup.CommitException; @@ -69,6 +70,13 @@ public class BeanItemContainerTestUI extends UI { table.setVisibleColumns(new Object[] { "caption", "description", "start", "end" }); content.addComponent(table); + + BasicEvent longEvent = new BasicEvent(); + longEvent.setCaption("Long event"); + longEvent.setAllDay(true); + longEvent.setStart(new GregorianCalendar(2000, 1, 3).getTime()); + longEvent.setEnd(new GregorianCalendar(2000, 2, 5).getTime()); + events.addBean(longEvent); } /** |