]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #6085 - use assertHtmlSource instead of assertText because IE hides the...
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Tue, 20 Mar 2012 12:46:46 +0000 (12:46 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Tue, 20 Mar 2012 12:46:46 +0000 (12:46 +0000)
svn changeset:23269/svn branch:6.8

tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java [new file with mode: 0644]

diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.html b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.html
new file mode 100644 (file)
index 0000000..066c55f
--- /dev/null
@@ -0,0 +1,47 @@
+<?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="http://localhost:8068" />
+<title>EmbeddedAltText</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">EmbeddedAltText</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.embedded.EmbeddedAltText?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertAttribute</td>
+       <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedAltText::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VEmbedded[0]/domChild[0]@alt</td>
+       <td>Alt text of the image</td>
+</tr>
+<tr>
+       <td>assertHtmlSource</td>
+       <td>*Alt text of the object*</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedAltText::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertAttribute</td>
+       <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedAltText::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VEmbedded[0]/domChild[0]@alt</td>
+       <td>New alt text of the image!</td>
+</tr>
+<tr>
+       <td>assertHtmlSource</td>
+       <td>*New alt text of the object!*</td>
+       <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java
new file mode 100644 (file)
index 0000000..f887481
--- /dev/null
@@ -0,0 +1,48 @@
+package com.vaadin.tests.components.embedded;
+
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.ThemeResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Embedded;
+
+public class EmbeddedAltText extends TestBase {
+    @Override
+    protected String getDescription() {
+        return "It should be possible to set an alternative text on an image or object.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 2853;
+    }
+
+    @Override
+    protected void setup() {
+        final Embedded e = new Embedded("Caption", new ThemeResource(
+                "../runo/icons/64/ok.png"));
+        e.setAlternateText("Alt text of the image");
+        addComponent(e);
+        final Embedded player = new Embedded();
+        player.setAlternateText("Alt text of the object");
+        player.setType(Embedded.TYPE_OBJECT);
+        player.setWidth("400px");
+        player.setHeight("300px");
+        player.setMimeType("application/x-shockwave-flash");
+        String url = "http://www.youtube.com/v/qQ9N742QB4g&autoplay=1";
+        player.setSource(new ExternalResource(url));
+        player.setParameter("movie", "someRandomValue");
+        player.setParameter("allowFullScreen", "true");
+        addComponent(player);
+
+        Button changeAltTexts = new Button("Change alt texts",
+                new Button.ClickListener() {
+                    public void buttonClick(ClickEvent event) {
+                        e.setAlternateText("New alt text of the image!");
+                        player.setAlternateText("New alt text of the object!");
+                    }
+                });
+        addComponent(changeAltTexts);
+    }
+}