diff options
author | Artur Signell <artur@vaadin.com> | 2013-09-16 14:44:43 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-09-25 11:22:28 +0000 |
commit | a2daf65958c602dd02099bf4415e7e432b706dc7 (patch) | |
tree | 357c599a8249f887fa8a4da62e780c8c6cc7576a /uitest/src/com/vaadin/tests/components/ui | |
parent | 1df28c314141d7531591ff9c5ee1ab3521f29e8c (diff) | |
download | vaadin-framework-a2daf65958c602dd02099bf4415e7e432b706dc7.tar.gz vaadin-framework-a2daf65958c602dd02099bf4415e7e432b706dc7.zip |
Converted TB2 push tests to TB3 (#12580)
Change-Id: Ifd6286aee75946eb47c39886c08473a5a0c10545
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/ui')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/UIAccess.java (renamed from uitest/src/com/vaadin/tests/components/ui/UiAccess.java) | 33 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/UiAccessPush.html | 41 |
2 files changed, 32 insertions, 42 deletions
diff --git a/uitest/src/com/vaadin/tests/components/ui/UiAccess.java b/uitest/src/com/vaadin/tests/components/ui/UIAccess.java index 09f2fd8816..057dcaa917 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UiAccess.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccess.java @@ -21,17 +21,48 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.locks.ReentrantLock; +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; + import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinService; import com.vaadin.server.VaadinSession; import com.vaadin.shared.communication.PushMode; import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.tests.tb3.MultiBrowserTest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.UI; import com.vaadin.util.CurrentInstance; -public class UiAccess extends AbstractTestUIWithLog { +public class UIAccess extends AbstractTestUIWithLog { + + public static class UIAccessTest extends MultiBrowserTest { + @Override + protected boolean isPushEnabled() { + return true; + } + + @Test + public void testThreadLocals() { + getCurrentInstanceWhenPushingButton().click(); + waitUntil(ExpectedConditions.textToBePresentInElement( + vaadinLocatorById("Log_row_0"), "1.")); + Assert.assertEquals( + "0. Current UI matches in beforeResponse? true", + vaadinElementById("Log_row_1").getText()); + Assert.assertEquals( + "1. Current session matches in beforeResponse? true", + vaadinElementById("Log_row_0").getText()); + + } + + private WebElement getCurrentInstanceWhenPushingButton() { + return vaadinElement("/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[7]/VButton[0]"); + } + } private volatile boolean checkCurrentInstancesBeforeResponse = false; diff --git a/uitest/src/com/vaadin/tests/components/ui/UiAccessPush.html b/uitest/src/com/vaadin/tests/components/ui/UiAccessPush.html deleted file mode 100644 index bc29534ee4..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/UiAccessPush.html +++ /dev/null @@ -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>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.ui.UiAccess?restartApplication&transport=websocket</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsuiUiAccess::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[7]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>waitForNotText</td> - <td>vaadin=runcomvaadintestscomponentsuiUiAccess::PID_SLog_row_0</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsuiUiAccess::PID_SLog_row_0</td> - <td>exact:1. Current session matches in beforeResponse? true</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsuiUiAccess::PID_SLog_row_1</td> - <td>exact:0. Current UI matches in beforeResponse? true</td> -</tr> -</tbody></table> -</body> -</html> |