Skip to content

Commit 7de739c

Browse files
committed
add testcases
1 parent 47540cc commit 7de739c

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

cue_lib/ui/views/import_export_page.rpy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ screen cue_export_section():
4141
"Specific Replays",
4242
Function(_exporter.set_scope, CueExportScope.SPECIFIC_REPLAYS))
4343

44-
null height 2
45-
4644
if (_exporter.scope == CueExportScope.SPECIFIC_REPLAYS):
4745
if not _exporter.replays:
4846
text ("No replays yet. Markers edited inside a replay "

test_game/templates/testcases_legacy.rpy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ testcase import_page_nav:
7272
$ if not (_cue.overlay_active_page == CuePage.IMPORT): renpy.quit(status=1)
7373
$ renpy.quit()
7474

75-
testcase import_shield_and_banner_render:
75+
testcase import_banner_render:
7676
$ _cue.is_overlay_visible = True
7777
run Jump("start")
7878
pause 2.0
79-
# An active package makes the editor read-only: the page body gets a
80-
# click-swallowing shield and the toolbar gains a banner. Set the active
81-
# state directly -- the export/scan/activate path is covered by the
79+
# An active package swaps the editor to the import and the toolbar shows
80+
# the edit banner (the click-swallowing shield was dropped). Set the
81+
# active state directly -- the export/scan/activate path is covered by the
8282
# roundtrip testcase. Rendering the SFX page under this state is the
83-
# smoke test: a broken shield/banner screen fails this interaction.
83+
# smoke test: a broken banner screen fails this interaction.
8484
$ _cue.importer.is_active = True
8585
$ _cue.importer.active_import = "ShieldPkg"
8686
run Function(_cue_set_page, CuePage.SFX)
@@ -108,6 +108,8 @@ testcase import_export_roundtrip:
108108
run Function(_cue.exporter.refresh)
109109
$ _cue.exporter.name = "Roundtrip"
110110
run Function(_cue.exporter.export)
111+
# Zip build runs on a background thread; give it time to finish.
112+
pause 2.0
111113
$ _ok = _cue.exporter.export_error == ""
112114
$ _ok = _ok and _cue.exporter.export_status != ""
113115
# A recipient drops the .zip into imports/; scan() auto-extracts it and
@@ -117,6 +119,8 @@ testcase import_export_roundtrip:
117119
$ _os.makedirs(_cue.importer.imports_dir())
118120
$ _shutil.copy(_zip_src, _zip_dst)
119121
run Function(_cue.importer.scan)
122+
# Scan (list + extract + manifest read) also runs on a background thread.
123+
pause 2.0
120124
$ _ok = _ok and len(_cue.importer.imports) == 1
121125
$ _ok = _ok and _cue.importer.imports[0]["valid"]
122126
$ _ok = _ok and _cue.importer.imports[0]["match"] == CueImportMatch.AUTO

test_game/templates/testcases_modern.rpy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ testcase import_page_nav:
5656
run Function(_cue_set_page, CuePage.IMPORT)
5757
assert eval (_cue.overlay_active_page == CuePage.IMPORT)
5858

59-
testcase import_shield_and_banner_render:
59+
testcase import_banner_render:
6060
run Jump("start")
6161
$ _cue_test_reset()
62-
# An active package makes the editor read-only: the page body gets a
63-
# click-swallowing shield and the toolbar gains a banner. Set the active
64-
# state directly -- the export/scan/activate path is covered by the
62+
# An active package swaps the editor to the import and the toolbar shows
63+
# the edit banner (the click-swallowing shield was dropped). Set the
64+
# active state directly -- the export/scan/activate path is covered by the
6565
# roundtrip testcase. Rendering the SFX page under this state is the
66-
# smoke test: a broken shield/banner screen fails this interaction.
66+
# smoke test: a broken banner screen fails this interaction.
6767
$ _cue.importer.is_active = True
6868
$ _cue.importer.active_import = "ShieldPkg"
6969
run Function(_cue_set_page, CuePage.SFX)
@@ -89,6 +89,8 @@ testcase import_export_roundtrip:
8989
assert eval (_cue.exporter.is_category_enabled(CueImportCategory.SFX))
9090
$ _cue.exporter.name = "Roundtrip"
9191
run Function(_cue.exporter.export)
92+
# The zip build runs on a background thread; wait for it to finish.
93+
pause 0.1 until eval (not _cue.exporter.is_exporting) timeout 15.0
9294
assert eval (_cue.exporter.export_error == "")
9395
assert eval (_cue.exporter.export_status != "")
9496
# A recipient drops the .zip into imports/; scan() auto-extracts it and
@@ -98,6 +100,8 @@ testcase import_export_roundtrip:
98100
$ _os.makedirs(_cue.importer.imports_dir())
99101
$ _shutil.copy(_zip_src, _zip_dst)
100102
run Function(_cue.importer.scan)
103+
# Scan (list + extract + manifest read) also runs on a background thread.
104+
pause 0.1 until eval (not _cue.importer.is_scanning) timeout 15.0
101105
assert eval (len(_cue.importer.imports) == 1)
102106
assert eval (_cue.importer.imports[0]["valid"])
103107
assert eval (_cue.importer.imports[0]["match"] == CueImportMatch.AUTO)

0 commit comments

Comments
 (0)