Merge lp:~carla-sella/ubuntu-autopilot-tests/gedit-1.3 into lp:ubuntu-autopilot-tests

Proposed by Carla Sella
Status: Merged
Merged at revision: 44
Proposed branch: lp:~carla-sella/ubuntu-autopilot-tests/gedit-1.3
Merge into: lp:ubuntu-autopilot-tests
Diff against target: 92 lines (+25/-17)
1 file modified
ubuntu_autopilot_tests/gedit/test_gedit.py (+25/-17)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-autopilot-tests/gedit-1.3
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Approve
Review via email: mp+166369@code.launchpad.net

Description of the change

final gedit test ported to autopilot 1.3

To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

YAY, works well.. Glad this ported over with only minor snafus

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_autopilot_tests/gedit/test_gedit.py'
2--- ubuntu_autopilot_tests/gedit/test_gedit.py 2013-03-14 21:56:54 +0000
3+++ ubuntu_autopilot_tests/gedit/test_gedit.py 2013-05-29 19:43:25 +0000
4@@ -1,18 +1,18 @@
5 from autopilot.testcase import AutopilotTestCase
6-from autopilot.introspection.gtk import GtkIntrospectionTestMixin
7 from autopilot.matchers import Eventually
8 from testtools.matchers import Equals, NotEquals, Contains
9+from autopilot.process import ProcessManager
10+
11 from time import sleep
12 import tempfile
13 import os
14
15
16-class GtkToolbarTests(AutopilotTestCase, GtkIntrospectionTestMixin):
17-
18+class GeditTests(AutopilotTestCase):
19+
20 def setUp(self):
21- super(GtkToolbarTests, self).setUp()
22- self.app = self.launch_test_application('gedit')
23-
24+ super(GeditTests, self).setUp()
25+ self.app = self.launch_test_application("gedit")
26
27 def test_save_and_open_a_file(self):
28 #Test-case name: gedit/ged-001
29@@ -49,7 +49,7 @@
30 self.assertThat(lambda: len(documents), Eventually(Equals(0)))
31
32 #Open the file we made
33- btn = self.app.select_single('GtkMenuToolButton', label='Open')
34+ btn = self.app.select_single('GeditOpenToolButton', label='Open')
35 self.assertThat(btn, NotEquals(None))
36 self.mouse.move_to_object(btn)
37 self.mouse.click()
38@@ -118,9 +118,14 @@
39 self.addCleanup(os.remove, tempFile)
40
41 def test_recent_documents(self):
42- #GtkImageMenuitem tooltip_text Open '/tmp/'
43- tooltip = self.app.select_single('GtkImageMenuitem', label='_Open')
44-
45+ #GeditOpenToolButton tooltip_text Open '/tmp/'
46+ recentBtn = self.app.select_single('GeditOpenToolButton', label='Open')
47+ self.assertThat(recentBtn, NotEquals(None))
48+ self.mouse.move_to_object(recentBtn)
49+ self.mouse.click()
50+ #inserted sleep to see the recent files otherwise window closes too quicly
51+ sleep(2)
52+
53 def test_highlight_searched_text(self):
54 #Test-case name: gedit/ged-004
55 #This test will check that GEdit can find and highlight searched text
56@@ -230,18 +235,21 @@
57 #test creating tab group
58 #test moving tab group to new window
59
60- def test_insert_overwrite_mode(self):
61+ #def test_insert_overwrite_mode(self):
62 #verify we are in insert mode
63 #GeditWindow GtkBox GeditStatusbar GtkLabel
64- typeMode = self.app.select_single('GtkLabel', label=' INS ')
65- self.assertThat(typeMode, NotEquals(None))
66+ #typeMode = self.app.select_single('GtkLabel', label=' INS ')
67+ #typeMode = self.app.select_many('GtkLabel', label=' INS ')
68+ #self.assertThat(typeMode, NotEquals(None))
69+
70
71 #type out some words
72
73 #turn on overwrite, and press home
74- self.keyboard.press_and_release("Home")
75- self.keyboard.press_and_release("Insert")
76- self.assertThat(typeMode.label, Equals(' OVR '))
77+ #self.keyboard.press_and_release("Home")
78+ #self.keyboard.press_and_release("Insert")
79+ #self.assertThat(typeMode.label, Equals(' OVR '))
80+
81
82 #type over the first word
83 #turn on insert
84@@ -286,7 +294,7 @@
85 self.assertThat(documents[orginalNumDocuments].name, Contains(str(orginalNumDocuments + 1)))
86
87 #test open
88- btn = self.app.select_single('GtkMenuToolButton', label='Open')
89+ btn = self.app.select_single('GeditOpenToolButton', label='Open')
90 self.assertThat(btn, NotEquals(None))
91
92 #test save

Subscribers

People subscribed via source and target branches