Skip to content

Commit 388d635

Browse files
committed
FIXES: tests on 14.1.1 (Sonoma) Apple M1 Max
1 parent 581fac8 commit 388d635

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

tests/conftest.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def click_menu_item(menu_item: str, sub_menu_item: t.Optional[str] = None) -> bo
5656
"""
5757
)
5858
sub_menu_item = sub_menu_item or kMissingValue
59-
return scpt.call("click_menu_item", "Textinator", menu_item, sub_menu_item)
59+
return_value = scpt.call("click_menu_item", "Textinator", menu_item, sub_menu_item)
60+
time.sleep(5)
61+
return return_value
6062

6163

6264
def click_window_button(window: int, button: int) -> bool:

tests/test_textinator.py

-8
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,12 @@ def test_confidence(pb):
135135
pb.clear()
136136
with log_file() as log:
137137
assert click_menu_item("Text detection confidence threshold", "Medium")
138-
sleep(5)
139138
assert "'confidence': 'MEDIUM'" in log.read()
140139
with copy_to_desktop(TEST_FILE_HELLO_WORLD) as filepath:
141140
mark_screenshot(filepath)
142141
sleep(5)
143142
assert pb.get_text() == "Hello World"
144143
assert click_menu_item("Text detection confidence threshold", "Low")
145-
sleep(5)
146144
assert "'confidence': 'LOW'" in log.read()
147145

148146

@@ -178,7 +176,6 @@ def test_clear_clipboard(pb):
178176
"""Test Clear clipboard menu item works"""
179177
pb.set_text("Hello World")
180178
assert click_menu_item("Clear clipboard")
181-
sleep(5)
182179
assert pb.get_text() == ""
183180

184181

@@ -187,7 +184,6 @@ def test_confirm_clipboard_changes_yes(pb):
187184
pb.clear()
188185
with log_file() as log:
189186
assert click_menu_item("Confirm clipboard changes")
190-
sleep(5)
191187
assert "'confirmation': 1" in log.read()
192188
with copy_to_desktop(TEST_FILE_HELLO_WORLD) as filepath:
193189
mark_screenshot(filepath)
@@ -203,7 +199,6 @@ def test_confirm_clipboard_changes_no(pb):
203199
pb.set_text("Nope")
204200
with log_file() as log:
205201
assert click_menu_item("Confirm clipboard changes")
206-
sleep(5)
207202
assert "'confirmation': 1" in log.read()
208203
with copy_to_desktop(TEST_FILE_HELLO_WORLD) as filepath:
209204
mark_screenshot(filepath)
@@ -219,10 +214,8 @@ def test_enable_start_on_login():
219214
# setup_teardown() should have removed the login item if it existed
220215
assert "Textinator" not in list_login_items()
221216
assert click_menu_item("Start Textinator on login")
222-
sleep(5)
223217
assert "Textinator" in list_login_items()
224218
assert click_menu_item("Start Textinator on login")
225-
sleep(5)
226219
assert "Textinator" not in list_login_items()
227220

228221

@@ -236,6 +229,5 @@ def test_quit():
236229
"""Test Quit menu item"""
237230
assert process_is_running("Textinator")
238231
assert click_menu_item("Quit Textinator")
239-
sleep(5)
240232
assert not process_is_running("Textinator")
241233
os.system("open -a Textinator")

0 commit comments

Comments
 (0)