diff options
author | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-03 12:58:56 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-03 15:09:11 +0300 |
commit | ad452a36795b764aeea2b00e3ceed2bae75d7949 (patch) | |
tree | 9b522f8b93464520430d839ab1608fa372efe23a /uitest/src/com/vaadin/tests/integration | |
parent | e65231e6028892bd6847777c5bad982b73278b14 (diff) | |
parent | 44eadeaa160152616152cd33f8181d7ab1fa3359 (diff) | |
download | vaadin-framework-ad452a36795b764aeea2b00e3ceed2bae75d7949.tar.gz vaadin-framework-ad452a36795b764aeea2b00e3ceed2bae75d7949.zip |
Merge branch 'master' into valo
Conflicts:
WebContent/release-notes.html
build.properties
client/src/com/vaadin/client/ApplicationConfiguration.java
Change-Id: I36f075a03350e45c8666832142d7368891af3e59
Diffstat (limited to 'uitest/src/com/vaadin/tests/integration')
14 files changed, 184 insertions, 38 deletions
diff --git a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java index 0266a9d892..073975a509 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java index f736a126a5..941e988c5c 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,7 +18,8 @@ package com.vaadin.tests.integration; import java.io.IOException; import org.junit.Test; -import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.TableElement; /** * Base class for servlet integration tests. Automatically prepends "/demo" to @@ -33,28 +34,10 @@ public abstract class AbstractServletIntegrationTest extends public void runTest() throws IOException, AssertionError { openTestURL(); compareScreen("initial"); - - WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1)); - testBenchElement(cell).click(51, 13); - + $(TableElement.class).first().getCell(0, 1).click(); compareScreen("finland"); } - private String getTableCell(String tableLocator, int row, int col) { - return tableLocator - + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[" - + row + "]/domChild[" + col + "]/domChild[0]"; - } - - protected String getTable() { - return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]"; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath() - */ @Override protected String getDeploymentPath() { return "/demo" + super.getDeploymentPath(); diff --git a/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java index c5d6a65d87..13503966ec 100644 --- a/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ProxyTest.java b/uitest/src/com/vaadin/tests/integration/ProxyTest.java index 5b2eaa829c..887eae315d 100644 --- a/uitest/src/com/vaadin/tests/integration/ProxyTest.java +++ b/uitest/src/com/vaadin/tests/integration/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java index d6def8d69c..4c3e1beaa5 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java index 5f50cdb95d..2afc33cf82 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationDefaultPushUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java index f96000f1ce..0bcac5575d 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java index 70ca890b31..92307dbbaf 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationLongPollingUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java index 0d92fb1bb8..5d5801f0db 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java index 36a946bfa3..1f42b10e66 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationStreamingUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java index 25ffdac4a2..bebe01578a 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,4 +17,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java index d7c525f202..18e275618a 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java index f2e7a6f2d0..d4fc3aef17 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationWebsocketUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java new file mode 100644 index 0000000000..c8207efe9d --- /dev/null +++ b/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java @@ -0,0 +1,163 @@ +/* + * 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.integration; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import com.jcraft.jsch.ChannelExec; +import com.jcraft.jsch.ChannelSftp; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.JSchException; +import com.jcraft.jsch.Session; +import com.jcraft.jsch.SftpException; +import com.vaadin.tests.tb3.PrivateTB3Configuration; + +public class WebSpherePortalIntegrationTest extends PrivateTB3Configuration { + + @BeforeClass + public static void deployPortlet() throws JSchException, SftpException { + Session session = openSession(); + + uploadDemoApplication(session); + + sendCommand(session, "ant -f deploy.xml get-lock startup-and-deploy"); + + session.disconnect(); + } + + private static void uploadDemoApplication(Session session) + throws JSchException, SftpException { + ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp"); + sftpChannel.connect(); + + String applicationPath = System.getProperty("demo.war"); + if (new File(applicationPath).exists()) { + sftpChannel.put(applicationPath, "demo.war"); + sftpChannel.disconnect(); + } else { + sftpChannel.disconnect(); + throw new AssertionError("Demo application not found at " + + applicationPath); + } + } + + private static void sendCommand(Session session, String command) + throws JSchException { + ChannelExec channel = (ChannelExec) session.openChannel("exec"); + channel.setCommand(command); + BufferedReader in; + try { + in = new BufferedReader(new InputStreamReader( + channel.getInputStream())); + + channel.connect(); + + String msg = null; + + while ((msg = in.readLine()) != null) { + System.out.println(msg); + } + } catch (IOException e) { + e.printStackTrace(); + } + + channel.disconnect(); + } + + private static Session openSession() throws JSchException { + JSch jsch = new JSch(); + Session session = jsch.getSession("integration", + "websphereportal8.devnet.vaadin.com", 22); + jsch.addIdentity("~/.ssh/id_dsa"); + session.setConfig("StrictHostKeyChecking", "no"); + + session.connect(); + return session; + } + + @AfterClass + public static void teardown() throws JSchException { + Session session = openSession(); + + sendCommand(session, "ant -f deploy.xml release-lock"); + + session.disconnect(); + } + + @Override + protected java.lang.String getTestUrl() { + return "http://websphereportal8.devnet.vaadin.com:10039/wps/portal"; + } + + @Override + public void setup() throws Exception { + super.setup(); + + openTestURL(); + + if (!isLoggedIn()) { + login(); + } + + waitUntilPortletIsLoaded(); + } + + private void waitUntilPortletIsLoaded() { + WebDriverWait wait = new WebDriverWait(driver, 15); + wait.until(ExpectedConditions.visibilityOfElementLocated(By + .className("v-app"))); + } + + private boolean isLoggedIn() { + return driver.findElements(By.linkText("Log Out")).size() == 1; + } + + private void login() { + driver.findElement(By.linkText("Log In")).click(); + driver.findElement(By.id("userID")).sendKeys("test"); + driver.findElement(By.id("password")).sendKeys("testtest"); + + hitButton("login.button.login"); + } + + @Test + public void portletHasExpectedLayout() throws IOException { + compareScreen("initial"); + } + + @Test + public void viewModeIsSetToEdit() throws IOException { + driver.findElement(By.linkText("Edit")).click(); + + assertThat(driver.findElement(By.tagName("input")).isEnabled(), + is(true)); + + } + +} |