Browse Source

Fixed broken tests

* Added missing screenshot identifiers
* Removed redundant test
* DebugConsole -> DebugWindow
* Updated test to show why serialization fails
* Fixed problems caused by added maximize button

Change-Id: I5cf76fec7170747120b7243f9693851cd52c12af
tags/7.1.0.beta1
Artur Signell 11 years ago
parent
commit
8a2e8ff43e

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest1000x600px.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest100percentXundefined.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest100x100percent.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest300pxXundefined.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 0
- 41
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestSizeFull.html View File

@@ -1,41 +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>sizeTestSizeFull</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">sizeTestSizeFull</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/run/com.vaadin.tests.components.calendar.CalendarTest?testBench&amp;restartApplication</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VGridLayout[0]/VHorizontalLayout[1]/Slot[1]/VLabel[0]</td>
<td>Jan 2000</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VGridLayout[0]/VCalendar[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]</td>
<td>9,56</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestUndefinedX100percent.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestUndefinedX300px.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 2
- 2
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestUndefinedXUndefined.html View File

@@ -24,7 +24,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>month</td>
</tr>
<tr>
<td>mouseClick</td>
@@ -34,7 +34,7 @@
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
<td>week</td>
</tr>
</tbody></table>
</body>

+ 2
- 2
uitest/src/com/vaadin/tests/components/ui/UIInitException.html View File

@@ -17,9 +17,9 @@
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//html/body/div/pre</td>
<td>assertTextPresent</td>
<td>Catch me if you can</td>
<td></td>
</tr>
</tbody></table>
</body>

+ 32
- 24
uitest/src/com/vaadin/tests/components/ui/UISerialization.java View File

@@ -20,15 +20,19 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.Date;

import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;

public class UISerialization extends AbstractTestUI {

@@ -42,21 +46,29 @@ public class UISerialization extends AbstractTestUI {
@Override
public void buttonClick(ClickEvent event) {
Date d = new Date();
byte[] result = serialize(UISerialization.this);
long elapsed = new Date().getTime() - d.getTime();
log.log("Serialized UI in " + elapsed + "ms into "
+ result.length + " bytes");
Object diffStateBefore = getConnectorTracker().getDiffState(
UISerialization.this);
UISerialization app = (UISerialization) deserialize(result);
log.log("Deserialized UI in " + elapsed + "ms");
Object diffStateAfter = getConnectorTracker().getDiffState(
UISerialization.this);
if (diffStateBefore.equals(diffStateAfter)) {
log.log("Diff states match, size: "
+ diffStateBefore.toString().length());
} else {
log.log("Diff states do not match");
try {
byte[] result = serialize(UISerialization.this);
long elapsed = new Date().getTime() - d.getTime();
log.log("Serialized UI in " + elapsed + "ms into "
+ result.length + " bytes");
Object diffStateBefore = getConnectorTracker()
.getDiffState(UISerialization.this);
UISerialization app = (UISerialization) deserialize(result);
log.log("Deserialized UI in " + elapsed + "ms");
Object diffStateAfter = getConnectorTracker().getDiffState(
UISerialization.this);
if (diffStateBefore.equals(diffStateAfter)) {
log.log("Diff states match, size: "
+ diffStateBefore.toString().length());
} else {
log.log("Diff states do not match");
}
} catch (Exception e) {
log.log("Exception caught: " + e.getMessage());
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
addComponent(new Label(sw.toString(),
ContentMode.PREFORMATTED));
}

}
@@ -64,20 +76,16 @@ public class UISerialization extends AbstractTestUI {
}

protected void serializeInstance(Class<?> cls)
throws InstantiationException, IllegalAccessException {
throws InstantiationException, IllegalAccessException, IOException {
serialize((Serializable) cls.newInstance());
}

protected byte[] serialize(Serializable serializable) {
protected byte[] serialize(Serializable serializable) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ObjectOutputStream oos;
try {
oos = new ObjectOutputStream(os);
oos.writeObject(serializable);
return os.toByteArray();
} catch (IOException e) {
throw new RuntimeException("Serialization failed", e);
}
oos = new ObjectOutputStream(os);
oos.writeObject(serializable);
return os.toByteArray();
}

protected Object deserialize(byte[] result) {

+ 1
- 6
uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html View File

@@ -16,11 +16,6 @@
<td>/run/com.vaadin.tests.components.window.CloseSubWindow?restartApplication</td>
<td></td>
</tr>
<tr>
<td>waitForVaadin</td>
<td></td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopensub/domChild[0]/domChild[0]</td>
@@ -45,7 +40,7 @@
<!--Click close in title bar-->
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td>
<td></td>
</tr>
<tr>

+ 1
- 1
uitest/src/com/vaadin/tests/components/window/CloseSubWindow.java View File

@@ -33,7 +33,7 @@ public class CloseSubWindow extends TestBase {
private Window createClosableSubWindow(final String title) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSizeFull();
layout.setSizeUndefined();
final Window window = new Window(title, layout);
window.setSizeUndefined();
window.setClosable(true);

+ 3
- 3
uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html View File

@@ -90,7 +90,7 @@
<!--Close window 4, which is the topmost window-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[2]</td>
<td>11,15</td>
</tr>
<tr>
@@ -101,7 +101,7 @@
<!--Close Dialog 3 (topmost)-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td>
<td>6,8</td>
</tr>
<!--Make Dialog 5 (topmost) non-modal-->
@@ -139,7 +139,7 @@
<!--Close dialog 5-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td>
<td>10,5</td>
</tr>
<tr>

+ 1
- 1
uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html View File

@@ -170,7 +170,7 @@
</tr>
<tr>
<td>screenCapture</td>
<td>window-2-original-pos-window-1-centered</td>
<td>window-2-original-pos-window-1-centered-again</td>
<td></td>
</tr>
<tr>

+ 1
- 1
uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html View File

@@ -18,7 +18,7 @@
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td>
<td>6,7</td>
</tr>
<tr>

+ 8
- 8
uitest/src/com/vaadin/tests/debug/DebugWindowPresent.html View File

@@ -28,7 +28,7 @@
</tr>
<tr>
<td>assertElementPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -38,7 +38,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -48,7 +48,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -58,7 +58,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -68,7 +68,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -78,7 +78,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -88,7 +88,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
<tr>
@@ -98,7 +98,7 @@
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
<td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
<td></td>
</tr>
</tbody></table>

+ 6
- 1
uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html View File

@@ -53,7 +53,12 @@
</tr>
<tr>
<td>assertTextPresent</td>
<td>/APP can not be found</td>
<td>HTTP ERROR 404</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Problem accessing /run/APP/</td>
<td></td>
</tr>
<tr>

Loading…
Cancel
Save