[orca] New regression test.
- From: Joanmarie Diggs <joanied src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca] New regression test.
- Date: Sun, 12 Jul 2009 14:29:11 +0000 (UTC)
commit 73ebf8f5b6e3f23bbc37c1a98f4a2f37cbb31a8e
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Sun Jul 12 10:25:50 2009 -0400
New regression test.
test/html/images-in-links.html | 34 +++++
test/keystrokes/firefox/images_in_links.py | 219 ++++++++++++++++++++++++++++
2 files changed, 253 insertions(+), 0 deletions(-)
---
diff --git a/test/html/images-in-links.html b/test/html/images-in-links.html
new file mode 100644
index 0000000..da3f42c
--- /dev/null
+++ b/test/html/images-in-links.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<title>Test</title>
+</head>
+<body>
+<p>
+One image with alt text in a link: <a href="foo"><img src=orca-for-tests.jpg alt="Orca logo" /></a>
+</p>
+<p>
+One image with title attribute in a link: <a href="foo"><img src=orca-for-tests.jpg title="Orca logo showing a whale holding a white cane"/></a>
+</p>
+<p>
+One image with both alt text and title attribute in a link: <a href="foo"><img src=orca-for-tests.jpg alt="Orca logo" title="Orca logo showing a whale holding a white cane"/></a>
+</p>
+<p>
+One "useless" image in a link: <a href="foo"><img src=orca-for-tests.jpg /></a>
+</p>
+<p>
+Two "useless" images in a link: <a href="foo"><img src=orca-for-tests.jpg /><img src=orca-for-tests.jpg /></a>
+</p>
+<p>
+Two "useless" images in a paragraph that is inside of a link: <a href="foo"><p><img src=orca-for-tests.jpg /><img src=orca-for-tests.jpg /></p></a>
+</p>
+<p>
+One "useless" image and one "useful" image in a link: <a href="foo"><img src=orca-for-tests.jpg alt="Orca logo" /><img src=orca-for-tests.jpg /></a>
+</p>
+<p>
+Two "useless" images along with some text in a link: <a href="foo"><img src=orca-for-tests.jpg />silly link<img src=orca-for-tests.jpg /></a>
+</p>
+<p>
+Two "useless" images in a paragraph that is inside of a link along with text that is not in the paragraph: <a href="foo">Before the paragraph<p><img src=orca-for-tests.jpg /><img src=orca-for-tests.jpg /></p>After the paragraph</a>
+</p>
+</body>
+</html>
diff --git a/test/keystrokes/firefox/images_in_links.py b/test/keystrokes/firefox/images_in_links.py
new file mode 100644
index 0000000..9ec0df6
--- /dev/null
+++ b/test/keystrokes/firefox/images_in_links.py
@@ -0,0 +1,219 @@
+#!/usr/bin/python
+
+"""Test of line navigation output of Firefox with links that contain
+images.
+"""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+########################################################################
+# We wait for the focus to be on a blank Firefox window.
+#
+sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))
+
+########################################################################
+# Load the local "backwards" test case.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction(utils.htmlURLPrefix + "images-in-links.html"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+sequence.append(WaitForFocus("Test",
+ acc_role=pyatspi.ROLE_DOCUMENT_FRAME))
+
+########################################################################
+# Press Control+Home to move to the top.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Home"))
+sequence.append(utils.AssertPresentationAction(
+ "Top of file",
+ ["BRAILLE LINE: 'One image with alt text in a link: Orca logo Image'",
+ " VISIBLE: 'One image with alt text in a lin', cursor=1",
+ "SPEECH OUTPUT: 'One image with alt text in a link: Orca logo link image'"]))
+
+########################################################################
+# Down Arrow to the End.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "1. line Down",
+ ["BRAILLE LINE: 'One image with title attribute in a link: Orca logo showing a whale holding a white cane Image'",
+ " VISIBLE: 'One image with title attribute i', cursor=1",
+ "SPEECH OUTPUT: 'One image with title attribute in a link: Orca logo showing a whale holding a white cane link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "2. line Down",
+ ["BRAILLE LINE: 'One image with both alt text and title attribute in a link: Orca logo Image'",
+ " VISIBLE: 'One image with both alt text and', cursor=1",
+ "SPEECH OUTPUT: 'One image with both alt text and title attribute in a link: Orca logo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "3. line Down",
+ ["BRAILLE LINE: 'One \"useless\" image in a link: foo Image'",
+ " VISIBLE: 'One \"useless\" image in a link: f', cursor=1",
+ "SPEECH OUTPUT: 'One \"useless\" image in a link: foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "4. line Down",
+ ["BRAILLE LINE: 'Two \"useless\" images in a link: foo Image foo Image'",
+ " VISIBLE: 'Two \"useless\" images in a link: ', cursor=1",
+ "SPEECH OUTPUT: 'Two \"useless\" images in a link: foo link image foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "5. line Down",
+ ["BRAILLE LINE: 'Two \"useless\" images in a paragraph that is inside of a link: foo Image foo Image'",
+ " VISIBLE: 'Two \"useless\" images in a paragr', cursor=1",
+ "SPEECH OUTPUT: 'Two \"useless\" images in a paragraph that is inside of a link: foo link image foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "6. line Down",
+ ["BRAILLE LINE: 'One \"useless\" image and one \"useful\" image in a link: Orca logo Image foo Image'",
+ " VISIBLE: 'One \"useless\" image and one \"use', cursor=1",
+ "SPEECH OUTPUT: 'One \"useless\" image and one \"useful\" image in a link: Orca logo link image foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "7. line Down",
+ ["BRAILLE LINE: 'Two \"useless\" images along with some text in a link: foo Image silly link foo Image'",
+ " VISIBLE: 'Two \"useless\" images along with ', cursor=1",
+ "SPEECH OUTPUT: 'Two \"useless\" images along with some text in a link: foo link image silly link link image foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "8. line Down",
+ ["BRAILLE LINE: 'Two \"useless\" images in a paragraph that is inside of a link along with text that is not in the paragraph: Before the paragraph'",
+ " VISIBLE: 'Two \"useless\" images in a paragr', cursor=1",
+ "SPEECH OUTPUT: 'Two \"useless\" images in a paragraph that is inside of a link along with text that is not in the paragraph: Before the paragraph link'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "9. line Down",
+ ["BRAILLE LINE: 'foo Image foo Image'",
+ " VISIBLE: 'foo Image foo Image', cursor=1",
+ "SPEECH OUTPUT: 'foo link image foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "10. line Down",
+ ["BRAILLE LINE: 'After the paragraph'",
+ " VISIBLE: 'After the paragraph', cursor=1",
+ "SPEECH OUTPUT: 'After the paragraph link'"]))
+
+########################################################################
+# Shift+Tab to give focus to each link.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "1. Shift+Tab",
+ ["BRAILLE LINE: 'foo Image'",
+ " VISIBLE: 'foo Image', cursor=1",
+ "SPEECH OUTPUT: 'silly link link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "2. Shift+Tab",
+ ["BRAILLE LINE: 'Orca logo Image foo Image'",
+ " VISIBLE: 'Orca logo Image foo Image', cursor=1",
+ "SPEECH OUTPUT: 'Orca logo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "3. Shift+Tab",
+ ["BRAILLE LINE: 'foo Image foo Image'",
+ " VISIBLE: 'foo Image foo Image', cursor=1",
+ "SPEECH OUTPUT: 'foo link'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "4. Shift+Tab",
+ ["BRAILLE LINE: 'foo Image foo Image'",
+ " VISIBLE: 'foo Image foo Image', cursor=1",
+ "SPEECH OUTPUT: 'foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "5. Shift+Tab",
+ ["BRAILLE LINE: 'foo Image'",
+ " VISIBLE: 'foo Image', cursor=1",
+ "SPEECH OUTPUT: 'foo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "6. Shift+Tab",
+ ["BRAILLE LINE: 'Orca logo Image'",
+ " VISIBLE: 'Orca logo Image', cursor=1",
+ "SPEECH OUTPUT: 'Orca logo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "7. Shift+Tab",
+ ["BRAILLE LINE: 'Orca logo showing a whale holding a white cane Image'",
+ " VISIBLE: 'Orca logo showing a whale holdin', cursor=1",
+ "SPEECH OUTPUT: 'Orca logo showing a whale holding a white cane link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "8. Shift+Tab",
+ ["BRAILLE LINE: 'Orca logo Image'",
+ " VISIBLE: 'Orca logo Image', cursor=1",
+ "SPEECH OUTPUT: 'Orca logo link image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Shift>Tab"))
+sequence.append(utils.AssertPresentationAction(
+ "9. Shift+Tab",
+ ["BRAILLE LINE: 'Orca logo Image'",
+ " VISIBLE: 'Orca logo Image', cursor=1",
+ "SPEECH OUTPUT: 'Orca logo link image'"]))
+
+########################################################################
+# Move to the location bar by pressing Control+L. When it has focus
+# type "about:blank" and press Return to restore the browser to the
+# conditions at the test's start.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction("about:blank"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+# Just a little extra wait to let some events get through.
+#
+sequence.append(PauseAction(3000))
+
+sequence.append(utils.AssertionSummaryAction())
+
+sequence.start()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]