From 744284e3d97beb7b1043c8b1acaf94c941326ff1 Mon Sep 17 00:00:00 2001 From: Byoungwook Park Date: Wed, 17 May 2023 22:20:13 +0900 Subject: [PATCH] fix: many test script doesn't work --- DoguRpgSample/Packages/manifest.json | 2 +- .../ProjectSettings/ProjectSettings.asset | 1 + .../Assets/UI/Textures/UI_atlas.psd.meta | 12 ++++---- DragonCrashers/Packages/manifest.json | 2 +- DypThePenguin/Packages/manifest.json | 2 +- InputSystemWarriors/Packages/manifest.json | 2 +- .../Scenes/Drag And Drop.unity | 30 +++---------------- UnityUISamples/Packages/manifest.json | 2 +- client/typescript/package.json | 12 ++++---- client/typescript/test/dogurpgsample-test.ts | 1 + client/typescript/test/dragoncrashers-test.ts | 7 +++++ client/typescript/test/dypthepenguin-test.ts | 7 ++++- client/typescript/test/functions.ts | 2 +- .../test/inputsystemwarriors-test.ts | 9 ++++-- client/typescript/test/unityuisamples-test.ts | 20 ++++++++----- 15 files changed, 56 insertions(+), 55 deletions(-) diff --git a/DoguRpgSample/Packages/manifest.json b/DoguRpgSample/Packages/manifest.json index 7495166..e91eebd 100644 --- a/DoguRpgSample/Packages/manifest.json +++ b/DoguRpgSample/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.3", + "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.4", "com.unity.2d.sprite": "1.0.0", "com.unity.ide.rider": "3.0.16", "com.unity.ide.visualstudio": "2.0.16", diff --git a/DoguRpgSample/ProjectSettings/ProjectSettings.asset b/DoguRpgSample/ProjectSettings/ProjectSettings.asset index 19eaa72..6636848 100644 --- a/DoguRpgSample/ProjectSettings/ProjectSettings.asset +++ b/DoguRpgSample/ProjectSettings/ProjectSettings.asset @@ -803,6 +803,7 @@ PlayerSettings: scriptingDefineSymbols: 0: UNITY_POST_PROCESSING_STACK_V2;USE_GAMIUM 1: UNITY_POST_PROCESSING_STACK_V2;USE_GAMIUM + 4: USE_GAMIUM 7: UNITY_POST_PROCESSING_STACK_V2;USE_GAMIUM 13: UNITY_POST_PROCESSING_STACK_V2 14: UNITY_POST_PROCESSING_STACK_V2 diff --git a/DragonCrashers/Assets/UI/Textures/UI_atlas.psd.meta b/DragonCrashers/Assets/UI/Textures/UI_atlas.psd.meta index 9021439..d452b7e 100644 --- a/DragonCrashers/Assets/UI/Textures/UI_atlas.psd.meta +++ b/DragonCrashers/Assets/UI/Textures/UI_atlas.psd.meta @@ -4603,7 +4603,7 @@ ScriptedImporter: tessellationDetail: 0 parentGroupIndex: -1 uvTransform: {x: 1920, y: 1448} - spritePosition: {x: 1045, y: 1665} + spritePosition: {x: 1047, y: 1666} - name: icon_stat_speed originalName: pivot: {x: 0.5, y: 0.5} @@ -4625,7 +4625,7 @@ ScriptedImporter: tessellationDetail: 0 parentGroupIndex: -1 uvTransform: {x: 1866, y: 1448} - spritePosition: {x: 965, y: 1662} + spritePosition: {x: 966, y: 1663} - name: icon_stat_critical originalName: pivot: {x: 0.5, y: 0.5} @@ -4647,7 +4647,7 @@ ScriptedImporter: tessellationDetail: 0 parentGroupIndex: -1 uvTransform: {x: 1742, y: 1448} - spritePosition: {x: 1045, y: 1735} + spritePosition: {x: 1047, y: 1736} - name: icon_stat_attack originalName: pivot: {x: 0.5, y: 0.5} @@ -4669,7 +4669,7 @@ ScriptedImporter: tessellationDetail: 0 parentGroupIndex: -1 uvTransform: {x: 1042, y: 1748} - spritePosition: {x: 964, y: 1742} + spritePosition: {x: 966, y: 1744} - name: icon_stat_defense originalName: pivot: {x: 0.5, y: 0.5} @@ -4691,7 +4691,7 @@ ScriptedImporter: tessellationDetail: 0 parentGroupIndex: -1 uvTransform: {x: 1920, y: 1511} - spritePosition: {x: 1052, y: 1817} + spritePosition: {x: 1054, y: 1818} - name: icon_stat_health originalName: pivot: {x: 0.5, y: 0.5} @@ -4713,7 +4713,7 @@ ScriptedImporter: tessellationDetail: 0 parentGroupIndex: -1 uvTransform: {x: 1743, y: 1518} - spritePosition: {x: 963, y: 1820} + spritePosition: {x: 964, y: 1821} - name: icon_power originalName: pivot: {x: 0.5, y: 0.5} diff --git a/DragonCrashers/Packages/manifest.json b/DragonCrashers/Packages/manifest.json index 90c9893..7bfb1d5 100644 --- a/DragonCrashers/Packages/manifest.json +++ b/DragonCrashers/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.3", + "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.4", "com.unity.collab-proxy": "1.17.7", "com.unity.feature.2d": "1.0.0", "com.unity.feature.development": "1.0.1", diff --git a/DypThePenguin/Packages/manifest.json b/DypThePenguin/Packages/manifest.json index 40ac6b6..1ea9467 100644 --- a/DypThePenguin/Packages/manifest.json +++ b/DypThePenguin/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.3", + "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.4", "com.unity.cinemachine": "2.8.4", "com.unity.collab-proxy": "1.15.17", "com.unity.ide.rider": "3.0.14", diff --git a/InputSystemWarriors/Packages/manifest.json b/InputSystemWarriors/Packages/manifest.json index ba0245c..91763ad 100644 --- a/InputSystemWarriors/Packages/manifest.json +++ b/InputSystemWarriors/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.3", + "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.4", "com.unity.2d.sprite": "1.0.0", "com.unity.cinemachine": "2.8.9", "com.unity.collab-proxy": "1.17.7", diff --git a/UnityUISamples/Assets/Unity UI Samples/Scenes/Drag And Drop.unity b/UnityUISamples/Assets/Unity UI Samples/Scenes/Drag And Drop.unity index c82abc5..e889174 100644 --- a/UnityUISamples/Assets/Unity UI Samples/Scenes/Drag And Drop.unity +++ b/UnityUISamples/Assets/Unity UI Samples/Scenes/Drag And Drop.unity @@ -152,7 +152,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1792090938} m_RootOrder: 0 @@ -241,7 +240,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -20} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1503577158} m_RootOrder: 0 @@ -321,7 +319,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 657950952} m_RootOrder: 0 @@ -401,7 +398,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1161611645} m_RootOrder: 0 @@ -481,7 +477,6 @@ RectTransform: m_LocalRotation: {x: 0.25881907, y: 0, z: 0, w: 0.9659258} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1098133972} - {fileID: 1133370877} @@ -617,7 +612,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2d49b7c1bcd2e07499844da127be038d, type: 3} m_Name: m_EditorClassIdentifier: - m_SendPointerHoverToParent: 1 m_ForceModuleActive: 0 --- !u!114 &629012198 MonoBehaviour: @@ -631,7 +625,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: - m_SendPointerHoverToParent: 1 m_HorizontalAxis: Horizontal m_VerticalAxis: Vertical m_SubmitButton: Submit @@ -664,7 +657,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 194.44109, y: 340.70532, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -697,7 +689,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 378318475} m_RootOrder: 3 @@ -777,7 +768,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 288746055} - {fileID: 1583289237} @@ -856,7 +846,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1161611645} m_RootOrder: 1 @@ -952,7 +941,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0.3826835, z: 0, w: 0.9238795} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1161611645} m_Father: {fileID: 1182116519} @@ -1029,9 +1017,8 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 945614443} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 289} + m_LocalPosition: {x: 0, y: 0, z: 21} m_LocalScale: {x: 0.99997175, y: 0.99997175, z: 0.99997175} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1503577158} m_Father: {fileID: 1182116519} @@ -1039,8 +1026,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 435, y: 244} - m_SizeDelta: {x: 250, y: 70} + m_AnchoredPosition: {x: -363, y: 140} + m_SizeDelta: {x: 208.572, y: 52.048} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &945614445 MonoBehaviour: @@ -1074,6 +1061,7 @@ Animator: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 --- !u!114 &945614447 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1166,7 +1154,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1740219187} m_Father: {fileID: 378318475} @@ -1243,7 +1230,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1194704063} m_Father: {fileID: 378318475} @@ -1320,7 +1306,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 298577737} - {fileID: 695465770} @@ -1399,7 +1384,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 378318475} - {fileID: 1998702092} @@ -1503,7 +1487,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1133370877} m_RootOrder: 0 @@ -1592,7 +1575,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -15} m_LocalScale: {x: 1, y: 1, z: 0.99999994} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 281128518} m_Father: {fileID: 945614444} @@ -1670,7 +1652,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 657950952} m_RootOrder: 1 @@ -1762,7 +1743,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1098133972} m_RootOrder: 0 @@ -1889,7 +1869,6 @@ RectTransform: m_LocalRotation: {x: -0.00000008940697, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 93313322} m_Father: {fileID: 378318475} @@ -1928,7 +1907,6 @@ RectTransform: m_LocalRotation: {x: 0, y: -0.3826835, z: 0, w: 0.9238795} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 657950952} m_Father: {fileID: 1182116519} diff --git a/UnityUISamples/Packages/manifest.json b/UnityUISamples/Packages/manifest.json index 85f7034..a860ea6 100644 --- a/UnityUISamples/Packages/manifest.json +++ b/UnityUISamples/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.3", + "com.dogu.gamium.engine.unity": "https://github.com/dogu-team/gamium.git?path=/engine/unity#1.0.4", "com.unity.collab-proxy": "1.17.7", "com.unity.ide.rider": "3.0.16", "com.unity.ide.visualstudio": "2.0.16", diff --git a/client/typescript/package.json b/client/typescript/package.json index a2085ba..bb416d7 100644 --- a/client/typescript/package.json +++ b/client/typescript/package.json @@ -5,12 +5,12 @@ "author": "", "scripts": { "build": "tsc", - "run:DoguRpgSample": "ts-node ./test/dogurpgsample-test.ts", - "run:DragonCrashers": "ts-node ./test/dragoncrashers-test.ts", - "run:DypThePenguin": "ts-node ./test/dypthepenguin-test.ts", - "run:InputSystemWarriors": "ts-node ./test/inputsystemwarriors-test.ts", - "run:UnityUISamples": "ts-node ./test/unityuisamples-test.ts", - "run:WarehouseInvasion": "ts-node ./test/warehouseinvasion-test.ts", + "run:DoguRpgSample": "tsc -b && ts-node ./test/dogurpgsample-test.ts", + "run:DragonCrashers": "tsc -b && ts-node ./test/dragoncrashers-test.ts", + "run:DypThePenguin": "tsc -b && ts-node ./test/dypthepenguin-test.ts", + "run:InputSystemWarriors": "tsc -b && ts-node ./test/inputsystemwarriors-test.ts", + "run:UnityUISamples": "tsc -b && ts-node ./test/unityuisamples-test.ts", + "run:WarehouseInvasion": "tsc -b && ts-node ./test/warehouseinvasion-test.ts", "watch": "tsc --watch" }, "dependencies": { diff --git a/client/typescript/test/dogurpgsample-test.ts b/client/typescript/test/dogurpgsample-test.ts index e4f8f6c..ee8789e 100644 --- a/client/typescript/test/dogurpgsample-test.ts +++ b/client/typescript/test/dogurpgsample-test.ts @@ -185,6 +185,7 @@ import { test } from './functions'; await test('Quit', async () => { await gamium.sleep(4000); await gamium.actions().appQuit().perform(); + process.exit(0); }); })().catch((e) => { console.error(e); diff --git a/client/typescript/test/dragoncrashers-test.ts b/client/typescript/test/dragoncrashers-test.ts index 0d07933..0c3d074 100644 --- a/client/typescript/test/dragoncrashers-test.ts +++ b/client/typescript/test/dragoncrashers-test.ts @@ -1,6 +1,7 @@ import { By, GamiumClient, MovePlayerBy, UI, Until, NodeGamiumService } from 'gamium'; import { test } from './functions'; import assert from 'assert'; +import crypto from 'crypto'; (async () => { const gamiumService = new NodeGamiumService('127.0.0.1', 50061); @@ -136,6 +137,12 @@ import assert from 'assert'; await ui.click(By.path(path)); } }); + + await test('Quit', async () => { + await gamium.sleep(4000); + await gamium.actions().appQuit().perform(); + process.exit(0); + }); })().catch((e) => { console.error(e); process.exit(1); diff --git a/client/typescript/test/dypthepenguin-test.ts b/client/typescript/test/dypthepenguin-test.ts index 92adf60..87e4755 100644 --- a/client/typescript/test/dypthepenguin-test.ts +++ b/client/typescript/test/dypthepenguin-test.ts @@ -6,7 +6,7 @@ import { test } from './functions'; await gamiumService.connect(); const gamium = new GamiumClient(gamiumService); const ui = gamium.ui(); - let player: Player; + const player = await gamium.player(By.path('/Dyp[1]/Dyp[1]/Root[1]')); const cameraLocator = By.path('/Cameras[1]/Main Camera[1]'); await test('Pick First SnowBall', async () => { @@ -199,6 +199,11 @@ import { test } from './functions'; await gamium.sendKeys([KeyBy.unityKeycode('W'), KeyBy.unityKeycode('A')], { duratiomMs: 100 }); await gamium.sendKey(KeyBy.unityKeycode('LeftControl')); }); + + await test('Quit', async () => { + await gamium.actions().appQuit().perform(); + process.exit(0); + }); })().catch((e) => { console.error(e); process.exit(1); diff --git a/client/typescript/test/functions.ts b/client/typescript/test/functions.ts index d299a9b..80748de 100644 --- a/client/typescript/test/functions.ts +++ b/client/typescript/test/functions.ts @@ -1,4 +1,4 @@ export async function test(name: string, fn: () => Promise | void): Promise { - console.log(name); + console.log(`[${name}]`); await fn(); } diff --git a/client/typescript/test/inputsystemwarriors-test.ts b/client/typescript/test/inputsystemwarriors-test.ts index 4f022f3..a1f8928 100644 --- a/client/typescript/test/inputsystemwarriors-test.ts +++ b/client/typescript/test/inputsystemwarriors-test.ts @@ -44,11 +44,16 @@ import { test } from './functions'; const keys = Object.keys(UnityKeyboard).filter((v) => isNaN(Number(v))); for (const key of keys) { - await gamium.sendKey(KeyBy.unityKeyboard(UnityKeyboard[key])); + await gamium.sendKey(KeyBy.unityKeyboard(key as keyof typeof UnityKeyboard)); const text = await ui.getText(By.path('/UI[1]/Canvas[1]/Text (TMP)[1]')); - assert.equal(UnityKeyboard[text], UnityKeyboard[key], `fail ${key} is not equal to ${text}`); + assert.deepStrictEqual(UnityKeyboard[text], UnityKeyboard[key], `fail ${UnityKeyboard[key]} is not equal to ${UnityKeyboard[text]}`); } }); + + await test('Quit', async () => { + await gamium.actions().appQuit().perform(); + process.exit(0); + }); })().catch((e) => { console.error(e); process.exit(1); diff --git a/client/typescript/test/unityuisamples-test.ts b/client/typescript/test/unityuisamples-test.ts index e971a53..d3aaa5c 100644 --- a/client/typescript/test/unityuisamples-test.ts +++ b/client/typescript/test/unityuisamples-test.ts @@ -10,7 +10,7 @@ import { test } from './functions'; let player: Player; const cameraLocator = By.path('/Cameras[1]/Main Camera[1]'); - test('RpcMethod test', async () => { + await test('RpcMethod test', async () => { let ret = await gamium.executeRpc(RpcBy.method('Gamium.Private.CodebaseSample', 'CallEmptyParam')); assert.strictEqual(ret, undefined); ret = await gamium.executeRpc(RpcBy.method('Gamium.Private.CodebaseSample', 'CallParam1', 10)); @@ -40,7 +40,7 @@ import { test } from './functions'; }); }); - test('RpcField test', async () => { + await test('RpcField test', async () => { let ret = await gamium.executeRpc(RpcBy.field('Gamium.Private.CodebaseSample', 'field1')); assert.strictEqual(ret, 10.0); ret = await gamium.executeRpc(RpcBy.field('Gamium.Private.CodebaseSample', 'field2')); @@ -49,14 +49,14 @@ import { test } from './functions'; assert.deepStrictEqual(ret, { hello: 'nice' }); }); - test('RpcProperty test', async () => { + await test('RpcProperty test', async () => { let ret = await gamium.executeRpc(RpcBy.property('Gamium.Private.CodebaseSample', 'property1')); assert.strictEqual(ret, 0); ret = await gamium.executeRpc(RpcBy.property('Gamium.Private.CodebaseSample', 'property2')); assert.deepStrictEqual(ret, []); }); - test('Click Test', async () => { + await test('Click Test', async () => { await ui.click(By.path('/Canvas[1]/MainMenu[1]/Window[1]/Settings[1]')); await ui.click(By.path('/Canvas[1]/Settings[1]/SettingsWindow[1]/Video[1]')); await ui.click(By.path('/Canvas[1]/Settings[1]/SettingsPanels[1]/VideoWindow[1]/Panel[1]/Settings[1]/Anti-Aliasing toggle[1]/Checkmark[1]')); @@ -66,7 +66,7 @@ import { test } from './functions'; await ui.click(By.path('/Canvas[1]/MainMenu[1]/Window[1]/NextScene[1]')); }); - test('Drag Test', async () => { + await test('Drag Test', async () => { await ui.find(By.path('/Canvas[1]/Panel Top[1]/Drag Box[1]/Drag Image[1]')); const srcElem = await ui.find(By.path('/Canvas[1]/Panel Top[1]/Drag Box[1]/Drag Image[1]')); const src2Elem = await ui.find(By.path('/Canvas[1]/Panel Top[1]/Drag Box[2]/Drag Image[1]')); @@ -82,7 +82,7 @@ import { test } from './functions'; await ui.click(By.path('/Canvas[1]/NextScene[1]')); }); - test('Controls Test', async () => { + await test('Controls Test', async () => { const handle = await ui.find(By.path('/Canvas[1]/Panel[1]/Slider[1]/Handle Slide Area[1]/Handle[1]')); await handle.waitInteractable(); await handle.drag({ x: handle.info.screenPosition.x - 30, y: handle.info.screenPosition.y }, { durationMs: 1000, intervalMs: 100 }); @@ -118,16 +118,20 @@ import { test } from './functions'; await ui.click(By.path('/Canvas[1]/NextScene[1]')); }); - test('keycode test', async () => { + await test('keycode test', async () => { const keys = Object.keys(UnityKeyCode).filter((v) => isNaN(Number(v))); const title = await ui.find(By.path('/Canvas[1]/Window[1]/SF Title[1]/TitleLabel[1]')); for (const key of keys) { - await gamium.sendKey(KeyBy.unityKeycode(UnityKeyCode[key]), { duratiomMs: 30 }); + await gamium.sendKey(KeyBy.unityKeycode(key as keyof typeof UnityKeyCode), { duratiomMs: 30 }); const text = await title.getText(); assert.equal(UnityKeyCode[text], UnityKeyCode[key], `fail ${key}`); } }); + await test('Quit', async () => { + await gamium.actions().appQuit().perform(); + process.exit(0); + }); })().catch((e) => { console.error(e); process.exit(1);