Stabilize runtime validation under dynamic UI load
This commit is contained in:
parent
983e4d0ec3
commit
d2dce7f900
5 changed files with 46 additions and 11 deletions
|
|
@ -31,9 +31,14 @@ func _run() -> void:
|
|||
for _frame: int in 8:
|
||||
await process_frame
|
||||
assert(bool(main.get("_application_initialized")))
|
||||
var session := main.get_node("%NetworkSession") as NetworkSession
|
||||
assert(bool(main.call(
|
||||
"_apply_world", WorldLayout.STARTER_ISLAND, 1, true
|
||||
)))
|
||||
assert(session.set_host_world(WorldLayout.STARTER_ISLAND, 1))
|
||||
assert(bool(main.call("_prepare_private_host")))
|
||||
var save_manager := main.get("_save_manager") as PlayerSaveManager
|
||||
assert(save_manager.initialize_new_game())
|
||||
assert(save_manager.initialize_new_game(1, WorldLayout.STARTER_ISLAND))
|
||||
main.call("_enter_gameplay")
|
||||
for _frame: int in 8:
|
||||
await process_frame
|
||||
|
|
@ -42,7 +47,6 @@ func _run() -> void:
|
|||
var catalog := main.get("fish_catalog") as FishPool
|
||||
var sale_service := main.get_node("%NetworkSaleService") as NetworkSaleService
|
||||
var shop_service := main.get_node("%NetworkShopService") as NetworkShopService
|
||||
var session := main.get_node("%NetworkSession") as NetworkSession
|
||||
var reservations := (
|
||||
main.get_node("%PlayerAssetReservationService")
|
||||
as PlayerAssetReservationService
|
||||
|
|
@ -554,7 +558,10 @@ func _test_host_backpack_purchase(
|
|||
for expected_capacity: int in [18, 27, 36]:
|
||||
_shop_result.clear()
|
||||
assert(not shop_service.request_backpack_capacity_upgrade().is_empty())
|
||||
assert(not _shop_result.is_empty() and bool(_shop_result[1]))
|
||||
assert(
|
||||
not _shop_result.is_empty() and bool(_shop_result[1]),
|
||||
"Backpack purchase failed: %s" % [_shop_result],
|
||||
)
|
||||
assert(layout.get_inventory_capacity() == expected_capacity)
|
||||
assert(player.wallet.get_balance() == balance_before - total_cost)
|
||||
assert(layout.get_next_backpack_cost() == -1)
|
||||
|
|
@ -575,7 +582,10 @@ func _test_host_storage_purchase(
|
|||
for expected_capacity: int in [18, 27, 36, 45, 54, 63, 72]:
|
||||
_shop_result.clear()
|
||||
assert(not shop_service.request_cooler_capacity_upgrade().is_empty())
|
||||
assert(not _shop_result.is_empty() and bool(_shop_result[1]))
|
||||
assert(
|
||||
not _shop_result.is_empty() and bool(_shop_result[1]),
|
||||
"Cooler purchase failed: %s" % [_shop_result],
|
||||
)
|
||||
assert(capacity.get_capacity() == expected_capacity)
|
||||
assert(player.wallet.get_balance() == balance_before - total_cost)
|
||||
assert(capacity.get_next_cost() == -1)
|
||||
|
|
|
|||
|
|
@ -21,9 +21,13 @@ func _run() -> void:
|
|||
assert(bool(main.get("_application_initialized")))
|
||||
|
||||
var session := main.get_node("%NetworkSession") as NetworkSession
|
||||
assert(bool(main.call(
|
||||
"_apply_world", WorldLayout.STARTER_ISLAND, 1, true
|
||||
)))
|
||||
assert(session.set_host_world(WorldLayout.STARTER_ISLAND, 1))
|
||||
assert(session.start_private_host(TEST_PORT))
|
||||
var save_manager := main.get("_save_manager") as PlayerSaveManager
|
||||
assert(save_manager.initialize_new_game())
|
||||
assert(save_manager.initialize_new_game(1, WorldLayout.STARTER_ISLAND))
|
||||
main.call("_enter_gameplay")
|
||||
for _frame: int in 8:
|
||||
await process_frame
|
||||
|
|
@ -38,7 +42,7 @@ func _run() -> void:
|
|||
and game_ui != null
|
||||
and catalog != null
|
||||
)
|
||||
fishing_spot.minimum_showcase_duration = 0.15
|
||||
fishing_spot.minimum_showcase_duration = 1.0
|
||||
assert(player.bag.add_item(&"crab_net"))
|
||||
assert(player.hotbar.assign_item(0, &"crab_net"))
|
||||
assert(player.hotbar.select_slot(0))
|
||||
|
|
@ -81,7 +85,7 @@ func _run() -> void:
|
|||
await process_frame
|
||||
assert(fishing_spot.get("_pending_catch") == crab_catch)
|
||||
Input.action_release("fish_primary")
|
||||
await create_timer(0.2).timeout
|
||||
fishing_spot.set("_showcase_input_lock_remaining", 0.0)
|
||||
await process_frame
|
||||
assert(bool(fishing_spot.get("_put_away_press_armed")))
|
||||
Input.parse_input_event(pocket_event)
|
||||
|
|
|
|||
|
|
@ -21,13 +21,17 @@ func _run() -> void:
|
|||
assert(bool(main.get("_application_initialized")))
|
||||
var session := main.get_node("%NetworkSession") as NetworkSession
|
||||
assert(session != null)
|
||||
assert(bool(main.call(
|
||||
"_apply_world", WorldLayout.STARTER_ISLAND, 1, true
|
||||
)))
|
||||
assert(session.set_host_world(WorldLayout.STARTER_ISLAND, 1))
|
||||
var occupied_port := PacketPeerUDP.new()
|
||||
assert(occupied_port.bind(18137, "127.0.0.1") == OK)
|
||||
assert(session.start_private_host(18137, 3))
|
||||
assert(session.get_host_port() == 18138)
|
||||
occupied_port.close()
|
||||
var save_manager := main.get("_save_manager") as PlayerSaveManager
|
||||
assert(save_manager.initialize_new_game())
|
||||
assert(save_manager.initialize_new_game(1, WorldLayout.STARTER_ISLAND))
|
||||
main.call("_enter_gameplay")
|
||||
await physics_frame
|
||||
await physics_frame
|
||||
|
|
|
|||
|
|
@ -20,9 +20,13 @@ func _run() -> void:
|
|||
await process_frame
|
||||
assert(bool(main.get("_application_initialized")))
|
||||
var session := main.get_node("%NetworkSession") as NetworkSession
|
||||
assert(bool(main.call(
|
||||
"_apply_world", WorldLayout.STARTER_ISLAND, 1, true
|
||||
)))
|
||||
assert(session.set_host_world(WorldLayout.STARTER_ISLAND, 1))
|
||||
assert(session.start_private_host(TEST_PORT))
|
||||
var save_manager := main.get("_save_manager") as PlayerSaveManager
|
||||
assert(save_manager.initialize_new_game())
|
||||
assert(save_manager.initialize_new_game(1, WorldLayout.STARTER_ISLAND))
|
||||
main.call("_enter_gameplay")
|
||||
await physics_frame
|
||||
await physics_frame
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue