Skip to content

Commit 21214e7

Browse files
committed
Added test for show last text detection, #32
1 parent d335b5c commit 21214e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_textinator.py

+16
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,22 @@ def test_confirm_clipboard_changes_no(pb):
209209
assert click_menu_item("Confirm Clipboard Changes")
210210

211211

212+
213+
def test_show_last_text_detection(pb):
214+
"""Test Show Last Text Detection menu item works"""
215+
pb.clear()
216+
with copy_to_desktop(TEST_FILE_HELLO_WORLD) as filepath:
217+
mark_screenshot(filepath)
218+
sleep(5)
219+
with log_file() as log:
220+
assert click_menu_item("Show Last Text Detection")
221+
assert "Showing confirmation window" in log.read()
222+
assert click_window_button(1, 2) # button 1 is Yes
223+
sleep(5)
224+
assert pb.get_text() == "Hello World"
225+
assert click_menu_item("Confirm Clipboard Changes")
226+
227+
212228
def test_enable_start_on_login():
213229
"""Test Start Textinator on Login menu item works"""
214230
# setup_teardown() should have removed the login item if it existed

0 commit comments

Comments
 (0)