Browse Source

Convert UndefinedHeightSubWindowAndContent test to TB4

The shadow artifacts seen with TB2 seem to be a TB2
timing issue and are not reproducible manually or with TB4,
so simply checking window size.

Change-Id: Iaf2a546868c3bc7fc9942355cc99a7452039e1f4
tags/7.6.0.alpha3
Henri Sara 9 years ago
parent
commit
6c89525423

+ 34
- 0
uitest/src/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContentTest.java View File

@@ -0,0 +1,34 @@
package com.vaadin.tests.components.window;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.Keys;

import com.vaadin.testbench.elements.TextFieldElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
import com.vaadin.tests.tb3.newelements.WindowElement;

public class UndefinedHeightSubWindowAndContentTest extends MultiBrowserTest {

@Test
public void testUndefinedHeight() {
openTestURL();

TextFieldElement textField = $(TextFieldElement.class).first();

textField.click();
textField.sendKeys("invalid", Keys.ENTER);

WindowElement window = $(WindowElement.class).first();
int height = window.getSize().getHeight();
Assert.assertTrue("Window height with validation failure",
161 <= height && height <= 164);

textField.setValue("valid");
textField.sendKeys(Keys.ENTER);
height = window.getSize().getHeight();
Assert.assertTrue("Window height with validation success",
136 <= height && height <= 139);
}

}

+ 0
- 57
uitest/tb2/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContent.html View File

@@ -1,57 +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>UndefinedHeightSubWindowAndContent</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">UndefinedHeightSubWindowAndContent</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/run/com.vaadin.tests.components.window.UndefinedHeightSubWindowAndContent?restartApplication</td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentswindowUndefinedHeightSubWindowAndContent::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
<td>52,11</td>
</tr>
<tr>
<td>enterCharacter</td>
<td>vaadin=runcomvaadintestscomponentswindowUndefinedHeightSubWindowAndContent::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
<td>invalid</td>
</tr>
<tr>
<td>pressSpecialKey</td>
<td>vaadin=runcomvaadintestscomponentswindowUndefinedHeightSubWindowAndContent::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
<td>enter</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>form_full_width_1_error</td>
</tr>
<tr>
<td>enterCharacter</td>
<td>vaadin=runcomvaadintestscomponentswindowUndefinedHeightSubWindowAndContent::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
<td>valid</td>
</tr>
<tr>
<td>pressSpecialKey</td>
<td>vaadin=runcomvaadintestscomponentswindowUndefinedHeightSubWindowAndContent::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
<td>enter</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>form_full_width_2_valid</td>
</tr>

</tbody></table>
</body>
</html>

Loading…
Cancel
Save