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
=== modified file 'ubuntu_autopilot_tests/gedit/test_gedit.py'
--- ubuntu_autopilot_tests/gedit/test_gedit.py 2013-03-14 21:56:54 +0000
+++ ubuntu_autopilot_tests/gedit/test_gedit.py 2013-05-29 19:43:25 +0000
@@ -1,18 +1,18 @@
1from autopilot.testcase import AutopilotTestCase1from autopilot.testcase import AutopilotTestCase
2from autopilot.introspection.gtk import GtkIntrospectionTestMixin
3from autopilot.matchers import Eventually2from autopilot.matchers import Eventually
4from testtools.matchers import Equals, NotEquals, Contains3from testtools.matchers import Equals, NotEquals, Contains
4from autopilot.process import ProcessManager
5
5from time import sleep6from time import sleep
6import tempfile7import tempfile
7import os8import os
89
910
10class GtkToolbarTests(AutopilotTestCase, GtkIntrospectionTestMixin):11class GeditTests(AutopilotTestCase):
1112
12 def setUp(self):13 def setUp(self):
13 super(GtkToolbarTests, self).setUp()14 super(GeditTests, self).setUp()
14 self.app = self.launch_test_application('gedit')15 self.app = self.launch_test_application("gedit")
15
1616
17 def test_save_and_open_a_file(self):17 def test_save_and_open_a_file(self):
18 #Test-case name: gedit/ged-00118 #Test-case name: gedit/ged-001
@@ -49,7 +49,7 @@
49 self.assertThat(lambda: len(documents), Eventually(Equals(0)))49 self.assertThat(lambda: len(documents), Eventually(Equals(0)))
5050
51 #Open the file we made51 #Open the file we made
52 btn = self.app.select_single('GtkMenuToolButton', label='Open')52 btn = self.app.select_single('GeditOpenToolButton', label='Open')
53 self.assertThat(btn, NotEquals(None))53 self.assertThat(btn, NotEquals(None))
54 self.mouse.move_to_object(btn)54 self.mouse.move_to_object(btn)
55 self.mouse.click()55 self.mouse.click()
@@ -118,9 +118,14 @@
118 self.addCleanup(os.remove, tempFile)118 self.addCleanup(os.remove, tempFile)
119119
120 def test_recent_documents(self):120 def test_recent_documents(self):
121 #GtkImageMenuitem tooltip_text Open '/tmp/'121 #GeditOpenToolButton tooltip_text Open '/tmp/'
122 tooltip = self.app.select_single('GtkImageMenuitem', label='_Open')122 recentBtn = self.app.select_single('GeditOpenToolButton', label='Open')
123123 self.assertThat(recentBtn, NotEquals(None))
124 self.mouse.move_to_object(recentBtn)
125 self.mouse.click()
126 #inserted sleep to see the recent files otherwise window closes too quicly
127 sleep(2)
128
124 def test_highlight_searched_text(self):129 def test_highlight_searched_text(self):
125 #Test-case name: gedit/ged-004130 #Test-case name: gedit/ged-004
126 #This test will check that GEdit can find and highlight searched text131 #This test will check that GEdit can find and highlight searched text
@@ -230,18 +235,21 @@
230 #test creating tab group235 #test creating tab group
231 #test moving tab group to new window236 #test moving tab group to new window
232237
233 def test_insert_overwrite_mode(self):238 #def test_insert_overwrite_mode(self):
234 #verify we are in insert mode239 #verify we are in insert mode
235 #GeditWindow GtkBox GeditStatusbar GtkLabel240 #GeditWindow GtkBox GeditStatusbar GtkLabel
236 typeMode = self.app.select_single('GtkLabel', label=' INS ')241 #typeMode = self.app.select_single('GtkLabel', label=' INS ')
237 self.assertThat(typeMode, NotEquals(None))242 #typeMode = self.app.select_many('GtkLabel', label=' INS ')
243 #self.assertThat(typeMode, NotEquals(None))
244
238245
239 #type out some words246 #type out some words
240247
241 #turn on overwrite, and press home248 #turn on overwrite, and press home
242 self.keyboard.press_and_release("Home")249 #self.keyboard.press_and_release("Home")
243 self.keyboard.press_and_release("Insert")250 #self.keyboard.press_and_release("Insert")
244 self.assertThat(typeMode.label, Equals(' OVR '))251 #self.assertThat(typeMode.label, Equals(' OVR '))
252
245253
246 #type over the first word254 #type over the first word
247 #turn on insert255 #turn on insert
@@ -286,7 +294,7 @@
286 self.assertThat(documents[orginalNumDocuments].name, Contains(str(orginalNumDocuments + 1)))294 self.assertThat(documents[orginalNumDocuments].name, Contains(str(orginalNumDocuments + 1)))
287295
288 #test open296 #test open
289 btn = self.app.select_single('GtkMenuToolButton', label='Open')297 btn = self.app.select_single('GeditOpenToolButton', label='Open')
290 self.assertThat(btn, NotEquals(None))298 self.assertThat(btn, NotEquals(None))
291299
292 #test save300 #test save

Subscribers

People subscribed via source and target branches