diff options
author | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-03-20 12:46:46 +0000 |
---|---|---|
committer | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-03-20 12:46:46 +0000 |
commit | 13e8d50ee4e32026572b6913eb27554ca763eaba (patch) | |
tree | f9fdd5a0546fb76d3d50cb51f208594b6995948f /tests/testbench | |
parent | 34ec44230f5b79f860a53a1d10b20a7038646319 (diff) | |
download | vaadin-framework-13e8d50ee4e32026572b6913eb27554ca763eaba.tar.gz vaadin-framework-13e8d50ee4e32026572b6913eb27554ca763eaba.zip |
Test for #6085 - use assertHtmlSource instead of assertText because IE hides the alt text in an altHtml="..." property
svn changeset:23269/svn branch:6.8
Diffstat (limited to 'tests/testbench')
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.html | 47 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java | 48 |
2 files changed, 95 insertions, 0 deletions
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 index 0000000000..066c55fe55 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.html @@ -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 index 0000000000..f8874810fc --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java @@ -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); + } +} |