Add Detach and Duplicate Prefab basic workflow auto test (#4506)

- Add a new automated test PrefabBasicWorkflow_CreateReparentAndDetachPrefab for verifying prefab detachment basic workflow.
- Add a new automated test PrefabBasicWorkflow_CreateAndDuplicatePrefab for verifying prefab detachment basic workflow.
- Fix a bug related to sets of entity ids in Reparent helper function .
This commit is contained in:
chiyenteng
2021-10-21 12:08:00 -07:00
committed by GitHub
parent 68b585102e
commit 7316802941
19 changed files with 328 additions and 102 deletions
@@ -22,24 +22,23 @@ def PrefabBasicWorkflow_CreateAndReparentPrefab():
prefab_test_utils.open_base_tests_level()
# Creates a new Entity at the root level
# Asserts if creation didn't succeed
# Creates a new car entity at the root level
car_entity = EditorEntity.create_editor_entity()
car_prefab_entities = [car_entity]
# Checks for prefab creation passed or not
# Creates a prefab from the car entity
_, car = Prefab.create_prefab(
car_prefab_entities, CAR_PREFAB_FILE_NAME)
# Creates another new Entity at the root level
# Creates another new wheel entity at the root level
wheel_entity = EditorEntity.create_editor_entity()
wheel_prefab_entities = [wheel_entity]
# Checks for wheel prefab creation passed or not
# Creates another prefab from the wheel entity
_, wheel = Prefab.create_prefab(
wheel_prefab_entities, WHEEL_PREFAB_FILE_NAME)
# Checks for prefab reparenting passed or not
# Reparents the wheel prefab instance to the container entity of the car prefab instance
await wheel.ui_reparent_prefab_instance(car.container_entity.id)
run_test()