- Download and install .NET SDK
- Have a game instrumented with AltTester Unity SDK
- Have AltTester Desktop app installed (to be able to inspect game)
This repository is a test project that uses NUnit as the test library. It was generated using following command (as suggested in documentation)
dotnet new nunit
AltTester Unity SDK framework contains AltDriver
class used to connect to the instrumented game developed w/ Unity. AltTester-Driver for C# is available as a nuget package. Install AltTester-Driver nuget package
dotnet add package AltTester-Driver --version 2.0.0
Run tests manually (with dotnet CLI)
- Launch game
- From
TrashCat.Tests
execute all tests:
dotnet test
! Make sure to have the AltTester Desktop App closed, otherwise the test won't be able to connect to proper port.
dotnet test --filter <test_class_name>
dotnet test --filter <test_class_name>.<test_name>
- CallComponentMethod
- GetComponentProperty
- SetComponentProperty
- GetText
- SetText
- GetParent
- UpdateObject
- Tap
- Click
- PointerDownFromObject
- PointerUpFromObject
- PointerEnterObject
- PointerExitObject
- GetWorldPosition
- GetScreenPosition
-
WaitForComponentPropertyit's not implemented for 1.8.2, will be available in future - GetAllComponents
- GetAllProperties
- GetAllFields
- GetAllMethods
- FindObject
- By-Selector
- By.NAME
- By.PATH
- By.TAG
- By.COMPONENT
- By.TEXT
- By.ID
- By.LAYER
- FindObjects
- FindObjectWhichContains
- FindObjectsWhichContain
- FindObjectAtCoordinates
- GetAllElements
- WaitForObject
- WaitForObjectWhichContains
- WaitForObjectNotBePresent
- CallStaticMethod
- GetStaticProperty
- SetStaticProperty
- GetTimeScale
- SetTimeScale
- GetApplicationScreenSize
- WaitForCurrentSceneToBe
- GetAllLoadedScenes
- UnloadScene
- LoadScene
- GetCurrentScene
- PlayerPrefKeyType
- GettingPlayerPrefs
- GetIntKeyPlayerPref
- GetStringKeyPlayerPref
- GetFloatKeyPlayerPref
- SettingPlayerPrefs
- SetKeyPlayerPref(Int)
- SetKeyPlayerPref(String)
- SetKeyPlayerPref(Float)
- DeleteKeyPlayerPref
- DeletePlayerPref
- GetPNGScreenshot
- GetServerVersion
- GetAllScenes
- GetAllCameras
- GetAllActiveCameras
- get
altwebsocket-sharp.dll
from here and put in project's bin\Debug\net7.0
this was necessary due to currently open issue