+ [CanBeNull] object Test() => null;
+
+ void UseTest() {
+ var p = Test();
+ var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
+ }
+
+ [NotNull] object Foo() {
+ return null; // Warning: Possible 'null' assignment
+ }
+
+ [StringFormatMethod("message")]
+ void ShowError(string message, params object[] args) { /* do something */ }
+
+ void Foo() {
+ ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
+ }
+
+ void Foo(string param) {
+ if (param == null)
+ throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
+ }
+
+ public class Foo : INotifyPropertyChanged {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ [NotifyPropertyChangedInvocator]
+ protected virtual void NotifyChanged(string propertyName) { ... }
+
+ string _name;
+
+ public string Name {
+ get { return _name; }
+ set { _name = value; NotifyChanged("LastName"); /* Warning */ }
+ }
+ }
+
+ Examples of generated notifications:
+ Function Definition Table syntax:
+
+ [ContractAnnotation("=> halt")]
+ public void TerminationMethod()
+
+ [ContractAnnotation("halt <= condition: false")]
+ public void Assert(bool condition, string text) // regular assertion method
+
+ [ContractAnnotation("s:null => true")]
+ public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
+
+ // A method that returns null if the parameter is null,
+ // and not null if the parameter is not null
+ [ContractAnnotation("null => null; notnull => notnull")]
+ public object Transform(object data)
+
+ [ContractAnnotation("=> true, result: notnull; => false, result: null")]
+ public bool TryParse(string s, out Person result)
+
+ [LocalizationRequiredAttribute(true)]
+ class Foo {
+ string str = "my string"; // Warning: Localizable string
+ }
+
+ [CannotApplyEqualityOperator]
+ class NoEquality { }
+
+ class UsesNoEquality {
+ void Test() {
+ var ca1 = new NoEquality();
+ var ca2 = new NoEquality();
+ if (ca1 != null) { // OK
+ bool condition = ca1 == ca2; // Warning
+ }
+ }
+ }
+
+ [BaseTypeRequired(typeof(IComponent)] // Specify requirement
+ class ComponentAttribute : Attribute { }
+
+ [Component] // ComponentAttribute requires implementing IComponent interface
+ class MyComponent : IComponent { }
+
+ [Pure] int Multiply(int x, int y) => x * y;
+
+ void M() {
+ Multiply(123, 42); // Waring: Return value of pure method is not used
+ }
+
+ class Foo {
+ [ProvidesContext] IBarService _barService = ...;
+
+ void ProcessNode(INode node) {
+ DoSomething(node, node.GetGlobalServices().Bar);
+ // ^ Warning: use value of '_barService' field
+ }
+ }
+
+ [SourceTemplate]
+ public static void forEach<T>(this IEnumerable<T> xs) {
+ foreach (var x in xs) {
+ //$ $END$
+ }
+ }
+
+
+ [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")]
+ public static void forEach<T>(this IEnumerable<T> collection) {
+ foreach (var item in collection) {
+ //$ $END$
+ }
+ }
+
+ Applying the attribute on a template method parameter:
+
+ [SourceTemplate]
+ public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) {
+ /*$ var $x$Id = "$newguid$" + x.ToString();
+ x.DoSomething($x$Id); */
+ }
+
+
+ [ActionName("Foo")]
+ public ActionResult Login(string returnUrl) {
+ ViewBag.ReturnUrl = Url.Action("Foo"); // OK
+ return RedirectToAction("Bar"); // Error: Cannot resolve action
+ }
+
+ protected override Task WriteAsyncTask(LogEventInfo logEvent, CancellationToken token)
+ {
+ return CustomWriteAsync(logEvent, token);
+ }
+
+ private async Task CustomWriteAsync(LogEventInfo logEvent, CancellationToken token)
+ {
+ await MyLogMethodAsync(logEvent, token).ConfigureAwait(false);
+ }
+
+ To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ + NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol + or you'll get TCP timeouts and your application will crawl. + Either switch to UDP transport or use AsyncWrapper target + so that your application threads will not be blocked by the timing-out connection attempts. +
+${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ Condition | +Foreground Color | +Background Color | +
---|---|---|
level == LogLevel.Fatal | +Red | +NoChange | +
level == LogLevel.Error | +Yellow | +NoChange | +
level == LogLevel.Warn | +Magenta | +NoChange | +
level == LogLevel.Info | +White | +NoChange | +
level == LogLevel.Debug | +Gray | +NoChange | +
level == LogLevel.Trace | +DarkGray | +NoChange | +
+ To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+
+
+
+
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${basedir}/${level}.log
+ All
+ Caution: Enabling this option can considerably slow down your file
+ logging in multi-process scenarios. If only one process is going to
+ be writing to the file, consider setting
+ To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ + Mail target works best when used with BufferingWrapper target + which lets you send multiple log messages in single mail +
++ To set up the buffered mail target in the configuration file, + use the following syntax: +
+
+ + To set up the buffered mail target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ + To print the results, use any application that's able to receive messages over + TCP or UDP. NetCat is + a simple but very powerful command-line tool that can be used for that. This image + demonstrates the NetCat tool receiving log messages from Network target. +
++ NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol + or you'll get TCP timeouts and your application will be very slow. + Either switch to UDP transport or use AsyncWrapper target + so that your application threads will not be blocked by the timing-out connection attempts. +
++ There are two specialized versions of the Network target: Chainsaw + and NLogViewer which write to instances of Chainsaw log4j viewer + or NLogViewer application respectively. +
+${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ + NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol + or you'll get TCP timeouts and your application will crawl. + Either switch to UDP transport or use AsyncWrapper target + so that your application threads will not be blocked by the timing-out connection attempts. +
+${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+
+ <system.net>
+ <defaultProxy enabled = "true" useDefaultCredentials = "true" >
+ <proxy usesystemdefault = "True" />
+ </defaultProxy>
+ </system.net>
+
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + This assumes just one target and a single rule. More configuration + options are described here. +
++ To set up the log target programmatically use code like this: +
+
+ The example web service that works with this example is shown below
+
+ + Asynchronous target wrapper allows the logger code to execute more quickly, by queueing + messages and processing them in a separate thread. You should wrap targets + that spend a non-trivial amount of time in their Write() method with asynchronous + target to speed up logging. +
++ Because asynchronous logging is quite a common scenario, NLog supports a + shorthand notation for wrapping all targets with AsyncWrapper. Just add async="true" to + the <targets/> element in the configuration file. +
+
+
+ ... your targets go here ...
+
+ ]]>
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ + To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ ${longdate}|${level:uppercase=true}|${logger}|${message}
+ This example causes the messages to be written to server1, + and if it fails, messages go to server2.
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ This example causes the messages not contains the string '1' to be ignored.
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ + This example works like this. If there are no Warn,Error or Fatal messages in the buffer + only Info messages are written to the file, but if there are any warnings or errors, + the output includes detailed trace (levels >= Debug). You can plug in a different type + of buffering wrapper (such as ASPNetBufferingWrapper) to achieve different + functionality. +
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ This example causes the messages to be written to either file1.txt or file2.txt + chosen randomly on a per-message basis. +
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ This example causes each log message to be repeated 3 times.
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ This example causes each write attempt to be repeated 3 times, + sleeping 1 second between attempts if first one fails.
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ This example causes the messages to be written to either file1.txt or file2.txt. + Each odd message is written to file2.txt, each even message goes to file1.txt. +
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ This example causes the messages to be written to both file1.txt or file2.txt +
++ To set up the target in the configuration file, + use the following syntax: +
+
+ + The above examples assume just one target and a single rule. See below for + a programmatic configuration that's equivalent to the above config file: +
+
+ 0.1
.
+ /// If set wait for command to finish. Defaults to 1
+ /// The duration of the scroll in seconds. Defaults to 0.1
+ /// If set wait for command to finish. Defaults to 1
+ /// The duration of the scroll in seconds. Defaults to 0.1
+ /// If set wait for command to finish. Defaults to 0.1.
+ /// If set wait for command to finish. Defaults to True .
+ public void Tilt(AltVector3 acceleration, float duration = 0.1f, bool wait = true)
+ {
+ new AltTilt(communicationHandler, acceleration, duration, wait).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ public List GetAllElements(By cameraBy = By.NAME, string cameraValue = "", bool enabled = true)
+ {
+ var listOfObjects = new AltGetAllElements(communicationHandler, cameraBy, cameraValue, enabled).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return listOfObjects;
+ }
+
+ public List GetAllElementsLight(By cameraBy = By.NAME, string cameraValue = "", bool enabled = true)
+ {
+ var listOfObjects = new AltGetAllElementsLight(communicationHandler, cameraBy, cameraValue, enabled).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return listOfObjects;
+ }
+
+ public void WaitForCurrentSceneToBe(string sceneName, double timeout = 10, double interval = 1)
+ {
+ new AltWaitForCurrentSceneToBe(communicationHandler, sceneName, timeout, interval).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ public AltObject WaitForObject(By by, string value, By cameraBy = By.NAME, string cameraValue = "", bool enabled = true, double timeout = 20, double interval = 0.5)
+ {
+ var objectFound = new AltWaitForObject(communicationHandler, by, value, cameraBy, cameraValue, enabled, timeout, interval).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return objectFound;
+ }
+
+ public void WaitForObjectNotBePresent(By by, string value, By cameraBy = By.NAME, string cameraValue = "", bool enabled = true, double timeout = 20, double interval = 0.5)
+ {
+ new AltWaitForObjectNotBePresent(communicationHandler, by, value, cameraBy, cameraValue, enabled, timeout, interval).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ public AltObject WaitForObjectWhichContains(By by, string value, By cameraBy = By.NAME, string cameraValue = "", bool enabled = true, double timeout = 20, double interval = 0.5)
+ {
+ var objectFound = new AltWaitForObjectWhichContains(communicationHandler, by, value, cameraBy, cameraValue, enabled, timeout, interval).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return objectFound;
+ }
+
+ public List GetAllScenes()
+ {
+ var listOfScenes = new AltGetAllScenes(communicationHandler).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return listOfScenes;
+ }
+
+ public List GetAllCameras()
+ {
+ var listOfCameras = new AltGetAllCameras(communicationHandler).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return listOfCameras;
+ }
+
+ public List GetAllActiveCameras()
+ {
+ var listOfCameras = new AltGetAllActiveCameras(communicationHandler).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return listOfCameras;
+ }
+
+ public AltVector2 GetApplicationScreenSize()
+ {
+ var screenWidth = CallStaticMethod("UnityEngine.Screen", "get_width", "UnityEngine.CoreModule", new string[] { }, null);
+ var screenHeight = CallStaticMethod("UnityEngine.Screen", "get_height", "UnityEngine.CoreModule", new string[] { }, null);
+
+ return new AltVector2(screenWidth, screenHeight);
+ }
+
+ public AltTextureInformation GetScreenshot(AltVector2 size = default(AltVector2), int screenShotQuality = 100)
+ {
+ var textureInformation = new AltGetScreenshot(communicationHandler, size, screenShotQuality).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return textureInformation;
+ }
+
+ public AltTextureInformation GetScreenshot(int id, AltColor color, float width, AltVector2 size = default(AltVector2), int screenShotQuality = 100)
+ {
+ var textureInformation = new AltGetHighlightObjectScreenshot(communicationHandler, id, color, width, size, screenShotQuality).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return textureInformation;
+ }
+
+ public AltTextureInformation GetScreenshot(AltVector2 coordinates, AltColor color, float width, out AltObject selectedObject, AltVector2 size = default(AltVector2), int screenShotQuality = 100)
+ {
+ var textureInformation = new AltGetHighlightObjectFromCoordinatesScreenshot(communicationHandler, coordinates, color, width, size, screenShotQuality).Execute(out selectedObject);
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return textureInformation;
+ }
+
+ public void GetPNGScreenshot(string path)
+ {
+ new AltGetPNGScreenshot(communicationHandler, path).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ public List GetAllLoadedScenesAndObjects(bool enabled = true)
+ {
+ var listOfObjects = new AltGetAllLoadedScenesAndObjects(communicationHandler, enabled).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return listOfObjects;
+ }
+
+ public void SetServerLogging(AltLogger logger, AltLogLevel logLevel)
+ {
+ new AltSetServerLogging(communicationHandler, logger, logLevel).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ public int BeginTouch(AltVector2 screenPosition)
+ {
+ var touchId = new AltBeginTouch(communicationHandler, screenPosition).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return touchId;
+ }
+
+ public void MoveTouch(int fingerId, AltVector2 screenPosition)
+ {
+ new AltMoveTouch(communicationHandler, fingerId, screenPosition).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ public void EndTouch(int fingerId)
+ {
+ new AltEndTouch(communicationHandler, fingerId).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ }
+
+ ///
+ /// Retrieves the Unity object at given coordinates.
+ /// Uses EventSystem.RaycastAll to find object. If no object is found then it uses UnityEngine.Physics.Raycast and UnityEngine.Physics2D.Raycast and returns the one closer to the camera.
+ ///
+ /// The screen coordinates
+ /// The UI object hit by event system Raycast, null otherwise
+ public AltObject FindObjectAtCoordinates(AltVector2 coordinates)
+ {
+ var objectFound = new AltFindObjectAtCoordinates(communicationHandler, coordinates).Execute();
+ communicationHandler.SleepFor(communicationHandler.GetDelayAfterCommand());
+ return objectFound;
+ }
+
+ public void AddNotificationListener(NotificationType notificationType, Action callback, bool overwrite)
+ {
+ new AddNotificationListener(communicationHandler, notificationType, callback, overwrite).Execute();
+ }
+
+ public void RemoveNotificationListener(NotificationType notificationType)
+ {
+ new RemoveNotificationListener(communicationHandler, notificationType).Execute();
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/AltDriver.cs.meta b/Assets/AltTester/Runtime/AltDriver/AltDriver.cs.meta
new file mode 100644
index 00000000..b66077ab
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltDriver.cs.meta
@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: 6f07df674d08ff94295e3a35036f3fdb
+timeCreated: 1522050547
+licenseType: Free
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/AltErrors.cs b/Assets/AltTester/Runtime/AltDriver/AltErrors.cs
new file mode 100644
index 00000000..d522f1bb
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltErrors.cs
@@ -0,0 +1,474 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public class AltErrors
+ {
+ public const string errorNotFound = "notFound";
+ public const string errorSceneNotFound = "sceneNotFound";
+ public const string errorPropertyNotFound = "propertyNotFound";
+ public const string errorMethodNotFound = "methodNotFound";
+ public const string errorComponentNotFound = "componentNotFound";
+ public const string errorAssemblyNotFound = "assemblyNotFound";
+ public const string errorCouldNotPerformOperation = "couldNotPerformOperation";
+ public const string errorCouldNotParseJsonString = "couldNotParseJsonString";
+ public const string errorMethodWithGivenParametersNotFound = "methodWithGivenParametersNotFound";
+ public const string errorInvalidParameterType = "invalidParameterType";
+ public const string errorFailedToParseArguments = "failedToParseMethodArguments";
+ public const string errorObjectWasNotFound = "objectNotFound";
+ public const string errorPropertyNotSet = "propertyCannotBeSet";
+ public const string errorNullReference = "nullReferenceException";
+ public const string errorUnknownError = "unknownError";
+ public const string errorFormatException = "formatException";
+ public const string errorCameraNotFound = "cameraNotFound";
+ public const string errorIndexOutOfRange = "indexOutOfRange";
+ public const string errorInvalidCommand = "invalidCommand";
+ public const string errorInvalidPath = "invalidPath";
+ public const string errorInputModule = "ALTTESTERNotAddedAsDefineVariable";
+ }
+
+ ///
+ /// Base exception class for AltTester.
+ ///
+ public class AltException : Exception
+ {
+ public AltException()
+ {
+ }
+
+ public AltException(string message) : base(message)
+ {
+ }
+
+ public AltException(string message, Exception inner) : base(message, inner)
+ {
+ }
+ }
+
+ ///
+ /// Raised when the driver can not connect to the server.
+ ///
+ public class ConnectionException : AltException
+ {
+ public ConnectionException()
+ {
+ }
+
+ public ConnectionException(string message) : base(message)
+ {
+ }
+ }
+
+ ///
+ /// Raised when the client connection timeouts.
+ ///
+ public class ConnectionTimeoutException : ConnectionException
+ {
+ public ConnectionTimeoutException()
+ {
+ }
+
+ public ConnectionTimeoutException(string message) : base(message)
+ {
+ }
+ }
+
+ ///
+ /// Raised when the client tries to connect to a server without an app.
+ ///
+ public class NoAppConnectedException : ConnectionException
+ {
+ public NoAppConnectedException()
+ {
+ }
+
+ public NoAppConnectedException(string message) : base(message)
+ {
+ }
+ }
+
+ ///
+ /// Raised when the app closed the connection or unexpectedly disconnected.
+ ///
+ public class AppDisconnectedException : ConnectionException
+ {
+ public AppDisconnectedException()
+ {
+ }
+
+ public AppDisconnectedException(string message) : base(message)
+ {
+ }
+ }
+
+ ///
+ /// Raised when the client tries to connect to a server with a driver already connected. Free accounts are limited to a single driver connection at a time.
+ ///
+ public class MultipleDriversException : ConnectionException
+ {
+ public MultipleDriversException()
+ {
+ }
+
+ public MultipleDriversException(string message) : base(message)
+ {
+ }
+ }
+
+ ///
+ /// Raised when the client tries to connect to a server at the same time with another driver
+ ///
+ public class MultipleDriversTryingToConnectException : ConnectionException
+ {
+ public MultipleDriversTryingToConnectException()
+ {
+ }
+
+ public MultipleDriversTryingToConnectException(string message) : base(message)
+ {
+ }
+ }
+
+ public class NotFoundException : AltException
+ {
+ public NotFoundException()
+ {
+ }
+
+ public NotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class CameraNotFoundException : AltException
+ {
+ public CameraNotFoundException()
+ {
+ }
+
+ public CameraNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class PropertyNotFoundException : AltException
+ {
+ public PropertyNotFoundException()
+ {
+ }
+
+ public PropertyNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class MethodNotFoundException : AltException
+ {
+ public MethodNotFoundException()
+ {
+ }
+
+ public MethodNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class ComponentNotFoundException : AltException
+ {
+ public ComponentNotFoundException()
+ {
+ }
+
+ public ComponentNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AssemblyNotFoundException : AltException
+ {
+ public AssemblyNotFoundException()
+ {
+ }
+
+ public AssemblyNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class CouldNotPerformOperationException : AltException
+ {
+ public CouldNotPerformOperationException()
+ {
+ }
+
+ public CouldNotPerformOperationException(string message) : base(message)
+ {
+ }
+ }
+
+ public class InvalidParameterTypeException : AltException
+ {
+ public InvalidParameterTypeException()
+ {
+ }
+
+ public InvalidParameterTypeException(string message) : base(message)
+ {
+ }
+ }
+
+ public class MethodWithGivenParametersNotFoundException : AltException
+ {
+ public MethodWithGivenParametersNotFoundException()
+ {
+ }
+
+ public MethodWithGivenParametersNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class FailedToParseArgumentsException : AltException
+ {
+ public FailedToParseArgumentsException()
+ {
+ }
+
+ public FailedToParseArgumentsException(string message) : base(message)
+ {
+ }
+ }
+
+ public class ObjectWasNotFoundException : AltException
+ {
+ public ObjectWasNotFoundException()
+ {
+ }
+
+ public ObjectWasNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class NullReferenceException : AltException
+ {
+ public NullReferenceException()
+ {
+ }
+
+ public NullReferenceException(string message) : base(message)
+ {
+ }
+ }
+
+ public class UnknownErrorException : AltException
+ {
+ public UnknownErrorException()
+ {
+ }
+
+ public UnknownErrorException(string message) : base(message)
+ {
+ }
+ }
+
+ public class FormatException : AltException
+ {
+ public FormatException()
+ {
+ }
+
+ public FormatException(string message) : base(message)
+ {
+ }
+ }
+
+ public class WaitTimeOutException : AltException
+ {
+ public WaitTimeOutException()
+ {
+ }
+
+ public WaitTimeOutException(string message) : base(message)
+ {
+ }
+ }
+
+ public class CommandResponseTimeoutException : AltException
+ {
+ public CommandResponseTimeoutException()
+ {
+ }
+
+ public CommandResponseTimeoutException(string message) : base(message)
+ {
+ }
+ }
+
+ public class CommandNotFoundException : AltException
+ {
+ public CommandNotFoundException()
+ {
+ }
+
+ public CommandNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class InvalidCommandException : AltException
+ {
+ public InvalidCommandException(Exception innerException) : base(AltErrors.errorInvalidCommand, innerException)
+ {
+ }
+
+ public InvalidCommandException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AltRecvallException : AltException
+ {
+ public AltRecvallException()
+ {
+ }
+
+ public AltRecvallException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AltRecvallMessageIdException : AltRecvallException
+ {
+ public AltRecvallMessageIdException()
+ {
+ }
+
+ public AltRecvallMessageIdException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AltRecvallMessageFormatException : AltRecvallException
+ {
+ public AltRecvallMessageFormatException()
+ {
+ }
+
+ public AltRecvallMessageFormatException(string message) : base(message)
+ {
+ }
+ }
+
+ public class ReversePortForwardingException : AltException
+ {
+ public ReversePortForwardingException()
+ {
+ }
+
+ public ReversePortForwardingException(string message) : base(message)
+ {
+ }
+
+ public ReversePortForwardingException(string message, Exception inner) : base(message, inner)
+ {
+ }
+ }
+
+ public class AltInvalidServerResponse : AltException
+ {
+ public AltInvalidServerResponse(string expected, string received) : base(string.Format("Expected to get response '{0}'; Got '{1}'", expected, received))
+ {
+ }
+ }
+
+ public class InvalidPathException : AltException
+ {
+ public InvalidPathException()
+ {
+ }
+
+ public InvalidPathException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AltInputModuleException : AltException
+ {
+ public AltInputModuleException()
+ {
+ }
+
+ public AltInputModuleException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AltInnerException : AltException
+ {
+ public AltInnerException(Exception inner) : base(AltErrors.errorUnknownError, inner)
+ {
+ }
+ }
+
+ public class AltCameraNotFoundException : AltException
+ {
+ public AltCameraNotFoundException()
+ {
+ }
+
+ public AltCameraNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class AltPathNotFoundException : AltException
+ {
+ public AltPathNotFoundException()
+ {
+ }
+
+ public AltPathNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class SceneNotFoundException : AltException
+ {
+ public SceneNotFoundException()
+ {
+ }
+
+ public SceneNotFoundException(string message) : base(message)
+ {
+ }
+ }
+
+ public class ResponseFormatException : AltException
+ {
+ public ResponseFormatException()
+ {
+ }
+
+ public ResponseFormatException(Type t, string data) : base("Could not deserialize response data: `" + data + "` into " + t.FullName)
+ {
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/AltErrors.cs.meta b/Assets/AltTester/Runtime/AltDriver/AltErrors.cs.meta
new file mode 100644
index 00000000..2ea9b702
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltErrors.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0a82f7fc0b31f2a4da45397e20d01065
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/AltReversePortForwarding.cs b/Assets/AltTester/Runtime/AltDriver/AltReversePortForwarding.cs
new file mode 100644
index 00000000..d0068bc8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltReversePortForwarding.cs
@@ -0,0 +1,237 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ ///
+ /// API to interact with adb programmatically
+ ///
+ public class AltReversePortForwarding
+ {
+
+#if UNITY_EDITOR
+ private static readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+#endif
+ ///
+ /// Calls adb reverse [-s {deviceId}] tcp:{remotePort} tcp:{localPort}
+ ///
+ /// The device's port to reverse from
+ /// The local port to reverse to
+ /// The id of the device
+ ///
+ /// The adb path.
+ /// If no adb path is provided, it tries to use adb from ${ANDROID_SDK_ROOT}/platform-tools/adb
+ /// if ANDROID_SDK_ROOT env variable is not set, it tries to execute adb from path.
+ ///
+ public static string ReversePortForwardingAndroid(int remotePort = 13000, int localPort = 13000, string deviceId = "", string adbPath = "")
+ {
+ adbPath = GetAdbPath(adbPath);
+ string arguments;
+ if (deviceId.Equals(""))
+ arguments = "reverse tcp:" + remotePort + " tcp:" + localPort;
+ else
+ {
+ arguments = "-s " + deviceId + " reverse" + " tcp:" + remotePort + " tcp:" + localPort;
+ }
+ try
+ {
+
+ var process = startProcess(adbPath, arguments);
+
+ string stdout = process.StandardError.ReadToEnd();
+ process.WaitForExit();
+ if (stdout.Length > 0)
+ {
+ return stdout;
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new ReversePortForwardingException("Error while running command: " + adbPath + " " + arguments, ex);
+
+ }
+ return "Ok";
+ }
+
+ ///
+ /// Calls `adb reverse --remove-all`
+ ///
+ ///
+ /// The adb path.
+ /// If no adb path is provided, it tries to use adb from ${ANDROID_SDK_ROOT}/platform-tools/adb
+ /// if ANDROID_SDK_ROOT env variable is not set, it tries to execute adb from path.
+ ///
+ public static void RemoveAllReversePortForwardingsAndroid(string adbPath = "")
+ {
+ adbPath = GetAdbPath(adbPath);
+ string arguments = "reverse --remove-all";
+ try
+ {
+ var process = startProcess(adbPath, arguments);
+ process.WaitForExit();
+ }
+ catch (Exception ex)
+ {
+ throw new ReversePortForwardingException("Error while running command: " + adbPath + " " + arguments, ex);
+ }
+ }
+
+ ///
+ /// Calls `adb reverse --remove [-s {deviceId}] tcp:{remotePort}`
+ ///
+ /// The device's port to be removed
+ /// The id of the device to be removed
+ ///
+ /// The adb path.
+ /// If no adb path is provided, it tries to use adb from ${ANDROID_SDK_ROOT}/platform-tools/adb
+ /// if ANDROID_SDK_ROOT env variable is not set, it tries to execute adb from path.
+ ///
+ public static void RemoveReversePortForwardingAndroid(int remotePort = 13000, string deviceId = "", string adbPath = "")
+ {
+ adbPath = GetAdbPath(adbPath);
+ string arguments = "reverse --remove tcp:" + remotePort;
+
+ if (!string.IsNullOrEmpty(deviceId))
+ {
+ arguments = "-s " + deviceId + " " + arguments;
+ }
+ try
+ {
+ var process = startProcess(adbPath, arguments);
+ process.WaitForExit();
+ }
+ catch (System.ComponentModel.Win32Exception ex)
+ {
+ throw new ReversePortForwardingException("Error while running command: " + adbPath + " " + arguments, ex);
+ }
+ }
+
+ ///
+ /// Runs `adb devices`
+ ///
+ ///
+ /// The adb path.
+ /// If no adb path is provided, it tries to use adb from ${ANDROID_SDK_ROOT}/platform-tools/adb
+ /// if ANDROID_SDK_ROOT env varibale is not set, it tries to execute adb from path.
+ ///
+ public static List GetDevicesAndroid(string adbPath = "")
+ {
+ adbPath = GetAdbPath(adbPath);
+ var arguments = "devices";
+ try
+ {
+ var process = startProcess(adbPath, arguments);
+ var devices = new List();
+
+ while (!process.StandardOutput.EndOfStream)
+ {
+ string line = process.StandardOutput.ReadLine();
+ if (line.Length > 0 && !line.StartsWith("List "))
+ {
+ var parts = line.Split('\t');
+ string deviceId = parts[0];
+ devices.Add(new AltDevice(deviceId, "Android"));
+ }
+ }
+ process.WaitForExit();
+ process.StandardError.ReadToEnd();
+ return devices;
+ }
+ catch (Exception ex)
+ {
+ throw new ReversePortForwardingException("Error while running command: " + adbPath + " " + arguments, ex);
+ }
+ }
+ public static List GetReversedDevicesAndroid(string adbPath = "")
+ {
+ adbPath = GetAdbPath(adbPath);
+ var arguments = "reverse --list";
+ try
+ {
+ var process = startProcess(adbPath, arguments);
+ var devices = new List();
+
+ while (!process.StandardOutput.EndOfStream)
+ {
+ string line = process.StandardOutput.ReadLine();
+ if (line.Length > 0)
+ {
+ try
+ {
+ var parts = line.Split(' ');
+ string deviceId = parts[0];
+ int remotePort = int.Parse(parts[1].Split(':')[1]);
+ int localPort = int.Parse(parts[2].Split(':')[1]);
+ devices.Add(new AltDevice(deviceId, "Android", remotePort, localPort, true));
+ }
+ catch (System.FormatException)
+ {
+#if UNITY_EDITOR
+
+ logger.Warn("adb reverse also has: " + line + "; which was not included in the list of devices");
+#endif
+ }
+ }
+ }
+ process.WaitForExit();
+ return devices;
+ }
+ catch (Exception ex)
+ {
+ throw new ReversePortForwardingException("Error while running command: " + adbPath + " " + arguments, ex);
+ }
+ }
+
+ public static string GetAdbPath(string adbPath)
+ {
+ if (!string.IsNullOrEmpty(adbPath)) return adbPath;
+ var androidSdkRoot = Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT");
+ if (!string.IsNullOrEmpty(androidSdkRoot))
+ {
+ return Path.Combine(androidSdkRoot, "platform-tools", "adb");
+ }
+ return "adb";
+ }
+
+ private static Process startProcess(string processPath, string arguments)
+ {
+ var process = new Process();
+ var startInfo = new ProcessStartInfo
+ {
+ CreateNoWindow = true,
+ WindowStyle = ProcessWindowStyle.Minimized,
+ UseShellExecute = false,
+ RedirectStandardOutput = true,
+ RedirectStandardError = true,
+ FileName = processPath,
+ Arguments = arguments
+ };
+ process.StartInfo = startInfo;
+ process.Start();
+
+ return process;
+ }
+ }
+}
+
diff --git a/Assets/AltTester/Runtime/AltDriver/AltReversePortForwarding.cs.meta b/Assets/AltTester/Runtime/AltDriver/AltReversePortForwarding.cs.meta
new file mode 100644
index 00000000..373fc133
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltReversePortForwarding.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 64224ead00c0db444bca871fd0a2a025
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/AltTester.AltTesterUnitySDK.Driver.asmdef b/Assets/AltTester/Runtime/AltDriver/AltTester.AltTesterUnitySDK.Driver.asmdef
new file mode 100644
index 00000000..8a06c5e2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltTester.AltTesterUnitySDK.Driver.asmdef
@@ -0,0 +1,18 @@
+{
+ "name": "AltTester.AltTesterUnitySDK.Driver",
+ "rootNamespace": "",
+ "references": [],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": true,
+ "precompiledReferences": [
+ "NLog.dll",
+ "Newtonsoft.Json.dll",
+ "altwebsocket-sharp.dll"
+ ],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Assets/AltTester/Runtime/AltDriver/AltTester.AltTesterUnitySDK.Driver.asmdef.meta b/Assets/AltTester/Runtime/AltDriver/AltTester.AltTesterUnitySDK.Driver.asmdef.meta
new file mode 100644
index 00000000..9d0cd926
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/AltTester.AltTesterUnitySDK.Driver.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 478b585cfbb242f4c977b9aec772e042
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands.meta b/Assets/AltTester/Runtime/AltDriver/Commands.meta
new file mode 100644
index 00000000..ce79d7a5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fa50d2805558da940bf60ea9b3d76faf
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltBaseCommand.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltBaseCommand.cs
new file mode 100644
index 00000000..58b90d96
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltBaseCommand.cs
@@ -0,0 +1,50 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltBaseCommand
+ {
+ readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ protected readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings
+ {
+ ContractResolver = new DefaultContractResolver(),
+ ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
+ Culture = System.Globalization.CultureInfo.InvariantCulture
+ };
+ protected IDriverCommunication CommHandler;
+
+ public AltBaseCommand(IDriverCommunication commHandler)
+ {
+ this.CommHandler = commHandler;
+ }
+
+ protected void ValidateResponse(string expected, string received)
+ {
+ if (!expected.Equals(received, StringComparison.InvariantCulture))
+ {
+ throw new AltInvalidServerResponse(expected, received);
+ }
+ }
+
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltBaseCommand.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltBaseCommand.cs.meta
new file mode 100644
index 00000000..f4c31ec4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltBaseCommand.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f656f7ca3cdb47e4cb81160c3cdd3f1f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommandReturningAltElement.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommandReturningAltElement.cs
new file mode 100644
index 00000000..ac246507
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommandReturningAltElement.cs
@@ -0,0 +1,48 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltCommandReturningAltElement : AltBaseCommand
+ {
+ public AltCommandReturningAltElement(IDriverCommunication commHandler) : base(commHandler)
+ {
+ }
+
+ protected AltObject ReceiveAltObject(CommandParams cmdParams)
+ {
+ var altElement = CommHandler.Recvall(cmdParams);
+ if (altElement != null) altElement.CommHandler = CommHandler;
+
+ return altElement;
+ }
+ protected List ReceiveListOfAltObjects(CommandParams cmdParams)
+ {
+ var altElements = CommHandler.Recvall>(cmdParams);
+
+ foreach (var altElement in altElements)
+ {
+ altElement.CommHandler = CommHandler;
+ }
+
+ return altElements;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommandReturningAltElement.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommandReturningAltElement.cs.meta
new file mode 100644
index 00000000..f97a38dd
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommandReturningAltElement.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 17ee0186ba0179140b827f56f1a446c5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands.meta
new file mode 100644
index 00000000..75c7bd66
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b4fce7ea51c98cd49b0434b7d6e1f1d7
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AddNotificationListener.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AddNotificationListener.cs
new file mode 100644
index 00000000..c777f855
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AddNotificationListener.cs
@@ -0,0 +1,43 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using AltTester.AltTesterUnitySDK.Driver.Notifications;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AddNotificationListener : AltBaseCommand
+ {
+ private readonly ActivateNotification cmdParams;
+ private readonly Action callback;
+ private readonly bool overwrite;
+
+ public AddNotificationListener(IDriverCommunication commHandler, NotificationType notificationType, Action callback, bool overwrite) : base(commHandler)
+ {
+ this.cmdParams = new ActivateNotification(notificationType);
+ this.callback = callback;
+ this.overwrite = overwrite;
+ }
+ public void Execute()
+ {
+ this.CommHandler.AddNotificationListener(cmdParams.NotificationType, callback, overwrite);
+ this.CommHandler.Send(this.cmdParams);
+ var data = this.CommHandler.Recvall(this.cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AddNotificationListener.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AddNotificationListener.cs.meta
new file mode 100644
index 00000000..3ec5177d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AddNotificationListener.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 82530a687ecb8924c89ae786a37ef8bc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltGetServerVersion.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltGetServerVersion.cs
new file mode 100644
index 00000000..751871a4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltGetServerVersion.cs
@@ -0,0 +1,32 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetServerVersion : AltBaseCommand
+ {
+ public AltGetServerVersion(IDriverCommunication commHandler) : base(commHandler)
+ {
+ }
+ public string Execute()
+ {
+ var cmdParams = new AltGetServerVersionParams();
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltGetServerVersion.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltGetServerVersion.cs.meta
new file mode 100644
index 00000000..3c65b5e5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltGetServerVersion.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f22af261b4acc8d42b2b049af2b607cf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltResetInput.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltResetInput.cs
new file mode 100644
index 00000000..549fe79a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltResetInput.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using AltTester.AltTesterUnitySDK.Driver.Commands;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltResetInput : AltBaseCommand
+ {
+
+ public AltResetInput(IDriverCommunication communicationHandler) : base(communicationHandler) { }
+ public void Execute()
+ {
+ var cmdParams = new AltResetInputParams();
+ this.CommHandler.Send(cmdParams);
+ var data = this.CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltResetInput.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltResetInput.cs.meta
new file mode 100644
index 00000000..69e93981
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltResetInput.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 61a8dcd3f9a97344891b3be2c7ea0b68
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltSetServerLogging.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltSetServerLogging.cs
new file mode 100644
index 00000000..a9815785
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltSetServerLogging.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSetServerLogging : AltBaseCommand
+ {
+ private readonly AltSetServerLoggingParams cmdParams;
+
+ public AltSetServerLogging(IDriverCommunication commHandler, AltLogger logger, AltLogLevel logLevel) : base(commHandler)
+ {
+ this.cmdParams = new AltSetServerLoggingParams(logger, logLevel);
+ }
+ public void Execute()
+ {
+ this.CommHandler.Send(this.cmdParams);
+ var data = this.CommHandler.Recvall(this.cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltSetServerLogging.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltSetServerLogging.cs.meta
new file mode 100644
index 00000000..dd62af33
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/AltSetServerLogging.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4c8636fa32043e8448b4a1a6882f4e97
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/RemoveNotificationListener.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/RemoveNotificationListener.cs
new file mode 100644
index 00000000..45ed6974
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/RemoveNotificationListener.cs
@@ -0,0 +1,40 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using AltTester.AltTesterUnitySDK.Driver.Notifications;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class RemoveNotificationListener : AltBaseCommand
+ {
+ private readonly DeactivateNotification cmdParams;
+
+ public RemoveNotificationListener(IDriverCommunication commHandler, NotificationType notificationType) : base(commHandler)
+ {
+ this.cmdParams = new DeactivateNotification(notificationType);
+ }
+
+ public void Execute()
+ {
+ this.CommHandler.RemoveNotificationListener(cmdParams.NotificationType);
+ this.CommHandler.Send(this.cmdParams);
+ var data = this.CommHandler.Recvall(this.cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/RemoveNotificationListener.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/RemoveNotificationListener.cs.meta
new file mode 100644
index 00000000..94b109d3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltCommands/RemoveNotificationListener.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7980ffd3b76f6fc4da084e56672ec93a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltGetStaticProperty.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltGetStaticProperty.cs
new file mode 100644
index 00000000..84179a63
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltGetStaticProperty.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetStaticProperty : AltBaseCommand
+ {
+ AltGetObjectComponentPropertyParams cmdParams;
+ public AltGetStaticProperty(IDriverCommunication commHandler, string componentName, string propertyName, string assemblyName, int maxDepth) : base(commHandler)
+ {
+ cmdParams = new AltGetObjectComponentPropertyParams(null, componentName, propertyName, assemblyName, maxDepth);
+ }
+ public T Execute()
+ {
+ CommHandler.Send(cmdParams);
+ T data = CommHandler.Recvall(cmdParams);
+ return data;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltGetStaticProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltGetStaticProperty.cs.meta
new file mode 100644
index 00000000..8ea599f4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltGetStaticProperty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 55ccccea3ff9b504890622d19265947c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltSetStaticProperty.cs b/Assets/AltTester/Runtime/AltDriver/Commands/AltSetStaticProperty.cs
new file mode 100644
index 00000000..461c58f6
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltSetStaticProperty.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using AltTester.AltTesterUnitySDK.Driver.Commands;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSetStaticProperty : AltBaseCommand
+ {
+ AltSetObjectComponentPropertyParams cmdParams;
+
+ public AltSetStaticProperty(IDriverCommunication commHandler, string componentName, string propertyName, string assemblyName, object newValue) : base(commHandler)
+ {
+ var strValue = Newtonsoft.Json.JsonConvert.SerializeObject(newValue);
+ cmdParams = new AltSetObjectComponentPropertyParams(null, componentName, propertyName, assemblyName, strValue);
+ }
+
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("valueSet", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/AltSetStaticProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/AltSetStaticProperty.cs.meta
new file mode 100644
index 00000000..1ef67335
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/AltSetStaticProperty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e8c8307629cbb304984196a46ced6c1f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects.meta
new file mode 100644
index 00000000..cc067d85
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: adf55bb3dc81cdc4ebfd07ea4700af83
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltBaseFindObjects.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltBaseFindObjects.cs
new file mode 100644
index 00000000..b7610e64
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltBaseFindObjects.cs
@@ -0,0 +1,84 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltBaseFindObjects : AltCommandReturningAltElement
+ {
+ public AltBaseFindObjects(IDriverCommunication commHandler) : base(commHandler)
+ {
+ }
+ protected string SetPath(By by, string value)
+ {
+ string path = "";
+ switch (by)
+ {
+ case By.TAG:
+ path = "//*[@tag=" + value + "]";
+ break;
+ case By.LAYER:
+ path = "//*[@layer=" + value + "]";
+ break;
+ case By.NAME:
+ path = "//" + value;
+ break;
+ case By.COMPONENT:
+ path = "//*[@component=" + value + "]";
+ break;
+ case By.PATH:
+ path = value;
+ break;
+ case By.ID:
+ path = "//*[@id=" + value + "]";
+ break;
+ case By.TEXT:
+ path = "//*[@text=" + value + "]";
+ break;
+ }
+ return path;
+ }
+ protected string SetPathContains(By by, string value)
+ {
+ string path = "";
+ switch (by)
+ {
+ case By.TAG:
+ path = "//*[contains(@tag," + value + ")]";
+ break;
+ case By.LAYER:
+ path = "//*[contains(@layer," + value + ")]";
+ break;
+ case By.NAME:
+ path = "//*[contains(@name," + value + ")]";
+ break;
+ case By.COMPONENT:
+ path = "//*[contains(@component," + value + ")]";
+ break;
+ case By.PATH:
+ path = value;
+ break;
+ case By.ID:
+ path = "//*[contains(@id," + value + ")]";
+ break;
+ case By.TEXT:
+ path = "//*[contains(@text," + value + ")]";
+ break;
+ }
+ return path;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltBaseFindObjects.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltBaseFindObjects.cs.meta
new file mode 100644
index 00000000..598c61ab
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltBaseFindObjects.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e8698c0b6313d8846add8e0b91d32fd4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObject.cs
new file mode 100644
index 00000000..c06ce702
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObject.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltFindObject : AltBaseFindObjects
+ {
+ AltFindObjectParams cmdParams;
+
+ public AltFindObject(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled) : base(commHandler)
+ {
+ cameraValue = SetPath(cameraBy, cameraValue);
+ string path = SetPath(by, value);
+ cmdParams = new AltFindObjectParams(path, cameraBy, cameraValue, enabled);
+ }
+
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var altTesterObject = CommHandler.Recvall(cmdParams);
+ altTesterObject.CommHandler = CommHandler;
+ return altTesterObject;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObject.cs.meta
new file mode 100644
index 00000000..8988c79b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 20609111de2d46e4a92be3e5d2e9e3d3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectAtCoordinates.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectAtCoordinates.cs
new file mode 100644
index 00000000..83b62e0d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectAtCoordinates.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltFindObjectAtCoordinates : AltCommandReturningAltElement
+ {
+ AltFindObjectAtCoordinatesParams cmdParams;
+
+ public AltFindObjectAtCoordinates(IDriverCommunication commHandler, AltVector2 coordinates) : base(commHandler)
+ {
+ cmdParams = new AltFindObjectAtCoordinatesParams(coordinates);
+ }
+
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectAtCoordinates.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectAtCoordinates.cs.meta
new file mode 100644
index 00000000..e623295f
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectAtCoordinates.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9f5def34f9b8cbf4c8d580c51dee6626
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectWhichContains.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectWhichContains.cs
new file mode 100644
index 00000000..437c7bc0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectWhichContains.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltFindObjectWhichContains : AltBaseFindObjects
+ {
+ AltFindObjectParams cmdParams;
+
+ public AltFindObjectWhichContains(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled) : base(commHandler)
+ {
+ cmdParams = new AltFindObjectParams(SetPathContains(by, value), cameraBy, SetPath(cameraBy, cameraValue), enabled);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectWhichContains.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectWhichContains.cs.meta
new file mode 100644
index 00000000..a511ceb0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectWhichContains.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 252989b44cd401e4ea012741b4f90147
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjects.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjects.cs
new file mode 100644
index 00000000..16a314bb
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjects.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltFindObjects : AltBaseFindObjects
+ {
+ AltFindObjectsParams cmdParams;
+
+ public AltFindObjects(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled) : base(commHandler)
+ {
+ cmdParams = new AltFindObjectsParams(SetPath(by, value), cameraBy, SetPath(cameraBy, cameraValue), enabled);
+ }
+ public System.Collections.Generic.List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveListOfAltObjects(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjects.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjects.cs.meta
new file mode 100644
index 00000000..e55a3ff8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjects.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 83da4da175e8d514f804d40d0230985b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectsWhichContain.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectsWhichContain.cs
new file mode 100644
index 00000000..d4b49c66
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectsWhichContain.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltFindObjectsWhichContain : AltBaseFindObjects
+ {
+ AltFindObjectsParams cmdParams;
+
+ public AltFindObjectsWhichContain(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled) : base(commHandler)
+ {
+ cmdParams = new AltFindObjectsParams(SetPathContains(by, value), cameraBy, SetPath(cameraBy, cameraValue), enabled);
+
+ }
+ public System.Collections.Generic.List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveListOfAltObjects(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectsWhichContain.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectsWhichContain.cs.meta
new file mode 100644
index 00000000..628af18d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltFindObjectsWhichContain.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 86da41c646effb84bbd08a9d5b627ee9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElements.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElements.cs
new file mode 100644
index 00000000..214415d4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElements.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllElements : AltBaseFindObjects
+ {
+ AltFindObjectsParams cmdParams;
+
+ public AltGetAllElements(IDriverCommunication commHandler, By cameraBy, string cameraValue, bool enabled) : base(commHandler)
+ {
+ cmdParams = new AltFindObjectsParams("//*", cameraBy, SetPath(cameraBy, cameraValue), enabled);
+ }
+ public System.Collections.Generic.List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveListOfAltObjects(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElements.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElements.cs.meta
new file mode 100644
index 00000000..b72f16b3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElements.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b223f0e16faf79444b985f12c0729ebf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElementsLight.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElementsLight.cs
new file mode 100644
index 00000000..c739bc72
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElementsLight.cs
@@ -0,0 +1,36 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllElementsLight : AltBaseFindObjects
+ {
+ AltFindObjectsLightParams cmdParams;
+ public AltGetAllElementsLight(IDriverCommunication commHandler, By cameraBy, string cameraValue, bool enabled) : base(commHandler)
+ {
+ cmdParams = new AltFindObjectsLightParams("//*", cameraBy, SetPath(cameraBy, cameraValue), enabled);
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+
+ return CommHandler.Recvall>(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElementsLight.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElementsLight.cs.meta
new file mode 100644
index 00000000..4091b163
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllElementsLight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ac6782f979edaea44a0140ed3c922f61
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllLoadedScenesAndObjects.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllLoadedScenesAndObjects.cs
new file mode 100644
index 00000000..31dd68cc
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllLoadedScenesAndObjects.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllLoadedScenesAndObjects : AltBaseFindObjects
+ {
+
+ private AltGetAllLoadedScenesAndObjectsParams cmdParams;
+ public AltGetAllLoadedScenesAndObjects(IDriverCommunication commHandler, bool enabled) : base(commHandler)
+ {
+ cmdParams = new AltGetAllLoadedScenesAndObjectsParams("//*", By.NAME, "", enabled);
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllLoadedScenesAndObjects.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllLoadedScenesAndObjects.cs.meta
new file mode 100644
index 00000000..45420269
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltGetAllLoadedScenesAndObjects.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b11c280f784216c4393854292f55e9bb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForComponentProperty.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForComponentProperty.cs
new file mode 100644
index 00000000..c8c7ebdc
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForComponentProperty.cs
@@ -0,0 +1,65 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltWaitForComponentProperty : AltBaseFindObjects
+ {
+ readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ AltObject altObject;
+ string componentName;
+ string propertyName;
+ T propertyValue;
+ string assembly;
+ double timeout;
+ double interval;
+
+ public AltWaitForComponentProperty(IDriverCommunication commHandler, string componentName, string propertyName, T propertyValue, string assemblyName, double timeout, double interval, AltObject altObject) : base(commHandler)
+ {
+ this.altObject = altObject;
+ this.componentName = componentName;
+ this.propertyName = propertyName;
+ this.propertyValue = propertyValue;
+ this.assembly = assemblyName;
+ this.timeout = timeout;
+ this.interval = interval;
+ if (timeout <= 0) throw new ArgumentOutOfRangeException("timeout");
+ if (interval <= 0) throw new ArgumentOutOfRangeException("interval");
+ }
+ public T Execute()
+ {
+ double time = 0;
+ while (time < timeout)
+ {
+ logger.Debug($"Waiting for property {propertyName} to be {propertyValue}.");
+ T propertyFound = altObject.GetComponentProperty(componentName, propertyName, assembly);
+ if (propertyFound == null && propertyValue == null) //avoid null reference exception
+ return propertyFound;
+ if (propertyFound.Equals(propertyValue))
+ return propertyFound;
+
+ Thread.Sleep(System.Convert.ToInt32(interval * 1000));
+ time += interval;
+ }
+ throw new WaitTimeOutException($"Property {propertyName} was not {propertyValue} after {timeout} seconds");
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForComponentProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForComponentProperty.cs.meta
new file mode 100644
index 00000000..f9054f9b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForComponentProperty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c8249de1620490949b524fa42bf80b1e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObject.cs
new file mode 100644
index 00000000..ffba3f1c
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObject.cs
@@ -0,0 +1,65 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltWaitForObject : AltBaseFindObjects
+ {
+ readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ AltFindObject findObject;
+ string path;
+ double timeout;
+ double interval;
+
+ public AltWaitForObject(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled, double timeout, double interval) : base(commHandler)
+ {
+ findObject = new AltFindObject(CommHandler, by, value, cameraBy, cameraValue, enabled);
+ path = SetPath(by, value);
+ this.timeout = timeout;
+ this.interval = interval;
+ if (timeout <= 0) throw new ArgumentOutOfRangeException("timeout");
+ if (interval <= 0) throw new ArgumentOutOfRangeException("interval");
+ }
+ public AltObject Execute()
+ {
+ double time = 0;
+ AltObject altElement = null;
+
+ logger.Debug("Waiting for element " + path + " to be present.");
+ while (time < timeout)
+ {
+ try
+ {
+ altElement = findObject.Execute();
+ break;
+ }
+ catch (NotFoundException)
+ {
+ Thread.Sleep(System.Convert.ToInt32(interval * 1000));
+ time += interval;
+ }
+ }
+ if (altElement != null)
+ return altElement;
+ throw new WaitTimeOutException("Element " + path + " not loaded after " + timeout + " seconds");
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObject.cs.meta
new file mode 100644
index 00000000..b1bd1d23
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 011f054f2cd6f9749abf0aaf079389df
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectNotBePresent.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectNotBePresent.cs
new file mode 100644
index 00000000..27721f10
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectNotBePresent.cs
@@ -0,0 +1,68 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltWaitForObjectNotBePresent : AltBaseFindObjects
+ {
+ readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ AltFindObject findObject;
+ private readonly string path;
+ double timeout;
+ double interval;
+ public AltWaitForObjectNotBePresent(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled, double timeout, double interval) : base(commHandler)
+ {
+ findObject = new AltFindObject(commHandler, by, value, cameraBy, cameraValue, enabled);
+ path = SetPath(by, value);
+
+ this.timeout = timeout;
+ this.interval = interval;
+ if (timeout <= 0) throw new ArgumentOutOfRangeException("timeout");
+ if (interval <= 0) throw new ArgumentOutOfRangeException("interval");
+ }
+ public void Execute()
+ {
+ double time = 0;
+ bool found = false;
+ AltObject altElement;
+
+ logger.Debug("Waiting for element " + path + " to not be present");
+ while (time < timeout)
+ {
+ found = false;
+ try
+ {
+ altElement = findObject.Execute();
+ found = true;
+ Thread.Sleep(System.Convert.ToInt32(interval * 1000));
+ time += interval;
+
+ }
+ catch (NotFoundException)
+ {
+ break;
+ }
+ }
+ if (found)
+ throw new WaitTimeOutException("Element " + path + " still found after " + timeout + " seconds");
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectNotBePresent.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectNotBePresent.cs.meta
new file mode 100644
index 00000000..5649e273
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectNotBePresent.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c8328a664360ab94faa581f0241f4587
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectWhichContains.cs b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectWhichContains.cs
new file mode 100644
index 00000000..54008dc3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectWhichContains.cs
@@ -0,0 +1,65 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltWaitForObjectWhichContains : AltBaseFindObjects
+ {
+ readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ private AltFindObjectWhichContains findObject;
+ private readonly string path;
+ private readonly double timeout;
+ private readonly double interval;
+
+ public AltWaitForObjectWhichContains(IDriverCommunication commHandler, By by, string value, By cameraBy, string cameraValue, bool enabled, double timeout, double interval) : base(commHandler)
+ {
+ path = SetPath(by, value);
+ if (timeout <= 0) throw new ArgumentOutOfRangeException("timeout");
+ if (interval <= 0) throw new ArgumentOutOfRangeException("interval");
+ this.timeout = timeout;
+ this.interval = interval;
+ findObject = new AltFindObjectWhichContains(CommHandler, by, value, cameraBy, cameraValue, enabled);
+ }
+ public AltObject Execute()
+ {
+ double time = 0;
+ AltObject altElement = null;
+
+ logger.Debug("Waiting for element " + path + " to be present.");
+ while (time < timeout)
+ {
+ try
+ {
+ altElement = findObject.Execute();
+ break;
+ }
+ catch (NotFoundException)
+ {
+ Thread.Sleep(System.Convert.ToInt32(interval * 1000));
+ time += interval;
+ }
+ }
+ if (altElement != null)
+ return altElement;
+ throw new WaitTimeOutException("Element " + path + " not loaded after " + timeout + " seconds");
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectWhichContains.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectWhichContains.cs.meta
new file mode 100644
index 00000000..7fade734
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/FindObjects/AltWaitForObjectWhichContains.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d8f58364e30311f4597103f8c7234482
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions.meta
new file mode 100644
index 00000000..ea7bc69a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1a3efc9a42e8e324bacb85eeb0d151ed
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltBeginTouch.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltBeginTouch.cs
new file mode 100644
index 00000000..6e499e3c
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltBeginTouch.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltBeginTouch : AltBaseCommand
+ {
+ AltBeginTouchParams cmdParams;
+
+ public AltBeginTouch(IDriverCommunication commHandler, AltVector2 coordinates) : base(commHandler)
+ {
+ this.cmdParams = new AltBeginTouchParams(coordinates);
+ }
+ public int Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams); //finger id
+ //TODO: add handling for "Finished"
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltBeginTouch.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltBeginTouch.cs.meta
new file mode 100644
index 00000000..f6860ab5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltBeginTouch.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4d1001395eb57504c9091c3fd1345668
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltClickCoordinates.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltClickCoordinates.cs
new file mode 100644
index 00000000..b03e23da
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltClickCoordinates.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltClickCoordinates : AltBaseCommand
+ {
+ AltClickCoordinatesParams cmdParams;
+ public AltClickCoordinates(IDriverCommunication commHandler, AltVector2 coordinates, int count, float interval, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltClickCoordinatesParams(coordinates, count, interval, wait);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ string data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams); ;
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltClickCoordinates.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltClickCoordinates.cs.meta
new file mode 100644
index 00000000..9e823065
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltClickCoordinates.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 998dc5b04f647c54e87a11c19bb6cc40
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltEndTouch.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltEndTouch.cs
new file mode 100644
index 00000000..a39b384b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltEndTouch.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltEndTouch : AltBaseCommand
+ {
+ AltEndTouchParams cmdParams;
+
+ public AltEndTouch(IDriverCommunication commHandler, int fingerId) : base(commHandler)
+ {
+ this.cmdParams = new AltEndTouchParams(fingerId);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltEndTouch.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltEndTouch.cs.meta
new file mode 100644
index 00000000..11953ed3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltEndTouch.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 35a6dfc77c1311049802c1a87d762ab3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysDown.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysDown.cs
new file mode 100644
index 00000000..8d13dcac
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysDown.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltKeysDown : AltBaseCommand
+ {
+ AltKeysDownParams cmdParams;
+
+ public AltKeysDown(IDriverCommunication commHandler, AltKeyCode[] keyCodes, float power) : base(commHandler)
+ {
+ this.cmdParams = new AltKeysDownParams(keyCodes, power);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysDown.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysDown.cs.meta
new file mode 100644
index 00000000..0d5bc99f
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysDown.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2c5ee5c5d0a9f314fac19992f98c0927
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysUp.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysUp.cs
new file mode 100644
index 00000000..37f5a5dc
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysUp.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltKeysUp : AltBaseCommand
+ {
+ AltKeysUpParams cmdParams;
+
+ public AltKeysUp(IDriverCommunication commHandler, AltKeyCode[] keyCodes) : base(commHandler)
+ {
+ this.cmdParams = new AltKeysUpParams(keyCodes);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysUp.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysUp.cs.meta
new file mode 100644
index 00000000..282962e7
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltKeysUp.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 122317d70e9efc04fb2743690a2c6c7e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveMouse.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveMouse.cs
new file mode 100644
index 00000000..42ad3c9b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveMouse.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltMoveMouse : AltBaseCommand
+ {
+ AltMoveMouseParams cmdParams;
+ public AltMoveMouse(IDriverCommunication commHandler, AltVector2 coordinates, float duration, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltMoveMouseParams(coordinates, duration, wait);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveMouse.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveMouse.cs.meta
new file mode 100644
index 00000000..50f82c81
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveMouse.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5fe75ad0d59b7db41a9d4acf20643188
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveTouch.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveTouch.cs
new file mode 100644
index 00000000..8ac72ca7
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveTouch.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltMoveTouch : AltBaseCommand
+ {
+ AltMoveTouchParams cmdParams;
+
+ public AltMoveTouch(IDriverCommunication commHandler, int fingerId, AltVector2 coordinates) : base(commHandler)
+ {
+ this.cmdParams = new AltMoveTouchParams(fingerId, coordinates);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveTouch.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveTouch.cs.meta
new file mode 100644
index 00000000..c8d03066
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMoveTouch.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5695d196ff25b1a41a49576b996f1545
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMultipointSwipe.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMultipointSwipe.cs
new file mode 100644
index 00000000..70c4147a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMultipointSwipe.cs
@@ -0,0 +1,42 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltMultipointSwipe : AltBaseCommand
+ {
+ AltMultipointSwipeParams cmdParams;
+
+ public AltMultipointSwipe(IDriverCommunication commHandler, AltVector2[] positions, float duration, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltMultipointSwipeParams(positions, duration, wait);
+ }
+
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMultipointSwipe.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMultipointSwipe.cs.meta
new file mode 100644
index 00000000..0a47dfe4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltMultipointSwipe.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d858b045ca21be746b1a37c9764ba9d1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltPressKeys.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltPressKeys.cs
new file mode 100644
index 00000000..010af713
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltPressKeys.cs
@@ -0,0 +1,43 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltPressKeys : AltBaseCommand
+ {
+ AltPressKeyboardKeysParams cmdParams;
+ public AltPressKeys(IDriverCommunication commHandler, AltKeyCode[] keyCodes, float power, float duration, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltPressKeyboardKeysParams(keyCodes, power, duration, wait);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+
+ if (cmdParams.wait)
+ {
+ foreach (AltKeyCode key in cmdParams.keyCodes)
+ {
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltPressKeys.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltPressKeys.cs.meta
new file mode 100644
index 00000000..c90b3426
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltPressKeys.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4b3df944b98272b4a8afd6d5740dfc9d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltScroll.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltScroll.cs
new file mode 100644
index 00000000..d4ff6358
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltScroll.cs
@@ -0,0 +1,40 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltScroll : AltBaseCommand
+ {
+ AltScrollParams cmdParams;
+ public AltScroll(IDriverCommunication commHandler, float speed, float speedHorizontal, float duration, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltScrollParams(speed, duration, wait, speedHorizontal);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltScroll.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltScroll.cs.meta
new file mode 100644
index 00000000..74ba78d5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltScroll.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 14547a94cbb15844e9e156a7a427461d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltSwipe.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltSwipe.cs
new file mode 100644
index 00000000..94274d8d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltSwipe.cs
@@ -0,0 +1,40 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSwipe : AltBaseCommand
+ {
+ AltSwipeParams cmdParams;
+ public AltSwipe(IDriverCommunication commHandler, AltVector2 start, AltVector2 end, float duration, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltSwipeParams(start, end, duration, wait);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltSwipe.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltSwipe.cs.meta
new file mode 100644
index 00000000..a9720ecc
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltSwipe.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3197f8554d7a6d74ab3e2f7974e80af2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTapCoordinates.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTapCoordinates.cs
new file mode 100644
index 00000000..ebb41cfe
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTapCoordinates.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltTapCoordinates : AltBaseCommand
+ {
+ AltTapCoordinatesParams cmdParams;
+ public AltTapCoordinates(IDriverCommunication commHandler, AltVector2 coordinates, int count, float interval, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltTapCoordinatesParams(coordinates, count, interval, wait);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ string data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams); ;
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTapCoordinates.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTapCoordinates.cs.meta
new file mode 100644
index 00000000..aea8209c
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTapCoordinates.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 33b142d3e1ae84944b98aad11e9c7a44
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTilt.cs b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTilt.cs
new file mode 100644
index 00000000..3a681510
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTilt.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltTilt : AltBaseCommand
+ {
+ AltTiltParams cmdParams;
+ public AltTilt(IDriverCommunication commHandler, AltVector3 acceleration, float duration, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltTiltParams(acceleration, duration, wait);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ string data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ if (cmdParams.wait)
+ {
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTilt.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTilt.cs.meta
new file mode 100644
index 00000000..fbadecf7
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/InputActions/AltTilt.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ab4e07ef0ca377c4fa78439bee68cacd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands.meta
new file mode 100644
index 00000000..b74b501b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: dd5cc0b7d8cb05a48ac3912f5d2331f1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallComponentMethod.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallComponentMethod.cs
new file mode 100644
index 00000000..2bdd58f0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallComponentMethod.cs
@@ -0,0 +1,38 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Linq;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltCallComponentMethod : AltBaseCommand
+ {
+ AltCallComponentMethodForObjectParams cmdParams;
+
+ public AltCallComponentMethod(IDriverCommunication commHandler, string componentName, string methodName, object[] parameters, string[] typeOfParameters, string assembly, AltObject altObject) : base(commHandler)
+ {
+ cmdParams = new AltCallComponentMethodForObjectParams(altObject, componentName, methodName, parameters.Select(p => JsonConvert.SerializeObject(p, JsonSerializerSettings)).ToArray(), typeOfParameters, assembly);
+ }
+ public T Execute()
+ {
+ CommHandler.Send(cmdParams);
+ T data = CommHandler.Recvall(cmdParams);
+ return data;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallComponentMethod.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallComponentMethod.cs.meta
new file mode 100644
index 00000000..bfc5da05
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallComponentMethod.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6a5c266c9891070449ed054c49372565
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallStaticMethod.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallStaticMethod.cs
new file mode 100644
index 00000000..6251e203
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallStaticMethod.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Linq;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltCallStaticMethod : AltBaseCommand
+ {
+ AltCallComponentMethodForObjectParams cmdParams;
+
+ public AltCallStaticMethod(IDriverCommunication commHandler, string typeName, string methodName, object[] parameters, string[] typeOfParameters, string assemblyName) : base(commHandler)
+ {
+ cmdParams = new AltCallComponentMethodForObjectParams(null, typeName, methodName, parameters.Select(p => JsonConvert.SerializeObject(p, JsonSerializerSettings)).ToArray(), typeOfParameters, assemblyName);
+ }
+ public T Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallStaticMethod.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallStaticMethod.cs.meta
new file mode 100644
index 00000000..0bb1d398
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltCallStaticMethod.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ccb58990b540a3247a1c486ff89a249b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltClickElement.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltClickElement.cs
new file mode 100644
index 00000000..35b155c0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltClickElement.cs
@@ -0,0 +1,45 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltClickElement : AltCommandReturningAltElement
+ {
+ AltClickElementParams cmdParams;
+
+ public AltClickElement(IDriverCommunication commHandler, AltObject altObject, int count, float interval, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltClickElementParams(
+ altObject,
+ count,
+ interval,
+ wait);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var element = ReceiveAltObject(cmdParams);
+
+ if (cmdParams.wait)
+ {
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ return element;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltClickElement.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltClickElement.cs.meta
new file mode 100644
index 00000000..2f4a7902
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltClickElement.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d016a33b5d5ed3744bf62e3fba329898
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltDragObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltDragObject.cs
new file mode 100644
index 00000000..47a900b8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltDragObject.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltDragObject : AltCommandReturningAltElement
+ {
+ AltDragObjectParams cmdParams;
+ public AltDragObject(IDriverCommunication commHandler, AltVector2 position, AltObject altObject) : base(commHandler)
+ {
+ cmdParams = new AltDragObjectParams(altObject, position);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltDragObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltDragObject.cs.meta
new file mode 100644
index 00000000..c2621a1b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltDragObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 408615ce07cf9de47a78b58a0c05c145
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllComponents.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllComponents.cs
new file mode 100644
index 00000000..872a78d6
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllComponents.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllComponents : AltBaseCommand
+ {
+ AltGetAllComponentsParams cmdParams;
+ public AltGetAllComponents(IDriverCommunication commHandler, AltObject altObject) : base(commHandler)
+ {
+ cmdParams = new AltGetAllComponentsParams(altObject.id);
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllComponents.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllComponents.cs.meta
new file mode 100644
index 00000000..109b79bb
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllComponents.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8eb5ec8724d079b49b5ddea23b30d42c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllFields.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllFields.cs
new file mode 100644
index 00000000..1660ef56
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllFields.cs
@@ -0,0 +1,36 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllFields : AltBaseCommand
+ {
+ AltGetAllFieldsParams cmdParams;
+ public AltGetAllFields(IDriverCommunication commHandler, AltComponent altComponent, AltObject altObject, AltFieldsSelections altFieldsSelections = AltFieldsSelections.ALLFIELDS) : base(commHandler)
+ {
+ cmdParams = new AltGetAllFieldsParams(altObject.id, altComponent, altFieldsSelections);
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllFields.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllFields.cs.meta
new file mode 100644
index 00000000..47862508
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllFields.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2f98c13876abd67458b52d800d12e1a6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllMethods.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllMethods.cs
new file mode 100644
index 00000000..5418e337
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllMethods.cs
@@ -0,0 +1,36 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllMethods : AltBaseCommand
+ {
+ AltGetAllMethodsParams cmdParams;
+ public AltGetAllMethods(IDriverCommunication commHandler, AltComponent altComponent, AltMethodSelection methodSelection = AltMethodSelection.ALLMETHODS) : base(commHandler)
+ {
+ cmdParams = new AltGetAllMethodsParams(altComponent, methodSelection);
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllMethods.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllMethods.cs.meta
new file mode 100644
index 00000000..e13a66a7
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllMethods.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8b4e4a0a7c524ff4d8c33f9e584d251b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllProperties.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllProperties.cs
new file mode 100644
index 00000000..d9d74346
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllProperties.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllProperties : AltBaseCommand
+ {
+ AltGetAllPropertiesParams cmdParams;
+
+ public AltGetAllProperties(IDriverCommunication commHandler, AltComponent altComponent, AltObject altObject, AltPropertiesSelections altPropertiesSelections = AltPropertiesSelections.ALLPROPERTIES) : base(commHandler)
+ {
+ cmdParams = new AltGetAllPropertiesParams(altObject.id, altComponent, altPropertiesSelections);
+
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllProperties.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllProperties.cs.meta
new file mode 100644
index 00000000..9d3880d8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetAllProperties.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ad81492830c03ac40a20a9043fbfd272
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetComponentProperty.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetComponentProperty.cs
new file mode 100644
index 00000000..c5f724ff
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetComponentProperty.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetComponentProperty : AltBaseCommand
+ {
+ AltGetObjectComponentPropertyParams cmdParams;
+ public AltGetComponentProperty(IDriverCommunication commHandler, string componentName, string propertyName, string assemblyName, int maxDepth, AltObject altObject) : base(commHandler)
+ {
+ cmdParams = new AltGetObjectComponentPropertyParams(altObject, componentName, propertyName, assemblyName, maxDepth);
+ }
+ public T Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetComponentProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetComponentProperty.cs.meta
new file mode 100644
index 00000000..0c998b1f
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetComponentProperty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c0d56111594ec8e46986eb611d6aacb4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetText.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetText.cs
new file mode 100644
index 00000000..3ce3dda5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetText.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetText : AltBaseCommand
+ {
+ readonly AltGetTextParams cmdParams;
+
+ public AltGetText(IDriverCommunication commHandler, AltObject altObject) : base(commHandler)
+ {
+ cmdParams = new AltGetTextParams(altObject);
+ }
+
+ public string Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetText.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetText.cs.meta
new file mode 100644
index 00000000..a5628d0b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltGetText.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: eafe717585cdcfe43a00b085de50c554
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltObjectAction.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltObjectAction.cs
new file mode 100644
index 00000000..6ef7c3af
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltObjectAction.cs
@@ -0,0 +1,42 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ [Obsolete]
+ public struct AltObjectAction
+ {
+ public string Component;
+ public string Method;
+ public string Parameters;
+ public string TypeOfParameters;
+
+ public AltObjectAction(string component = "", string method = "", string parameters = "", string typeOfParameters = "", string assembly = "")
+ {
+ Component = component;
+ Method = method;
+ Parameters = parameters;
+ TypeOfParameters = typeOfParameters;
+ Assembly = assembly;
+ }
+
+
+ public string Assembly;
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltObjectAction.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltObjectAction.cs.meta
new file mode 100644
index 00000000..8ad0d25e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltObjectAction.cs.meta
@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: b0674894021154b2884d5894d4bccf69
+timeCreated: 1518694471
+licenseType: Pro
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerDownFromObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerDownFromObject.cs
new file mode 100644
index 00000000..495e892b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerDownFromObject.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltPointerDownFromObject : AltCommandReturningAltElement
+ {
+ AltPointerDownFromObjectParams cmdParams;
+ public AltPointerDownFromObject(IDriverCommunication commHandler, AltObject altObject) : base(commHandler)
+ {
+ this.cmdParams = new AltPointerDownFromObjectParams(altObject);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerDownFromObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerDownFromObject.cs.meta
new file mode 100644
index 00000000..98ef8a61
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerDownFromObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c8f3c78f3e705374c9eb0eebfe5ed89d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerEnterObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerEnterObject.cs
new file mode 100644
index 00000000..dd078f2c
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerEnterObject.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltPointerEnterObject : AltCommandReturningAltElement
+ {
+ AltPointerEnterObjectParams cmdParams;
+ public AltPointerEnterObject(IDriverCommunication commHandler, AltObject altObject) : base(commHandler)
+ {
+ cmdParams = new AltPointerEnterObjectParams(altObject);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerEnterObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerEnterObject.cs.meta
new file mode 100644
index 00000000..0e21d492
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerEnterObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 53ebd0c92649a774dafa60de538b7f44
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerExitObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerExitObject.cs
new file mode 100644
index 00000000..af98539a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerExitObject.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltPointerExitObject : AltCommandReturningAltElement
+ {
+ AltPointerExitObjectParams cmdParams;
+
+ public AltPointerExitObject(IDriverCommunication commHandler, AltObject altObject) : base(commHandler)
+ {
+ this.cmdParams = new AltPointerExitObjectParams(altObject);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerExitObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerExitObject.cs.meta
new file mode 100644
index 00000000..923d4c04
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerExitObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dbea7ca9fbab77546a7c97c1efe9947e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerUpFromObject.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerUpFromObject.cs
new file mode 100644
index 00000000..445c4e88
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerUpFromObject.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltPointerUpFromObject : AltCommandReturningAltElement
+ {
+ AltPointerUpFromObjectParams cmdParams;
+
+ public AltPointerUpFromObject(IDriverCommunication commHandler, AltObject altObject) : base(commHandler)
+ {
+ this.cmdParams = new AltPointerUpFromObjectParams(altObject);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerUpFromObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerUpFromObject.cs.meta
new file mode 100644
index 00000000..cd643305
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltPointerUpFromObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c4f245ef4d88c9042931dbe3a124ad94
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetComponentProperty.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetComponentProperty.cs
new file mode 100644
index 00000000..0680ee3c
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetComponentProperty.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSetComponentProperty : AltBaseCommand
+ {
+ AltSetObjectComponentPropertyParams cmdParams;
+
+ public AltSetComponentProperty(IDriverCommunication commHandler, string componentName, string propertyName, object value, string assemblyName, AltObject altObject) : base(commHandler)
+ {
+ var strValue = Newtonsoft.Json.JsonConvert.SerializeObject(value);
+ cmdParams = new AltSetObjectComponentPropertyParams(altObject, componentName, propertyName, assemblyName, strValue);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+
+ ValidateResponse("valueSet", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetComponentProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetComponentProperty.cs.meta
new file mode 100644
index 00000000..341d0d40
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetComponentProperty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5c2de27eac9db15489c52d560efd8ac2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetText.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetText.cs
new file mode 100644
index 00000000..9c3aa3fb
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetText.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSetText : AltCommandReturningAltElement
+ {
+ AltSetTextParams cmdParams;
+
+ public AltSetText(IDriverCommunication commHandler, AltObject altObject, string text, bool submit) : base(commHandler)
+ {
+ cmdParams = new AltSetTextParams(altObject, text, submit);
+ }
+
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetText.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetText.cs.meta
new file mode 100644
index 00000000..2f62e8a2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltSetText.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af694b5963536a04aae093693cbd3aa4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltTapElement.cs b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltTapElement.cs
new file mode 100644
index 00000000..2aa44880
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltTapElement.cs
@@ -0,0 +1,45 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltTapElement : AltCommandReturningAltElement
+ {
+ AltTapElementParams cmdParams;
+
+ public AltTapElement(IDriverCommunication commHandler, AltObject altObject, int count, float interval, bool wait) : base(commHandler)
+ {
+ cmdParams = new AltTapElementParams(
+ altObject,
+ count,
+ interval,
+ wait);
+ }
+ public AltObject Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var element = ReceiveAltObject(cmdParams);
+
+ if (cmdParams.wait)
+ {
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Finished", data);
+ }
+ return element;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltTapElement.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltTapElement.cs.meta
new file mode 100644
index 00000000..25b644f2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/ObjectCommands/AltTapElement.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 549fd86b0f9dc474685b5e06c8b564ad
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Parameters.meta b/Assets/AltTester/Runtime/AltDriver/Commands/Parameters.meta
new file mode 100644
index 00000000..2aff4164
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Parameters.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 55de954649570ad47a2154021e11db07
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Parameters/CommandParams.cs b/Assets/AltTester/Runtime/AltDriver/Commands/Parameters/CommandParams.cs
new file mode 100644
index 00000000..0937be98
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Parameters/CommandParams.cs
@@ -0,0 +1,779 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+using AltTester.AltTesterUnitySDK.Driver.Notifications;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class CommandParams
+ {
+ public string messageId;
+ public string driverId;
+ public string commandName;
+ public bool isNotification;
+
+ public CommandParams()
+ {
+ CommandAttribute cmdAttribute =
+ (CommandAttribute)Attribute.GetCustomAttribute(this.GetType(), typeof(CommandAttribute));
+ if (cmdAttribute == null)
+ throw new Exception("No CommandAttribute found on type " + this.GetType());
+ this.commandName = cmdAttribute.Name;
+ }
+
+ [JsonConstructor]
+ public CommandParams(string commandName, string messageId)
+ {
+ this.commandName = commandName;
+ this.messageId = messageId;
+ }
+ }
+
+ public class CommandAttribute : Attribute
+ {
+ private string name;
+
+ public string Name { get { return name; } }
+
+ public CommandAttribute(string name)
+ {
+ this.name = name;
+ }
+ }
+
+ public class CommandError
+ {
+ public string type;
+ public string message;
+ public string trace;
+ }
+
+ public class CommandResponse
+ {
+ public string messageId;
+ public string driverId;
+ public string commandName;
+ public CommandError error;
+ public String data;
+ public bool isNotification;
+ }
+
+ public class BaseFindObjectsParams : CommandParams
+ {
+ public string path;
+ public By cameraBy { get; protected set; }
+ public string cameraPath { get; protected set; }
+ public bool enabled { get; protected set; }
+
+ public BaseFindObjectsParams(string path, By cameraBy, string cameraPath, bool enabled) : base()
+ {
+ this.path = path;
+ this.cameraBy = cameraBy;
+ this.cameraPath = cameraPath;
+ this.enabled = enabled;
+ }
+ }
+
+ [Command("findObjects")]
+ public class AltFindObjectsParams : BaseFindObjectsParams
+ {
+ public AltFindObjectsParams(string path, By cameraBy, string cameraPath, bool enabled) : base(path, cameraBy, cameraPath, enabled)
+ {
+ }
+ }
+
+ [Command("findObject")]
+ public class AltFindObjectParams : BaseFindObjectsParams
+ {
+ public AltFindObjectParams(string path, By cameraBy, string cameraPath, bool enabled) : base(path, cameraBy, cameraPath, enabled)
+ {
+ }
+ }
+
+ [Command("findObjectsLight")]
+ public class AltFindObjectsLightParams : BaseFindObjectsParams
+ {
+ public AltFindObjectsLightParams(string path, By cameraBy, string cameraPath, bool enabled) : base(path, cameraBy, cameraPath, enabled)
+ {
+ }
+ }
+
+ [Command("getAllLoadedScenesAndObjects")]
+ public class AltGetAllLoadedScenesAndObjectsParams : BaseFindObjectsParams
+ {
+ public AltGetAllLoadedScenesAndObjectsParams(string path, By cameraBy, string cameraPath, bool enabled) : base(path, cameraBy, cameraPath, enabled)
+ {
+
+ }
+ }
+
+ [Command("getServerVersion")]
+ public class AltGetServerVersionParams : CommandParams
+ {
+ public AltGetServerVersionParams() : base()
+ {
+ }
+ }
+
+ [Command("resetInput")]
+ public class AltResetInputParams : CommandParams
+ {
+ public AltResetInputParams() : base() { }
+ }
+
+ [Command("moveMouse")]
+ public class AltMoveMouseParams : CommandParams
+ {
+ public AltVector2 coordinates;
+ public float duration;
+ public bool wait;
+
+ public AltMoveMouseParams(AltVector2 coordinates, float duration, bool wait) : base()
+ {
+ this.coordinates = coordinates;
+ this.duration = duration;
+ this.wait = wait;
+ }
+ }
+
+ [Command("multipointSwipe")]
+ public class AltMultipointSwipeParams : CommandParams
+ {
+ public AltVector2[] positions;
+ public float duration;
+ public bool wait;
+
+ public AltMultipointSwipeParams(AltVector2[] positions, float duration, bool wait) : base()
+ {
+ this.positions = positions;
+ this.duration = duration;
+ this.wait = wait;
+ }
+ }
+
+ [Command("pressKeyboardKeys")]
+ public class AltPressKeyboardKeysParams : CommandParams
+ {
+ public AltKeyCode[] keyCodes;
+ public float power;
+ public float duration;
+ public bool wait;
+
+ public AltPressKeyboardKeysParams(AltKeyCode[] keyCodes, float power, float duration, bool wait) : base()
+ {
+ this.keyCodes = keyCodes;
+ this.power = power;
+ this.duration = duration;
+ this.wait = wait;
+ }
+ }
+
+ [Command("scroll")]
+ public class AltScrollParams : CommandParams
+ {
+ public float speed; //TODO: Change to AltVector2
+ public float speedHorizontal;
+ public float duration;
+ public bool wait;
+
+ public AltScrollParams(float speed, float duration, bool wait, float speedHorizontal = 0) : base()
+ {
+ this.speed = speed;
+ this.duration = duration;
+ this.wait = wait;
+ this.speedHorizontal = speedHorizontal;
+ }
+ }
+
+ [Command("swipe")]
+ public class AltSwipeParams : CommandParams
+ {
+ public AltVector2 start;
+ public AltVector2 end;
+ public float duration;
+ public bool wait;
+
+ public AltSwipeParams(AltVector2 start, AltVector2 end, float duration, bool wait) : base()
+ {
+ this.start = start;
+ this.end = end;
+ this.duration = duration;
+ this.wait = wait;
+ }
+ }
+
+ [Command("tilt")]
+ public class AltTiltParams : CommandParams
+ {
+ public AltVector3 acceleration;
+ public float duration;
+ public bool wait;
+
+ public AltTiltParams(AltVector3 acceleration, float duration, bool wait) : base()
+ {
+ this.acceleration = acceleration;
+ this.duration = duration;
+ this.wait = wait;
+ }
+ }
+
+ public class BaseAltObjectParams : CommandParams
+ {
+ public AltObject altObject;
+ public BaseAltObjectParams(AltObject altObject) : base()
+ {
+ this.altObject = altObject;
+ }
+ }
+
+ [Command("callComponentMethodForObject")]
+ public class AltCallComponentMethodForObjectParams : BaseAltObjectParams
+ {
+ public string component;
+ public string method;
+ public string[] parameters;
+ public string[] typeOfParameters;
+ public string assembly;
+
+ public AltCallComponentMethodForObjectParams(AltObject altObject, string component, string method, string[] parameters, string[] typeOfParameters, string assembly) : base(altObject)
+ {
+ this.component = component;
+ this.method = method;
+ this.parameters = parameters;
+ this.typeOfParameters = typeOfParameters;
+ this.assembly = assembly;
+ }
+ }
+
+ [Command("getObjectComponentProperty")]
+ public class AltGetObjectComponentPropertyParams : BaseAltObjectParams
+ {
+ public string component;
+ public string property;
+ public string assembly;
+ public int maxDepth;
+
+ public AltGetObjectComponentPropertyParams(AltObject altObject, string component, string property, string assembly, int maxDepth) : base(altObject)
+ {
+ this.component = component;
+ this.property = property;
+ this.assembly = assembly;
+ this.maxDepth = maxDepth;
+ }
+ }
+
+ [Command("setObjectComponentProperty")]
+ public class AltSetObjectComponentPropertyParams : BaseAltObjectParams
+ {
+ public string component;
+ public string property;
+ public string assembly;
+ public string value;
+
+ public AltSetObjectComponentPropertyParams(AltObject altObject, string component, string property, string assembly, string value) : base(altObject)
+ {
+ this.component = component;
+ this.property = property;
+ this.assembly = assembly;
+ this.value = value;
+ }
+ }
+
+ [Command("dragObject")]
+ public class AltDragObjectParams : BaseAltObjectParams
+ {
+ public AltVector2 position;
+ public AltDragObjectParams(AltObject altObject, AltVector2 position) : base(altObject)
+ {
+ this.altObject = altObject;
+ this.position = position;
+ }
+ }
+
+ [Command("getAllComponents")]
+ public class AltGetAllComponentsParams : CommandParams
+ {
+ public int altObjectId;
+ public AltGetAllComponentsParams(int altObjectId) : base()
+ {
+ this.altObjectId = altObjectId;
+ }
+ }
+
+ [Command("getAllFields")]
+ public class AltGetAllFieldsParams : CommandParams
+ {
+ public int altObjectId;
+ public AltComponent altComponent;
+ public AltFieldsSelections altFieldsSelections;
+
+ public AltGetAllFieldsParams(int altObjectId, AltComponent altComponent, AltFieldsSelections altFieldsSelections) : base()
+ {
+ this.altObjectId = altObjectId;
+ this.altComponent = altComponent;
+ this.altFieldsSelections = altFieldsSelections;
+ }
+ }
+
+ [Command("getAllProperties")]
+ public class AltGetAllPropertiesParams : CommandParams
+ {
+ public int altObjectId;
+ public AltComponent altComponent;
+ public AltPropertiesSelections altPropertiesSelections;
+
+ public AltGetAllPropertiesParams(int altObjectId, AltComponent altComponent, AltPropertiesSelections altPropertiesSelections) : base()
+ {
+ this.altObjectId = altObjectId;
+ this.altComponent = altComponent;
+ this.altPropertiesSelections = altPropertiesSelections;
+ }
+ }
+
+ [Command("getAllMethods")]
+ public class AltGetAllMethodsParams : CommandParams
+ {
+ public AltComponent altComponent;
+ public AltMethodSelection methodSelection;
+
+ public AltGetAllMethodsParams(AltComponent altComponent, AltMethodSelection methodSelection) : base()
+ {
+ this.altComponent = altComponent;
+ this.methodSelection = methodSelection;
+ }
+ }
+
+ [Command("getText")]
+ public class AltGetTextParams : BaseAltObjectParams
+ {
+ public AltGetTextParams(AltObject altObject) : base(altObject)
+ {
+ }
+ }
+
+ [Command("setText")]
+ public class AltSetTextParams : BaseAltObjectParams
+ {
+ public string value;
+ public bool submit;
+
+ public AltSetTextParams(AltObject altObject, string value, bool submit) : base(altObject)
+ {
+ this.value = value;
+ this.submit = submit;
+ }
+ }
+
+ [Command("pointerDownFromObject")]
+ public class AltPointerDownFromObjectParams : BaseAltObjectParams
+ {
+ public AltPointerDownFromObjectParams(AltObject altObject) : base(altObject)
+ {
+ }
+ }
+
+ [Command("pointerEnterObject")]
+ public class AltPointerEnterObjectParams : BaseAltObjectParams
+ {
+ public AltPointerEnterObjectParams(AltObject altObject) : base(altObject)
+ {
+ }
+ }
+
+ [Command("pointerExitObject")]
+ public class AltPointerExitObjectParams : BaseAltObjectParams
+ {
+ public AltPointerExitObjectParams(AltObject altObject) : base(altObject)
+ {
+ }
+ }
+
+ [Command("pointerUpFromObject")]
+ public class AltPointerUpFromObjectParams : BaseAltObjectParams
+ {
+ public AltPointerUpFromObjectParams(AltObject altObject) : base(altObject)
+ {
+ }
+ }
+
+ [Command("getPNGScreenshot")]
+ public class AltGetPNGScreenshotParams : CommandParams
+ {
+ public AltGetPNGScreenshotParams() : base()
+ {
+ }
+ }
+
+ [Command("getScreenshot")]
+ public class AltGetScreenshotParams : CommandParams
+ {
+ public AltVector2 size;
+ public int quality;
+
+ public AltGetScreenshotParams(AltVector2 size, int quality) : base()
+ {
+ this.size = size;
+ this.quality = quality;
+ }
+ }
+
+ [Command("hightlightObjectScreenshot")]
+ public class AltHighlightObjectScreenshotParams : CommandParams
+ {
+ public int altObjectId;
+ public AltColor color;
+ public float width;
+ public AltVector2 size;
+ public int quality;
+
+ public AltHighlightObjectScreenshotParams(int altObjectId, AltColor color, float width, AltVector2 size, int quality) : base()
+ {
+ this.altObjectId = altObjectId;
+ this.color = color;
+ this.width = width;
+ this.size = size;
+ this.quality = quality;
+ }
+ }
+
+ [Command("hightlightObjectFromCoordinatesScreenshot")]
+ public class AltHighlightObjectFromCoordinatesScreenshotParams : CommandParams
+ {
+ public AltVector2 coordinates;
+ public AltColor color;
+ public float width;
+ public AltVector2 size;
+ public int quality;
+
+ public AltHighlightObjectFromCoordinatesScreenshotParams(AltVector2 coordinates, AltColor color, float width, AltVector2 size, int quality) : base()
+ {
+ this.coordinates = coordinates;
+ this.color = color;
+ this.width = width;
+ this.size = size;
+ this.quality = quality;
+ }
+ }
+
+ [Command("deleteKeyPlayerPref")]
+ public class AltDeleteKeyPlayerPrefParams : CommandParams
+ {
+ public string keyName;
+ public AltDeleteKeyPlayerPrefParams(string keyName) : base()
+ {
+ this.keyName = keyName;
+ }
+ }
+
+ [Command("getKeyPlayerPref")]
+ public class AltGetKeyPlayerPrefParams : CommandParams
+ {
+ public string keyName;
+ public PlayerPrefKeyType keyType;
+
+ public AltGetKeyPlayerPrefParams() : base()
+ {
+ }
+
+ public AltGetKeyPlayerPrefParams(string keyName, PlayerPrefKeyType keyType) : base()
+ {
+ this.keyName = keyName;
+ this.keyType = keyType;
+ }
+ }
+
+ [Command("setKeyPlayerPref")]
+ public class AltSetKeyPlayerPrefParams : CommandParams
+ {
+ public string keyName;
+ public PlayerPrefKeyType keyType;
+ public string stringValue;
+ public float floatValue;
+ public int intValue;
+
+ public AltSetKeyPlayerPrefParams() : base() { }
+
+ public AltSetKeyPlayerPrefParams(string keyName, int value) : base()
+ {
+ this.keyName = keyName;
+ this.intValue = value;
+ keyType = PlayerPrefKeyType.Int;
+ }
+
+ public AltSetKeyPlayerPrefParams(string keyName, float value) : base()
+ {
+ this.keyName = keyName;
+ this.floatValue = value;
+ keyType = PlayerPrefKeyType.Float;
+ }
+
+ public AltSetKeyPlayerPrefParams(string keyName, string value) : base()
+ {
+ this.keyName = keyName;
+ this.stringValue = value;
+ keyType = PlayerPrefKeyType.String;
+ }
+ }
+
+ [Command("deletePlayerPref")]
+ public class AltDeletePlayerPrefParams : CommandParams
+ {
+ public AltDeletePlayerPrefParams() : base()
+ {
+ }
+ }
+
+ [Command("getAllActiveCameras")]
+ public class AltGetAllActiveCamerasParams : CommandParams
+ {
+ public AltGetAllActiveCamerasParams() : base()
+ {
+ }
+ }
+
+ [Command("getAllCameras")]
+ public class AltGetAllCamerasParams : CommandParams
+ {
+ }
+
+ [Command("getAllLoadedScenes")]
+ public class AltGetAllLoadedScenesParams : CommandParams
+ {
+ }
+
+ [Command("getAllScenes")]
+ public class AltGetAllScenesParams : CommandParams
+ {
+ }
+
+ [Command("getCurrentScene")]
+ public class AltGetCurrentSceneParams : CommandParams
+ {
+ }
+
+ [Command("loadScene")]
+ public class AltLoadSceneParams : CommandParams
+ {
+ public string sceneName;
+ public bool loadSingle;
+
+ public AltLoadSceneParams(string sceneName, bool loadSingle) : base()
+ {
+ this.sceneName = sceneName;
+ this.loadSingle = loadSingle;
+ }
+ }
+
+ [Command("unloadScene")]
+ public class AltUnloadSceneParams : CommandParams
+ {
+ public string sceneName;
+
+ public AltUnloadSceneParams(string sceneName) : base()
+ {
+ this.sceneName = sceneName;
+ }
+ }
+
+ [Command("getTimeScale")]
+ public class AltGetTimeScaleParams : CommandParams
+ {
+ }
+
+ [Command("setTimeScale")]
+ public class AltSetTimeScaleParams : CommandParams
+ {
+ public float timeScale;
+
+ public AltSetTimeScaleParams(float timeScale) : base()
+ {
+ this.timeScale = timeScale;
+ }
+ }
+
+ [Command("setServerLogging")]
+ public class AltSetServerLoggingParams : CommandParams
+ {
+ public AltLogger logger;
+ public AltLogLevel logLevel;
+
+ public AltSetServerLoggingParams(AltLogger logger, AltLogLevel logLevel) : base()
+ {
+ this.logger = logger;
+ this.logLevel = logLevel;
+ }
+ }
+
+ [Command("tapElement")]
+ public class AltTapElementParams : BaseAltObjectParams
+ {
+ public int count;
+ public float interval;
+ public bool wait;
+
+ public AltTapElementParams(AltObject altObject, int count, float interval, bool wait) : base(altObject)
+ {
+ this.count = count;
+ this.interval = interval;
+ this.wait = wait;
+ }
+ }
+
+ [Command("clickElement")]
+ public class AltClickElementParams : BaseAltObjectParams
+ {
+ public int count;
+ public float interval;
+ public bool wait;
+
+ public AltClickElementParams(AltObject altObject, int count, float interval, bool wait) : base(altObject)
+ {
+ this.count = count;
+ this.interval = interval;
+ this.wait = wait;
+ }
+ }
+
+ [Command("clickCoordinates")]
+ public class AltClickCoordinatesParams : CommandParams
+ {
+ public AltVector2 coordinates;
+ public int count;
+ public float interval;
+ public bool wait;
+
+ public AltClickCoordinatesParams(AltVector2 coordinates, int count, float interval, bool wait)
+ {
+ this.coordinates = coordinates;
+ this.count = count;
+ this.interval = interval;
+ this.wait = wait;
+ }
+ }
+
+ [Command("tapCoordinates")]
+ public class AltTapCoordinatesParams : CommandParams
+ {
+ public AltVector2 coordinates;
+ public int count;
+ public float interval;
+ public bool wait;
+
+ public AltTapCoordinatesParams(AltVector2 coordinates, int count, float interval, bool wait)
+ {
+ this.coordinates = coordinates;
+ this.count = count;
+ this.interval = interval;
+ this.wait = wait;
+ }
+ }
+
+ [Command("keysUp")]
+ public class AltKeysUpParams : CommandParams
+ {
+ public AltKeyCode[] keyCodes;
+
+ public AltKeysUpParams(AltKeyCode[] keyCodes)
+ {
+ this.keyCodes = keyCodes;
+ }
+ }
+
+ [Command("keysDown")]
+ public class AltKeysDownParams : CommandParams
+ {
+ public AltKeyCode[] keyCodes;
+ public float power;
+
+ public AltKeysDownParams(AltKeyCode[] keyCodes, float power)
+ {
+ this.keyCodes = keyCodes;
+ this.power = power;
+ }
+ }
+
+ [Command("beginTouch")]
+ public class AltBeginTouchParams : CommandParams
+ {
+ public AltVector2 coordinates;
+
+ public AltBeginTouchParams(AltVector2 coordinates)
+ {
+ this.coordinates = coordinates;
+ }
+ }
+
+ [Command("moveTouch")]
+ public class AltMoveTouchParams : CommandParams
+ {
+ public int fingerId;
+ public AltVector2 coordinates;
+
+ public AltMoveTouchParams(int fingerId, AltVector2 coordinates)
+ {
+ this.coordinates = coordinates;
+ this.fingerId = fingerId;
+ }
+ }
+
+ [Command("endTouch")]
+ public class AltEndTouchParams : CommandParams
+ {
+ public int fingerId;
+
+ public AltEndTouchParams(int fingerId)
+ {
+ this.fingerId = fingerId;
+ }
+ }
+
+ [Command("activateNotification")]
+ public class ActivateNotification : CommandParams
+ {
+ public NotificationType NotificationType;
+
+ public ActivateNotification(NotificationType notificationType)
+ {
+ NotificationType = notificationType;
+ }
+ }
+
+ [Command("deactivateNotification")]
+ public class DeactivateNotification : CommandParams
+ {
+ public NotificationType NotificationType;
+
+ public DeactivateNotification(NotificationType notificationType)
+ {
+ NotificationType = notificationType;
+ }
+ }
+
+ [Command("findObjectAtCoordinates")]
+ public class AltFindObjectAtCoordinatesParams : CommandParams
+ {
+ public AltVector2 coordinates;
+
+ public AltFindObjectAtCoordinatesParams(AltVector2 coordinates)
+ {
+ this.coordinates = coordinates;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Parameters/CommandParams.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/Parameters/CommandParams.cs.meta
new file mode 100644
index 00000000..887a4b12
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Parameters/CommandParams.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4817c9f45c1133244b43c8ff50bdce4c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot.meta b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot.meta
new file mode 100644
index 00000000..839cc1a6
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: adaea1f290ce4a647b76cb028ac9503e
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetPNGScreenshot.cs b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetPNGScreenshot.cs
new file mode 100644
index 00000000..6d73d819
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetPNGScreenshot.cs
@@ -0,0 +1,40 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetPNGScreenshot : AltBaseCommand
+ {
+ string path;
+ AltGetPNGScreenshotParams cmdParams;
+
+ public AltGetPNGScreenshot(IDriverCommunication commHandler, string path) : base(commHandler)
+ {
+ this.path = path;
+ this.cmdParams = new AltGetPNGScreenshotParams();
+ }
+
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var message = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", message);
+ string screenshotData = CommHandler.Recvall(cmdParams);
+ System.IO.File.WriteAllBytes(path, System.Convert.FromBase64String(screenshotData));
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetPNGScreenshot.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetPNGScreenshot.cs.meta
new file mode 100644
index 00000000..d3df1d19
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetPNGScreenshot.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 021be954918627849b27ac8e56fc30c1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetScreenshot.cs b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetScreenshot.cs
new file mode 100644
index 00000000..1f6eee52
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetScreenshot.cs
@@ -0,0 +1,93 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetScreenshotResponse
+ {
+ public AltVector2 scaleDifference;
+ public AltVector3 textureSize;
+ public byte[] compressedImage;
+
+ }
+ public class AltGetScreenshot : AltCommandReturningAltElement
+ {
+ AltGetScreenshotParams cmdParams;
+
+
+ public AltGetScreenshot(IDriverCommunication commHandler, AltVector2 size, int screenShotQuality) : base(commHandler)
+ {
+ cmdParams = new AltGetScreenshotParams(size, screenShotQuality);
+ }
+ public virtual AltTextureInformation Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveScreenshot(cmdParams);
+ }
+
+ protected AltTextureInformation ReceiveScreenshot(CommandParams commandParams)
+ {
+ var data = CommHandler.Recvall(commandParams);
+ ValidateResponse("Ok", data);
+
+ var imageData = CommHandler.Recvall(commandParams);
+ return new AltTextureInformation(imageData.compressedImage, imageData.scaleDifference, imageData.textureSize);
+ }
+ }
+
+
+ public class AltGetHighlightObjectScreenshot : AltGetScreenshot
+ {
+
+ AltHighlightObjectScreenshotParams cmdParams;
+
+ public AltGetHighlightObjectScreenshot(IDriverCommunication commHandler, int id, AltColor color, float width, AltVector2 size, int screenShotQuality) : base(commHandler, size, screenShotQuality)
+ {
+ cmdParams = new AltHighlightObjectScreenshotParams(id, color, width, size, screenShotQuality);
+ }
+
+ public override AltTextureInformation Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveScreenshot(cmdParams);
+ }
+ }
+
+
+ public class AltGetHighlightObjectFromCoordinatesScreenshot : AltGetScreenshot
+ {
+ AltHighlightObjectFromCoordinatesScreenshotParams cmdParams;
+
+ public AltGetHighlightObjectFromCoordinatesScreenshot(IDriverCommunication commHandler, AltVector2 coordinates, AltColor color, float width, AltVector2 size, int screenShotQuality) : base(commHandler, size, screenShotQuality)
+ {
+ cmdParams = new AltHighlightObjectFromCoordinatesScreenshotParams(coordinates, color, width, size, screenShotQuality);
+ }
+ public AltTextureInformation Execute(out AltObject selectedObject)
+ {
+ CommHandler.Send(cmdParams);
+
+ selectedObject = ReceiveAltObject(cmdParams);
+ if (selectedObject != null && selectedObject.name.Equals("Null") && selectedObject.id == 0)
+ {
+ selectedObject = null;
+ }
+ return ReceiveScreenshot(cmdParams);
+
+ }
+ }
+
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetScreenshot.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetScreenshot.cs.meta
new file mode 100644
index 00000000..b2b7ffd0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/Screenshot/AltGetScreenshot.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 39b1a1f3b6d4bf344b2218a592117bb5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands.meta
new file mode 100644
index 00000000..12b7deb4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fc1e9720d302ded4d9d1e2214791fad4
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeleteKeyPlayerPref.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeleteKeyPlayerPref.cs
new file mode 100644
index 00000000..afc94b17
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeleteKeyPlayerPref.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltDeleteKeyPlayerPref : AltBaseCommand
+ {
+ AltDeleteKeyPlayerPrefParams cmdParams;
+ public AltDeleteKeyPlayerPref(IDriverCommunication commHandler, string keyName) : base(commHandler)
+ {
+ this.cmdParams = new AltDeleteKeyPlayerPrefParams(keyName);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeleteKeyPlayerPref.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeleteKeyPlayerPref.cs.meta
new file mode 100644
index 00000000..c693e978
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeleteKeyPlayerPref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fbf4da61b5051eb4db291637f1d99db8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeletePlayerPref.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeletePlayerPref.cs
new file mode 100644
index 00000000..aeda4400
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeletePlayerPref.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltDeletePlayerPref : AltBaseCommand
+ {
+ AltDeletePlayerPrefParams cmdParams;
+ public AltDeletePlayerPref(IDriverCommunication commHandler) : base(commHandler)
+ {
+ this.cmdParams = new AltDeletePlayerPrefParams();
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeletePlayerPref.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeletePlayerPref.cs.meta
new file mode 100644
index 00000000..cc3809f3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltDeletePlayerPref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2bd330e584e872243a42637d2f154a4b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllActiveCameras.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllActiveCameras.cs
new file mode 100644
index 00000000..35ae1f4f
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllActiveCameras.cs
@@ -0,0 +1,34 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllActiveCameras : AltBaseFindObjects
+ {
+ private readonly AltGetAllActiveCamerasParams cmdParams;
+ public AltGetAllActiveCameras(IDriverCommunication commHandler) : base(commHandler)
+ {
+
+ cmdParams = new AltGetAllActiveCamerasParams();
+ }
+ public System.Collections.Generic.List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveListOfAltObjects(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllActiveCameras.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllActiveCameras.cs.meta
new file mode 100644
index 00000000..b030dd16
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllActiveCameras.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fce46b5b6f181cd40a094fd37bd8be3f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllCameras.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllCameras.cs
new file mode 100644
index 00000000..d90b44c4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllCameras.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllCameras : AltBaseFindObjects
+ {
+ private readonly AltGetAllCamerasParams cmdParams;
+ public AltGetAllCameras(IDriverCommunication commHandler) : base(commHandler)
+ {
+ cmdParams = new AltGetAllCamerasParams();
+ }
+ public System.Collections.Generic.List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveListOfAltObjects(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllCameras.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllCameras.cs.meta
new file mode 100644
index 00000000..6c8bdcad
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllCameras.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5ee39bcd41c95ea489c6b3c9ed771624
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllLoadedScenes.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllLoadedScenes.cs
new file mode 100644
index 00000000..0f91d64d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllLoadedScenes.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ internal class AltGetAllLoadedScenes : AltBaseCommand
+ {
+ private readonly AltGetAllLoadedScenesParams cmdParams;
+ public AltGetAllLoadedScenes(IDriverCommunication commHandler) : base(commHandler)
+ {
+ cmdParams = new AltGetAllLoadedScenesParams();
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllLoadedScenes.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllLoadedScenes.cs.meta
new file mode 100644
index 00000000..c23baf17
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllLoadedScenes.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2f4c3877502432e44955dd68aecf8771
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllScenes.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllScenes.cs
new file mode 100644
index 00000000..e078f965
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllScenes.cs
@@ -0,0 +1,36 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetAllScenes : AltBaseCommand
+ {
+ private readonly AltGetAllScenesParams cmdParams;
+ public AltGetAllScenes(IDriverCommunication commHandler) : base(commHandler)
+ {
+ cmdParams = new AltGetAllScenesParams();
+ }
+ public List Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall>(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllScenes.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllScenes.cs.meta
new file mode 100644
index 00000000..47e496bc
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetAllScenes.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c15ac11ddfd98374d910fc7b366a3087
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetCurrentScene.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetCurrentScene.cs
new file mode 100644
index 00000000..f0d22618
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetCurrentScene.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetCurrentScene : AltBaseFindObjects
+ {
+ private readonly AltGetCurrentSceneParams cmdParams;
+ public AltGetCurrentScene(IDriverCommunication commHandler) : base(commHandler)
+ {
+ cmdParams = new AltGetCurrentSceneParams();
+ }
+ public string Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return ReceiveAltObject(cmdParams).name;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetCurrentScene.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetCurrentScene.cs.meta
new file mode 100644
index 00000000..0f954ad2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetCurrentScene.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 009e6b8df2b0cd14d8f1b5b3e8d9819c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetFloatKeyPlayerPref.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetFloatKeyPlayerPref.cs
new file mode 100644
index 00000000..1b9fee8d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetFloatKeyPlayerPref.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetFloatKeyPlayerPref : AltBaseCommand
+ {
+ readonly AltGetKeyPlayerPrefParams cmdParams;
+ public AltGetFloatKeyPlayerPref(IDriverCommunication commHandler, string keyName) : base(commHandler)
+ {
+ cmdParams = new AltGetKeyPlayerPrefParams(keyName, PlayerPrefKeyType.Float);
+ }
+ public float Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetFloatKeyPlayerPref.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetFloatKeyPlayerPref.cs.meta
new file mode 100644
index 00000000..85a1c985
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetFloatKeyPlayerPref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ca359135cf227ce4bac7f68da41b5e0b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetIntKeyPlayerPref.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetIntKeyPlayerPref.cs
new file mode 100644
index 00000000..fdead1d5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetIntKeyPlayerPref.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetIntKeyPlayerPref : AltBaseCommand
+ {
+ readonly AltGetKeyPlayerPrefParams cmdParams;
+ public AltGetIntKeyPlayerPref(IDriverCommunication commHandler, string keyName) : base(commHandler)
+ {
+ cmdParams = new AltGetKeyPlayerPrefParams(keyName, PlayerPrefKeyType.Int);
+ }
+ public int Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetIntKeyPlayerPref.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetIntKeyPlayerPref.cs.meta
new file mode 100644
index 00000000..efa5bcf8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetIntKeyPlayerPref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4600ed3f03238ad4690b2012bcea1c5d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetStringKeyPlayerPref.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetStringKeyPlayerPref.cs
new file mode 100644
index 00000000..9070e191
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetStringKeyPlayerPref.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetStringKeyPlayerPref : AltBaseCommand
+ {
+ readonly AltGetKeyPlayerPrefParams cmdParams;
+ public AltGetStringKeyPlayerPref(IDriverCommunication commHandler, string keyName) : base(commHandler)
+ {
+ cmdParams = new AltGetKeyPlayerPrefParams(keyName, PlayerPrefKeyType.String);
+ }
+ public string Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetStringKeyPlayerPref.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetStringKeyPlayerPref.cs.meta
new file mode 100644
index 00000000..6c7a0008
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetStringKeyPlayerPref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 98d3fa36acfaece45b8e436b14c31c4a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetTimeScale.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetTimeScale.cs
new file mode 100644
index 00000000..32cef054
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetTimeScale.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltGetTimeScale : AltBaseCommand
+ {
+ AltGetTimeScaleParams cmdParams;
+ public AltGetTimeScale(IDriverCommunication commHandler) : base(commHandler)
+ {
+ cmdParams = new AltGetTimeScaleParams();
+ }
+ public float Execute()
+ {
+ CommHandler.Send(cmdParams);
+ return CommHandler.Recvall(cmdParams);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetTimeScale.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetTimeScale.cs.meta
new file mode 100644
index 00000000..a10a026d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltGetTimeScale.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b34041e6794e98247b8013cbc1b32074
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltLoadScene.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltLoadScene.cs
new file mode 100644
index 00000000..f55049aa
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltLoadScene.cs
@@ -0,0 +1,40 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltLoadScene : AltBaseCommand
+ {
+ AltLoadSceneParams cmdParams;
+ public AltLoadScene(IDriverCommunication commHandler, string sceneName, bool loadSingle) : base(commHandler)
+ {
+ cmdParams = new AltLoadSceneParams(sceneName, loadSingle);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Scene Loaded", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltLoadScene.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltLoadScene.cs.meta
new file mode 100644
index 00000000..bbca231e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltLoadScene.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5c7d3b895b851c6468a9cf32d65c4f85
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetKeyPLayerPref.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetKeyPLayerPref.cs
new file mode 100644
index 00000000..1f6bf46a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetKeyPLayerPref.cs
@@ -0,0 +1,42 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSetKeyPLayerPref : AltBaseCommand
+ {
+ AltSetKeyPlayerPrefParams cmdParams;
+ public AltSetKeyPLayerPref(IDriverCommunication commHandler, string keyName, int intValue) : base(commHandler)
+ {
+ cmdParams = new AltSetKeyPlayerPrefParams(keyName, intValue);
+ }
+ public AltSetKeyPLayerPref(IDriverCommunication commHandler, string keyName, float floatValue) : base(commHandler)
+ {
+ cmdParams = new AltSetKeyPlayerPrefParams(keyName, floatValue);
+ }
+ public AltSetKeyPLayerPref(IDriverCommunication commHandler, string keyName, string stringValue) : base(commHandler)
+ {
+ cmdParams = new AltSetKeyPlayerPrefParams(keyName, stringValue);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetKeyPLayerPref.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetKeyPLayerPref.cs.meta
new file mode 100644
index 00000000..6c1061be
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetKeyPLayerPref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b2de68bf3d017424c91c7816183d156b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetTimeScale.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetTimeScale.cs
new file mode 100644
index 00000000..c964394f
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetTimeScale.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltSetTimeScale : AltBaseCommand
+ {
+ AltSetTimeScaleParams cmdParams;
+
+ public AltSetTimeScale(IDriverCommunication commHandler, float timeScale) : base(commHandler)
+ {
+ cmdParams = new AltSetTimeScaleParams(timeScale);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetTimeScale.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetTimeScale.cs.meta
new file mode 100644
index 00000000..597b1349
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltSetTimeScale.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2c0b509d5ef08454589b2c4fa01091b7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltUnloadScene.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltUnloadScene.cs
new file mode 100644
index 00000000..7aba1f0e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltUnloadScene.cs
@@ -0,0 +1,38 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltUnloadScene : AltBaseCommand
+ {
+ AltUnloadSceneParams cmdParams;
+ public AltUnloadScene(IDriverCommunication commHandler, string sceneName) : base(commHandler)
+ {
+ cmdParams = new AltUnloadSceneParams(sceneName);
+ }
+ public void Execute()
+ {
+ CommHandler.Send(cmdParams);
+
+ var data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Ok", data);
+
+ data = CommHandler.Recvall(cmdParams);
+ ValidateResponse("Scene Unloaded", data);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltUnloadScene.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltUnloadScene.cs.meta
new file mode 100644
index 00000000..ed27daf0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltUnloadScene.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3e7291f8ab9d8e348a481f040cb087b9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltWaitForCurrentSceneToBe.cs b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltWaitForCurrentSceneToBe.cs
new file mode 100644
index 00000000..dfba1265
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltWaitForCurrentSceneToBe.cs
@@ -0,0 +1,58 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public class AltWaitForCurrentSceneToBe : AltBaseCommand
+ {
+ readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ string sceneName;
+ double timeout;
+ double interval;
+ public AltWaitForCurrentSceneToBe(IDriverCommunication commHandler, string sceneName, double timeout, double interval) : base(commHandler)
+ {
+ this.sceneName = sceneName;
+ this.timeout = timeout;
+ this.interval = interval;
+ }
+ public void Execute()
+ {
+ double time = 0;
+ string currentScene = "";
+ while (time < timeout)
+ {
+ currentScene = new AltGetCurrentScene(CommHandler).Execute();
+ if (currentScene.Equals(sceneName))
+ {
+ return;
+ }
+
+ logger.Debug("Waiting for scene to be " + sceneName + "...");
+ Thread.Sleep(System.Convert.ToInt32(interval * 1000));
+ time += interval;
+ }
+
+ if (sceneName.Equals(currentScene))
+ return;
+ throw new WaitTimeOutException("Scene " + sceneName + " not loaded after " + timeout + " seconds");
+
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltWaitForCurrentSceneToBe.cs.meta b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltWaitForCurrentSceneToBe.cs.meta
new file mode 100644
index 00000000..3c6b11d4
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Commands/UnityCommands/AltWaitForCurrentSceneToBe.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 49c58b3f447fabc4cabad1e093b463d2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common.meta b/Assets/AltTester/Runtime/AltDriver/Common.meta
new file mode 100644
index 00000000..284399fd
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 64b015cfc961e445c926dd271792d19f
+folderAsset: yes
+timeCreated: 1516878881
+licenseType: Pro
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltAxis.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltAxis.cs
new file mode 100644
index 00000000..a04febe2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltAxis.cs
@@ -0,0 +1,48 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public enum InputType
+ {
+ KeyOrMouseButton,
+ MouseMovement,
+ JoystickAxis,
+ };
+ [System.Serializable]
+ public class AltAxis
+ {
+ public string name;
+ public string negativeButton;
+ public string positiveButton;
+ public string altPositiveButton;
+ public string altNegativeButton;
+ public InputType type;
+ public int axisDirection;
+
+ public AltAxis(string name, InputType type, string negativeButton, string positiveButton, string altPositiveButton, string altNegativeButton, int axisDirection)
+ {
+ this.name = name;
+ this.type = type;
+ this.negativeButton = negativeButton;
+ this.positiveButton = positiveButton;
+ this.altPositiveButton = altPositiveButton;
+ this.altNegativeButton = altNegativeButton;
+ this.axisDirection = axisDirection;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltAxis.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltAxis.cs.meta
new file mode 100644
index 00000000..f2d0c957
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltAxis.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 252fc802f6d1d68499fc8f5c26a9159d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltComponent.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltComponent.cs
new file mode 100644
index 00000000..a5e64e72
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltComponent.cs
@@ -0,0 +1,31 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public struct AltComponent
+ {
+ public string componentName;
+ public string assemblyName;
+
+ public AltComponent(string componentName, string assemblyName)
+ {
+ this.componentName = componentName;
+ this.assemblyName = assemblyName;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltComponent.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltComponent.cs.meta
new file mode 100644
index 00000000..15271e43
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltComponent.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1ec8e9cb80110bb43a42eb358c46dbcc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltFieldsSelections.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltFieldsSelections.cs
new file mode 100644
index 00000000..d0b91202
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltFieldsSelections.cs
@@ -0,0 +1,26 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public enum AltFieldsSelections
+ {
+ CLASSFIELDS,
+ INHERITEDFIELDS,
+ ALLFIELDS
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltFieldsSelections.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltFieldsSelections.cs.meta
new file mode 100644
index 00000000..1772bfe6
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltFieldsSelections.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 428b9e960cfa04b44bc5b91cc1cbce26
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltMethodSelection.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltMethodSelection.cs
new file mode 100644
index 00000000..58980b61
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltMethodSelection.cs
@@ -0,0 +1,26 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public enum AltMethodSelection
+ {
+ CLASSMETHODS,
+ INHERITEDMETHODS,
+ ALLMETHODS
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltMethodSelection.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltMethodSelection.cs.meta
new file mode 100644
index 00000000..d191fbe0
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltMethodSelection.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b278932954527a42b69a4d553772a71
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltObject.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltObject.cs
new file mode 100644
index 00000000..65510b15
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltObject.cs
@@ -0,0 +1,239 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Commands;
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public class AltObject
+ {
+ public string name;
+ public int id;
+ public int x;
+ public int y;
+ public int z;
+ public int mobileY;
+ public string type;
+ public bool enabled;
+ public float worldX;
+ public float worldY;
+ public float worldZ;
+ public int idCamera;
+ public int transformParentId;
+ public int transformId;
+ [Newtonsoft.Json.JsonIgnore]
+ public IDriverCommunication CommHandler;
+
+ public AltObject(string name, int id = 0, int x = 0, int y = 0, int z = 0, int mobileY = 0, string type = "", bool enabled = true, float worldX = 0, float worldY = 0, float worldZ = 0, int idCamera = 0, int transformParentId = 0, int transformId = 0)
+ {
+ this.name = name;
+ this.id = id;
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.mobileY = mobileY;
+ this.type = type;
+ this.enabled = enabled;
+ this.worldX = worldX;
+ this.worldY = worldY;
+ this.worldZ = worldZ;
+ this.idCamera = idCamera;
+ this.transformParentId = transformParentId;
+ this.transformId = transformId;
+ }
+
+ public AltObject UpdateObject()
+ {
+ var altObject = new AltFindObject(CommHandler, By.ID, this.id.ToString(), By.NAME, "", this.enabled).Execute();
+ x = altObject.x;
+ y = altObject.y;
+ z = altObject.z;
+ id = altObject.id;
+ name = altObject.name;
+ mobileY = altObject.mobileY;
+ type = altObject.type;
+ enabled = altObject.enabled;
+ worldX = altObject.worldX;
+ worldY = altObject.worldY;
+ worldZ = altObject.worldZ;
+ idCamera = altObject.idCamera;
+ transformParentId = altObject.transformParentId;
+ transformId = altObject.transformId;
+
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return this;
+ }
+ public AltObject GetParent()
+ {
+ var altObject = new AltFindObject(CommHandler, By.PATH, "//*[@id=" + this.id + "]/..", By.NAME, "", true).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ [Obsolete("getParent is deprecated, please use GetParent instead.")]
+ public AltObject getParent()
+ {
+ var altObject = new AltFindObject(CommHandler, By.PATH, "//*[@id=" + this.id + "]/..", By.NAME, "", true).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+ public AltVector2 GetScreenPosition()
+ {
+ return new AltVector2(x, y);
+ }
+
+ [Obsolete("getScreenPosition is deprecated, please use GetScreenPosition instead.")]
+ public AltVector2 getScreenPosition()
+ {
+ return new AltVector2(x, y);
+ }
+ public AltVector3 GetWorldPosition()
+ {
+ return new AltVector3(worldX, worldY, worldZ);
+ }
+
+ [Obsolete("getWorldPosition is deprecated, please use GetWorldPosition instead.")]
+ public AltVector3 getWorldPosition()
+ {
+ return new AltVector3(worldX, worldY, worldZ);
+ }
+ public T GetComponentProperty(string componentName, string propertyName, string assemblyName, int maxDepth = 2)
+ {
+ var propertyValue = new AltGetComponentProperty(CommHandler, componentName, propertyName, assemblyName, maxDepth, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return propertyValue;
+ }
+ public T WaitForComponentProperty(string componentName, string propertyName, T propertyValue, string assemblyName, double timeout = 20, double interval = 0.5)
+ {
+ var propertyFound = new AltWaitForComponentProperty(CommHandler, componentName, propertyName, propertyValue, assemblyName, timeout, interval, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return propertyFound;
+ }
+ public void SetComponentProperty(string componentName, string propertyName, object value, string assemblyName)
+ {
+ new AltSetComponentProperty(CommHandler, componentName, propertyName, value, assemblyName, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ }
+
+ public T CallComponentMethod(string componentName, string methodName, string assemblyName, object[] parameters, string[] typeOfParameters = null)
+ {
+ var result = new AltCallComponentMethod(CommHandler, componentName, methodName, parameters, typeOfParameters, assemblyName, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return result;
+ }
+
+ public string GetText()
+ {
+ var text = new AltGetText(CommHandler, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return text;
+ }
+
+ public AltObject SetText(string text, bool submit = false)
+ {
+ var altObject = new AltSetText(CommHandler, this, text, submit).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ ///
+ /// Click current object
+ ///
+ /// Number of times to click
+ /// Interval between clicks in seconds
+ /// Wait for command to finish
+ /// The clicked object
+ public AltObject Click(int count = 1, float interval = 0.1f, bool wait = true)
+ {
+ var altObject = new AltClickElement(CommHandler, this, count, interval, wait).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public AltObject PointerUpFromObject()
+ {
+ var altObject = new AltPointerUpFromObject(CommHandler, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public AltObject PointerDownFromObject()
+ {
+ var altObject = new AltPointerDownFromObject(CommHandler, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public AltObject PointerEnterObject()
+ {
+ var altObject = new AltPointerEnterObject(CommHandler, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public AltObject PointerExitObject()
+ {
+ var altObject = new AltPointerExitObject(CommHandler, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ ///
+ /// Tap current object
+ ///
+ /// Number of taps
+ /// Interval in seconds
+ /// Wait for command to finish
+ /// The tapped object
+ public AltObject Tap(int count = 1, float interval = 0.1f, bool wait = true)
+ {
+ var altObject = new AltTapElement(CommHandler, this, count, interval, wait).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public System.Collections.Generic.List GetAllComponents()
+ {
+ var altObject = new AltGetAllComponents(CommHandler, this).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public System.Collections.Generic.List GetAllProperties(AltComponent altComponent, AltPropertiesSelections altPropertiesSelections = AltPropertiesSelections.ALLPROPERTIES)
+ {
+ var altObject = new AltGetAllProperties(CommHandler, altComponent, this, altPropertiesSelections).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public System.Collections.Generic.List GetAllFields(AltComponent altComponent, AltFieldsSelections altFieldsSelections = AltFieldsSelections.ALLFIELDS)
+ {
+ var altObject = new AltGetAllFields(CommHandler, altComponent, this, altFieldsSelections).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+
+ public System.Collections.Generic.List GetAllMethods(AltComponent altComponent, AltMethodSelection methodSelection = AltMethodSelection.ALLMETHODS)
+ {
+ var altObject = new AltGetAllMethods(CommHandler, altComponent, methodSelection).Execute();
+ CommHandler.SleepFor(CommHandler.GetDelayAfterCommand());
+ return altObject;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltObject.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltObject.cs.meta
new file mode 100644
index 00000000..ca51350d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltObject.cs.meta
@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: fe75b462096664ca89da36caea8cacdb
+timeCreated: 1516878909
+licenseType: Pro
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltObjectLight.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectLight.cs
new file mode 100644
index 00000000..3dd7af5e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectLight.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public class AltObjectLight
+ {
+ public string name;
+ public int id;
+ public bool enabled;
+ public int idCamera;
+ public int transformParentId;
+ public int transformId;
+
+ public AltObjectLight(string name, int id = 0, bool enabled = true, int idCamera = 0, int transformParentId = 0, int transformId = 0)
+ {
+ this.name = name;
+ this.id = id;
+ this.enabled = enabled;
+ this.idCamera = idCamera;
+ this.transformParentId = transformParentId;
+ this.transformId = transformId;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltObjectLight.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectLight.cs.meta
new file mode 100644
index 00000000..47ab4848
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectLight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 431e3a3312cc2cd46b8855597a2b9e95
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltObjectProperty.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectProperty.cs
new file mode 100644
index 00000000..2bac1b21
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectProperty.cs
@@ -0,0 +1,37 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public struct AltObjectProperty
+ {
+ public string Component;
+ public string Property;
+ public string Assembly;
+
+ public AltObjectProperty(string component = "", string property = "") :
+ this(component, property, null)
+ { }
+
+ public AltObjectProperty(string component, string property, string assembly)
+ {
+ Component = component;
+ Property = property;
+ Assembly = assembly;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltObjectProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectProperty.cs.meta
new file mode 100644
index 00000000..6b715662
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltObjectProperty.cs.meta
@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: cd59071dbb33a40bfbfcaf97fe45b0bb
+timeCreated: 1518696264
+licenseType: Pro
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltPropertiesSelections.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltPropertiesSelections.cs
new file mode 100644
index 00000000..85e8b630
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltPropertiesSelections.cs
@@ -0,0 +1,26 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public enum AltPropertiesSelections
+ {
+ CLASSPROPERTIES,
+ INHERITEDPROPERTIES,
+ ALLPROPERTIES
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltPropertiesSelections.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltPropertiesSelections.cs.meta
new file mode 100644
index 00000000..bb76700e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltPropertiesSelections.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 03bc7362e2cb51542bd50e3234883d00
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltProperty.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltProperty.cs
new file mode 100644
index 00000000..b1b094d7
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltProperty.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public struct AltProperty
+ {
+ public string name;
+ public string value;
+ public AltType type;
+
+ public AltProperty(string name, string value, AltType type)
+ {
+ this.name = name;
+ this.value = value;
+ this.type = type;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltProperty.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltProperty.cs.meta
new file mode 100644
index 00000000..08261e3f
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltProperty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e8db748a79f1818478d15c36379b9cc4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltTextureInformation.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltTextureInformation.cs
new file mode 100644
index 00000000..abb5ee28
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltTextureInformation.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public struct AltTextureInformation
+ {
+ public byte[] imageData;
+ public AltVector2 scaleDifference;
+ public AltVector3 textureSize;
+
+ public AltTextureInformation(byte[] imageData, AltVector2 scaleDifference, AltVector3 textureSize)
+ {
+ this.imageData = imageData;
+ this.scaleDifference = scaleDifference;
+ this.textureSize = textureSize;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltTextureInformation.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltTextureInformation.cs.meta
new file mode 100644
index 00000000..1cd45448
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltTextureInformation.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 27bb07222f850a94b9ddb8b6bdc7cf3b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltType.cs b/Assets/AltTester/Runtime/AltDriver/Common/AltType.cs
new file mode 100644
index 00000000..b612e3cb
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltType.cs
@@ -0,0 +1,26 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver
+{
+ public enum AltType
+ {
+ PRIMITIVE,
+ OBJECT,
+ ARRAY
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Common/AltType.cs.meta b/Assets/AltTester/Runtime/AltDriver/Common/AltType.cs.meta
new file mode 100644
index 00000000..c13852e2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Common/AltType.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 632aee6667ab7de4491c355f9b5350bc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication.meta b/Assets/AltTester/Runtime/AltDriver/Communication.meta
new file mode 100644
index 00000000..e9893a6e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 783070ce1051949e5b0896aae6e2fd33
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/BaseDriver.cs b/Assets/AltTester/Runtime/AltDriver/Communication/BaseDriver.cs
new file mode 100644
index 00000000..5c3c1547
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/BaseDriver.cs
@@ -0,0 +1,82 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Diagnostics;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+using AltWebSocketSharp;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Communication
+{
+ public class BaseDriver
+ {
+ protected static readonly NLog.Logger Logger = DriverLogManager.Instance.GetCurrentClassLogger();
+
+ protected DriverWebSocketClient WsClient = null;
+
+ protected bool isRunning = false;
+
+ public bool IsRunning { get { return this.isRunning; } }
+ public bool IsAlive { get { return this.WsClient != null && this.WsClient.IsAlive; } }
+
+ public event EventHandler OnMessage;
+ public event EventHandler OnMessageData;
+ public event EventHandler OnCloseEvent;
+ protected string path;
+
+ public BaseDriver(string path)
+ {
+ this.path = path;
+ }
+
+ public void Close()
+ {
+ Logger.Info(string.Format("Closing connection to AltTester® on: '{0}'.", this.WsClient.URI));
+
+ this.isRunning = false;
+ this.WsClient.Close();
+ }
+
+ public void Connect(string host, int port, int connectTimeout = 60, string appName = "__default__", string platform = "unknown", string platformVersion = "unknown", string deviceInstanceId = "unknown", string appId = "unknown", string driverType = "unknown")
+ {
+ this.isRunning = false;
+ this.WsClient = new DriverWebSocketClient(host, port, path, appName, connectTimeout, platform, platformVersion, deviceInstanceId, appId, driverType);
+ this.WsClient.OnMessage += (sender, e) =>
+ {
+ if (e.IsText)
+ {
+ if (e.Data.Contains("driverRegistered"))
+ {
+ WsClient.DriverRegisteredCalled = true;
+ return;
+ }
+ OnMessageData.Invoke(this, e.Data);
+ return;
+ }
+ this.OnMessage.Invoke(this, e.RawData);
+ };
+ this.WsClient.OnCloseEvent += (sender, data) =>
+ {
+ OnCloseEvent.Invoke(this, data);
+ };
+ this.WsClient.Connect();
+ }
+
+
+
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/BaseDriver.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/BaseDriver.cs.meta
new file mode 100644
index 00000000..867087dd
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/BaseDriver.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: aa0c3af707b57bb4e9954f886eac3a74
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/DriverCommunicationHandler.cs b/Assets/AltTester/Runtime/AltDriver/Communication/DriverCommunicationHandler.cs
new file mode 100644
index 00000000..dd20287a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/DriverCommunicationHandler.cs
@@ -0,0 +1,380 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver.Commands;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+using AltTester.AltTesterUnitySDK.Driver.Notifications;
+using AltWebSocketSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Communication
+{
+ public class DriverCommunicationHandler : IDriverCommunication
+ {
+ private static readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+
+ private readonly JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings
+ {
+ ContractResolver = new DefaultContractResolver(),
+ ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
+ Culture = CultureInfo.InvariantCulture
+ };
+
+ private DriverWebSocketClient wsClient = null;
+
+ private readonly string host;
+ private readonly int port;
+ private readonly string appName;
+ private readonly int connectTimeout;
+ private readonly string platform;
+ private readonly string platformVersion;
+ private readonly string deviceInstanceId;
+ private readonly string appId;
+ private readonly string driverType;
+
+ private int commandTimeout = 60;
+ private float delayAfterCommand = 0;
+ private bool websocketClosedCalled = false;
+ private bool driverRegisteredCalled = false;
+
+ private List messageIdTimeouts = new List();
+
+ private Dictionary> messages;
+
+ private List> loadSceneCallbacks = new List>();
+ private List> unloadSceneCallbacks = new List>();
+ private List> logCallbacks = new List>();
+ private List> applicationPausedCallbacks = new List>();
+
+ public DriverCommunicationHandler(string host, int port, int connectTimeout, string appName, string platform, string platformVersion, string deviceInstanceId, string appId, string driverType = "SDK")
+ {
+ this.host = host;
+ this.port = port;
+ this.appName = appName;
+ this.connectTimeout = connectTimeout;
+ this.platform = platform;
+ this.platformVersion = platformVersion;
+ this.deviceInstanceId = deviceInstanceId;
+ this.appId = appId;
+ this.driverType = driverType;
+
+ this.messages = new Dictionary>();
+ }
+
+ public void Connect()
+ {
+ this.wsClient = new DriverWebSocketClient(this.host, this.port, "/altws", this.appName, this.connectTimeout, this.platform, this.platformVersion, this.deviceInstanceId, this.appId, this.driverType);
+ this.wsClient.OnMessage += (sender, e) =>
+ {
+ OnMessage(sender, e.Data);
+ };
+ this.wsClient.OnCloseEvent += (sender, e) =>
+ {
+ websocketClosedCalled = true;
+ };
+
+ this.wsClient.Connect();
+ websocketClosedCalled = false;
+
+ }
+
+ public T Recvall(CommandParams param)
+ {
+ Stopwatch watch = Stopwatch.StartNew();
+ while (true)
+ {
+ while (!messages.ContainsKey(param.messageId) && commandTimeout >= watch.Elapsed.TotalSeconds && !websocketClosedCalled)
+ {
+ Thread.Sleep(10);
+ }
+
+ if (websocketClosedCalled)
+ {
+ throw new AltException("Driver disconnected");
+ }
+ if (commandTimeout < watch.Elapsed.TotalSeconds)
+ {
+
+ messageIdTimeouts.Add(param.messageId);
+ throw new CommandResponseTimeoutException();
+ }
+ Queue queue;
+ messages.TryGetValue(param.messageId, out queue);
+ if (queue == null)
+ {
+ throw new AltException(" Could not find the message");
+ }
+ var message = queue.Dequeue();
+
+ if (queue.Count == 0)
+ {
+ messages.Remove(param.messageId);
+ }
+
+ if (messageIdTimeouts.Contains(message.messageId))
+ {
+ continue;
+ }
+
+ if ((message.error == null || message.error.type != AltErrors.errorInvalidCommand) && (message.messageId != param.messageId || message.commandName != param.commandName))
+ {
+ throw new AltRecvallMessageIdException(string.Format("Response received does not match command send. Expected {0}:{1}. Got {2}:{3}", param.commandName, param.messageId, message.commandName, message.messageId));
+ }
+
+ handleErrors(message.error);
+ if (message.data == null)
+ {
+ return default(T);
+ }
+
+ try
+ {
+ return JsonConvert.DeserializeObject(message.data, jsonSerializerSettings);
+ }
+ catch (JsonReaderException)
+ {
+ throw new ResponseFormatException(typeof(T), message.data);
+ }
+ }
+ }
+
+ public void Send(CommandParams param)
+ {
+ param.messageId = DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString();
+ string message = JsonConvert.SerializeObject(param, jsonSerializerSettings);
+ this.wsClient.Send(message);
+ }
+
+ public void Close()
+ {
+
+ logger.Info(string.Format("Closing connection to AltTester® on: {0}", this.wsClient.URI));
+ websocketClosedCalled = true;
+ this.wsClient.Close();
+ }
+
+ public void SetCommandTimeout(int timeout)
+ {
+ commandTimeout = timeout;
+ }
+
+ protected void OnMessage(object sender, string data)
+ {
+ var message = JsonConvert.DeserializeObject(data, jsonSerializerSettings);
+
+ if (message.isNotification)
+ {
+ handleNotification(message);
+ }
+ else
+ {
+ if (messages.ContainsKey(message.messageId))
+ {
+
+ Queue queue;
+ messages.TryGetValue(message.messageId, out queue);
+ queue.Enqueue(message);
+ }
+ else
+ {
+ var queue = new Queue();
+ queue.Enqueue(message);
+ messages.Add(message.messageId, queue);
+ }
+ }
+ }
+
+ private void handleNotification(CommandResponse message)
+ {
+ handleErrors(message.error);
+
+ switch (message.commandName)
+ {
+ case "loadSceneNotification":
+ AltLoadSceneNotificationResultParams data = JsonConvert.DeserializeObject(message.data, jsonSerializerSettings);
+ foreach (var callback in loadSceneCallbacks)
+ {
+ callback(data);
+ }
+ break;
+ case "unloadSceneNotification":
+ string sceneName = JsonConvert.DeserializeObject(message.data, jsonSerializerSettings);
+ foreach (var callback in unloadSceneCallbacks)
+ {
+ callback(sceneName);
+ }
+ break;
+ case "logNotification":
+ AltLogNotificationResultParams data1 = JsonConvert.DeserializeObject(message.data, jsonSerializerSettings);
+ foreach (var callback in logCallbacks)
+ {
+ callback(data1);
+ }
+ break;
+ case "applicationPausedNotification":
+ bool data2 = JsonConvert.DeserializeObject(message.data, jsonSerializerSettings);
+ foreach (var callback in applicationPausedCallbacks)
+ {
+ callback(data2);
+ }
+ break;
+ case "driverRegistered":
+ wsClient.DriverRegisteredCalled = true;
+ break;
+ }
+ }
+
+ private void handleErrors(CommandError error)
+ {
+ if (error == null)
+ {
+ return;
+ }
+
+ logger.Debug(error.type + ": " + error.message);
+ logger.Debug(error.trace);
+
+ switch (error.type)
+ {
+ case AltErrors.errorNotFound:
+ throw new NotFoundException(error.message);
+ case AltErrors.errorSceneNotFound:
+ throw new SceneNotFoundException(error.message);
+ case AltErrors.errorPropertyNotFound:
+ throw new PropertyNotFoundException(error.message);
+ case AltErrors.errorMethodNotFound:
+ throw new MethodNotFoundException(error.message);
+ case AltErrors.errorComponentNotFound:
+ throw new ComponentNotFoundException(error.message);
+ case AltErrors.errorAssemblyNotFound:
+ throw new AssemblyNotFoundException(error.message);
+ case AltErrors.errorCouldNotPerformOperation:
+ throw new CouldNotPerformOperationException(error.message);
+ case AltErrors.errorMethodWithGivenParametersNotFound:
+ throw new MethodWithGivenParametersNotFoundException(error.message);
+ case AltErrors.errorFailedToParseArguments:
+ throw new FailedToParseArgumentsException(error.message);
+ case AltErrors.errorInvalidParameterType:
+ throw new InvalidParameterTypeException(error.message);
+ case AltErrors.errorObjectWasNotFound:
+ throw new ObjectWasNotFoundException(error.message);
+ case AltErrors.errorPropertyNotSet:
+ throw new PropertyNotFoundException(error.message);
+ case AltErrors.errorNullReference:
+ throw new NullReferenceException(error.message);
+ case AltErrors.errorUnknownError:
+ throw new UnknownErrorException(error.message);
+ case AltErrors.errorFormatException:
+ throw new FormatException(error.message);
+ case AltErrors.errorInvalidPath:
+ throw new InvalidPathException(error.message);
+ case AltErrors.errorInvalidCommand:
+ throw new InvalidCommandException(error.message);
+ case AltErrors.errorInputModule:
+ throw new AltInputModuleException(error.message);
+ case AltErrors.errorCameraNotFound:
+ throw new AltCameraNotFoundException(error.message);
+ }
+
+ logger.Debug(error.type + " is not handled by driver.");
+ throw new UnknownErrorException(error.message);
+ }
+
+ public void AddNotificationListener(NotificationType notificationType, Action callback, bool overwrite)
+ {
+ switch (notificationType)
+ {
+ case NotificationType.LOADSCENE:
+ if (callback.GetType() != typeof(Action))
+ {
+ throw new InvalidCastException(String.Format("callback must be of type: {0} and not {1}", typeof(Action), callback.GetType()));
+ }
+ if (overwrite)
+ loadSceneCallbacks.Clear();
+ loadSceneCallbacks.Add(callback as Action);
+ break;
+ case NotificationType.UNLOADSCENE:
+ if (callback.GetType() != typeof(Action))
+ {
+ throw new InvalidCastException(String.Format("callback must be of type: {0} and not {1}", typeof(Action), callback.GetType()));
+ }
+ if (overwrite)
+ unloadSceneCallbacks.Clear();
+ unloadSceneCallbacks.Add(callback as Action);
+ break;
+ case NotificationType.LOG:
+ if (callback.GetType() != typeof(Action))
+ {
+ throw new InvalidCastException(String.Format("callback must be of type: {0} and not {1}", typeof(Action), callback.GetType()));
+ }
+ if (overwrite)
+ logCallbacks.Clear();
+ logCallbacks.Add(callback as Action);
+ break;
+ case NotificationType.APPLICATION_PAUSED:
+ if (callback.GetType() != typeof(Action))
+ {
+ throw new InvalidCastException(String.Format("callback must be of type: {0} and not {1}", typeof(Action), callback.GetType()));
+ }
+ if (overwrite)
+ applicationPausedCallbacks.Clear();
+ applicationPausedCallbacks.Add(callback as Action);
+ break;
+ }
+ }
+
+ public void RemoveNotificationListener(NotificationType notificationType)
+ {
+ switch (notificationType)
+ {
+ case NotificationType.LOADSCENE:
+ loadSceneCallbacks.Clear();
+ break;
+ case NotificationType.UNLOADSCENE:
+ unloadSceneCallbacks.Clear();
+ break;
+ case NotificationType.LOG:
+ logCallbacks.Clear();
+ break;
+ case NotificationType.APPLICATION_PAUSED:
+ applicationPausedCallbacks.Clear();
+ break;
+ }
+ }
+
+ public void SetDelayAfterCommand(float delay)
+ {
+ delayAfterCommand = delay;
+ }
+
+ public float GetDelayAfterCommand()
+ {
+ return delayAfterCommand;
+ }
+
+ public void SleepFor(float time)
+ {
+ Utils.SleepFor(time);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/DriverCommunicationHandler.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/DriverCommunicationHandler.cs.meta
new file mode 100644
index 00000000..81855cb2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/DriverCommunicationHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8bb318bb4fff545f2bf135e7caf8dba6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/DriverWebSocketClient.cs b/Assets/AltTester/Runtime/AltDriver/Communication/DriverWebSocketClient.cs
new file mode 100644
index 00000000..e5419365
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/DriverWebSocketClient.cs
@@ -0,0 +1,221 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Diagnostics;
+using System.Threading;
+using AltTester.AltTesterUnitySDK.Driver;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+using AltTester.AltTesterUnitySDK.Driver.Proxy;
+using AltWebSocketSharp;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Communication
+{
+ public class DriverWebSocketClient
+ {
+ private static readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+
+ private readonly string host;
+ private readonly int port;
+ private readonly string uri;
+ private readonly string appName;
+ private readonly int connectTimeout;
+ private readonly string platform;
+ private readonly string platformVersion;
+ private readonly string deviceInstanceId;
+ private string appId;
+ private string driverType;
+
+ private String error = null;
+
+ private int closeCode = 0;
+ private string closeReason = null;
+
+ private ClientWebSocket wsClient = null;
+ public event EventHandler OnMessage;
+ public event EventHandler OnCloseEvent;
+
+ public bool IsAlive { get { return this.wsClient != null && this.wsClient.IsAlive; } }
+ public string URI { get { return this.uri; } }
+ public bool DriverRegisteredCalled = false;
+
+ public DriverWebSocketClient(string host, int port, string path, string appName, int connectTimeout, string platform, string platformVersion, string deviceInstanceId, string appId, string driverType)
+ {
+ this.host = host;
+ this.port = port;
+ this.appName = appName;
+ this.connectTimeout = connectTimeout;
+ this.platform = platform;
+ this.platformVersion = platformVersion;
+ this.deviceInstanceId = deviceInstanceId;
+ this.appId = appId;
+ this.driverType = driverType;
+
+ this.error = null;
+ this.closeCode = 0;
+ this.closeReason = null;
+
+ this.uri = Utils.CreateURI(host, port, path, appName, platform, platformVersion, deviceInstanceId, appId, driverType).ToString();
+ }
+
+ private void CheckCloseMessage()
+ {
+ if (this.closeCode != 0 && this.closeReason != null)
+ {
+ if (this.closeCode == 4001)
+ {
+ throw new NoAppConnectedException(this.closeReason);
+ }
+
+ if (this.closeCode == 4002)
+ {
+ throw new AppDisconnectedException(this.closeReason);
+ }
+
+ if (this.closeCode == 4005)
+ {
+ throw new MultipleDriversException(this.closeReason);
+ }
+ if (closeCode == 4007)
+ {
+ throw new MultipleDriversTryingToConnectException(closeReason);
+ }
+
+ throw new ConnectionException(string.Format("Connection closed by AltTester® Server with reason: {0}.", this.closeReason));
+ }
+ }
+
+ private void CheckError()
+ {
+ if (this.error != null)
+ {
+ throw new ConnectionException(this.error);
+ }
+ }
+
+ protected void OnError(object sender, AltWebSocketSharp.ErrorEventArgs e)
+ {
+ logger.Error(e.Message);
+ if (e.Exception != null)
+ {
+ logger.Error(e.Exception);
+ }
+
+ this.error = e.Message;
+ }
+
+ protected void OnClose(object sender, CloseEventArgs e)
+ {
+ logger.Debug("Connection to AltTester® Server closed: [Code:{0}, Reason:{1}].", e.Code, e.Reason);
+ OnCloseEvent.Invoke(this, e);
+ DriverRegisteredCalled = false;
+ this.closeCode = e.Code;
+ this.closeReason = e.Reason;
+ }
+
+ public void Connect()
+ {
+ logger.Info("Connecting to: '{0}'.", this.uri);
+
+ int delay = 100;
+
+ this.wsClient = new ClientWebSocket(this.uri);
+
+ string proxyUri = new ProxyFinder().GetProxy(string.Format("http://{0}:{1}", this.host, this.port), this.host);
+ if (proxyUri != null)
+ {
+ wsClient.SetProxy(proxyUri, null, null);
+ }
+
+ this.wsClient.OnError += OnError;
+ this.wsClient.OnClose += OnClose;
+ this.wsClient.OnMessage += (sender, message) => this.OnMessage.Invoke(this, message);
+
+ Stopwatch watch = Stopwatch.StartNew();
+ int retries = 0;
+
+ while (this.connectTimeout > watch.Elapsed.TotalSeconds)
+ {
+ this.error = null;
+ this.closeCode = 0;
+ this.closeReason = null;
+
+ if (retries > 0)
+ {
+ logger.Debug(string.Format("Retrying #{0} to connect to: '{1}'.", retries, this.uri));
+ }
+
+ try
+ {
+ wsClient.Connect();
+ }
+ catch (Exception e)
+ {
+ logger.Debug(string.Format("Connection error: {0}", e.Message));
+ }
+ float waitForNotification = 0;
+ try
+ {
+ while (waitForNotification < 5000)
+ {
+ if (DriverRegisteredCalled)
+ {
+ logger.Debug(string.Format("Connected to: '{0}'.", this.uri));
+ return;
+ }
+ Thread.Sleep(delay);
+ waitForNotification += delay;
+ this.CheckCloseMessage();
+ }
+ }
+ catch (Exception e)
+ {
+ logger.Debug($"Closed connection because {e}");
+ }
+ retries++;
+ }
+
+ this.CheckCloseMessage();
+ this.CheckError();
+
+ if (watch.Elapsed.TotalSeconds > this.connectTimeout && !wsClient.IsAlive)
+ {
+ throw new ConnectionTimeoutException(string.Format("Failed to connect to AltTester® Server on host: {0} port: {1}.", this.host, this.port));
+ }
+ logger.Debug(string.Format("Connected to: '{0}'.", this.uri));
+
+ }
+
+ public void Close()
+ {
+ logger.Info(string.Format("Closing connection to AltTester® Server on: '{0}'.", this.uri));
+ DriverRegisteredCalled = false;
+ this.wsClient.Close();
+ }
+
+ public void Send(string message)
+ {
+ if (!this.IsAlive)
+ {
+ logger.Warn("The connection is already closed.");
+ return;
+ }
+
+ this.wsClient.Send(message);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/DriverWebSocketClient.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/DriverWebSocketClient.cs.meta
new file mode 100644
index 00000000..2489eec1
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/DriverWebSocketClient.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a55337c82961c4d2b958e866037fea94
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/GetConnectedAppDriver.cs b/Assets/AltTester/Runtime/AltDriver/Communication/GetConnectedAppDriver.cs
new file mode 100644
index 00000000..45295020
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/GetConnectedAppDriver.cs
@@ -0,0 +1,32 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Communication
+{
+ public class GetConnectedAppDriver : BaseDriver
+ {
+ private new string path = "/altws/connected-app";
+
+ public GetConnectedAppDriver(string path) : base(path)
+ {
+ }
+ public void Send()
+ {
+ WsClient.Send("GetApps");
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/GetConnectedAppDriver.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/GetConnectedAppDriver.cs.meta
new file mode 100644
index 00000000..afe152ab
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/GetConnectedAppDriver.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2f6f70059484361488cd6a8686d1ac37
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/IDriverCommunication.cs b/Assets/AltTester/Runtime/AltDriver/Communication/IDriverCommunication.cs
new file mode 100644
index 00000000..8fc62460
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/IDriverCommunication.cs
@@ -0,0 +1,36 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using AltTester.AltTesterUnitySDK.Driver.Notifications;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Commands
+{
+ public interface IDriverCommunication
+ {
+ void Send(CommandParams param);
+ T Recvall(CommandParams param);
+ void AddNotificationListener(NotificationType notificationType, Action callback, bool overwrite);
+ void RemoveNotificationListener(NotificationType notificationType);
+ void Connect();
+ void Close();
+ void SetCommandTimeout(int timeout);
+ void SetDelayAfterCommand(float delay);
+ float GetDelayAfterCommand();
+ void SleepFor(float time);
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/IDriverCommunication.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/IDriverCommunication.cs.meta
new file mode 100644
index 00000000..f62ef54a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/IDriverCommunication.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 14340a274d45041cfad7c0ba43c90471
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/LiveUpdateDriver.cs b/Assets/AltTester/Runtime/AltDriver/Communication/LiveUpdateDriver.cs
new file mode 100644
index 00000000..dd0d87c2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/LiveUpdateDriver.cs
@@ -0,0 +1,54 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Threading;
+using Newtonsoft.Json;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Communication
+{
+
+ public class LiveUpdateDriver : BaseDriver
+ {
+ public LiveUpdateDriver(string path) : base(path)
+ {
+ }
+ public void Start()
+ {
+ this.WsClient.Send("Start");
+ this.isRunning = true;
+ }
+
+ public void Stop()
+ {
+ this.WsClient.Send("Stop");
+ this.isRunning = false;
+ }
+
+ public void UpdateFrameRate(int frameRate)
+ {
+ this.WsClient.Send(string.Format("FrameRate:{0}", frameRate));
+ }
+
+ public void UpdateQuality(int quality)
+ {
+ this.WsClient.Send(string.Format("Quality:{0}", quality));
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/LiveUpdateDriver.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/LiveUpdateDriver.cs.meta
new file mode 100644
index 00000000..c0b97b59
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/LiveUpdateDriver.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 09fdd6df051f140d3a078418b423d84e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/Utils.cs b/Assets/AltTester/Runtime/AltDriver/Communication/Utils.cs
new file mode 100644
index 00000000..fd86cb7d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/Utils.cs
@@ -0,0 +1,67 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Threading;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Communication
+{
+ public class Utils
+ {
+ public static Uri CreateURI(string host, int port, string path, string appName, string platform, string platformVersion, string deviceInstanceId, string appId = null, string driverType = "SDK")
+ {
+ Uri uri;
+ if (string.IsNullOrEmpty(appId))
+ {
+ if (!Uri.TryCreate(string.Format("ws://{0}:{1}{2}?appName={3}&platform={4}&platformVersion={5}&deviceInstanceId={6}&driverType={7}", host, port, path, Uri.EscapeDataString(appName), Uri.EscapeDataString(platform), Uri.EscapeDataString(platformVersion), Uri.EscapeDataString(deviceInstanceId), Uri.EscapeDataString(driverType)), UriKind.Absolute, out uri))
+ {
+ throw new Exception(String.Format("Invalid host or port {0}:{1}{2}", host, port, path));
+ }
+ }
+ else
+ {
+ if (!Uri.TryCreate(string.Format("ws://{0}:{1}{2}?appName={3}&platform={4}&platformVersion={5}&deviceInstanceId={6}&appId={7}&driverType={8}", host, port, path, Uri.EscapeDataString(appName), Uri.EscapeDataString(platform), Uri.EscapeDataString(platformVersion), Uri.EscapeDataString(deviceInstanceId), Uri.EscapeDataString(appId), Uri.EscapeDataString(driverType)), UriKind.Absolute, out uri))
+ {
+ throw new Exception(String.Format("Invalid host or port {0}:{1}{2}", host, port, path));
+ }
+ }
+
+
+ return uri;
+ }
+
+ public static void SleepFor(float time)
+ {
+ Thread.Sleep(System.Convert.ToInt32(time * 1000));
+ }
+
+ public static string TrimLog(string log, int maxLogLength = 1000)
+ {
+ if (string.IsNullOrEmpty(log))
+ {
+ return log;
+ }
+
+ if (log.Length <= maxLogLength)
+ {
+ return log;
+ }
+
+ return log.Substring(0, maxLogLength) + "[...]";
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Communication/Utils.cs.meta b/Assets/AltTester/Runtime/AltDriver/Communication/Utils.cs.meta
new file mode 100644
index 00000000..35cca4b1
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Communication/Utils.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c22ac1cc9e1a442e0b283b3d62280a3d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging.meta b/Assets/AltTester/Runtime/AltDriver/Logging.meta
new file mode 100644
index 00000000..938c5dcd
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fd5544f1a9587764ab347b3609eeb29c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevel.cs b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevel.cs
new file mode 100644
index 00000000..bebf46ea
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevel.cs
@@ -0,0 +1,33 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+
+namespace AltTester.AltTesterUnitySDK.Driver.Logging
+{
+ public enum AltLogLevel
+ {
+ Trace = 0,
+ Debug = 1,
+ Info = 2,
+ Warn = 3,
+ Error = 4,
+ Fatal = 5,
+ Off = 6,
+ }
+
+
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevel.cs.meta b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevel.cs.meta
new file mode 100644
index 00000000..10e75fb3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevel.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6c7ac9af279a526469a40314ed29348b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevelExtensions.cs b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevelExtensions.cs
new file mode 100644
index 00000000..a914ad20
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevelExtensions.cs
@@ -0,0 +1,29 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using NLog;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Logging
+{
+ public static class AltLogLevelExtensions
+ {
+ public static LogLevel ToNLogLevel(this AltLogLevel logLevel)
+ {
+ return LogLevel.FromOrdinal((int)logLevel);
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevelExtensions.cs.meta b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevelExtensions.cs.meta
new file mode 100644
index 00000000..6e7110c3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogLevelExtensions.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6b326f421fcdb704fb0056beac04cae7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/AltLogger.cs b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogger.cs
new file mode 100644
index 00000000..3c398b6e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogger.cs
@@ -0,0 +1,26 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Logging
+{
+ public enum AltLogger
+ {
+ File = 0,
+ Unity = 1,
+ Console = 2
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/AltLogger.cs.meta b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogger.cs.meta
new file mode 100644
index 00000000..f80712ea
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/AltLogger.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 98d68279c8de207448a374786fef4263
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/DriverLogManager.cs b/Assets/AltTester/Runtime/AltDriver/Logging/DriverLogManager.cs
new file mode 100644
index 00000000..bc8afa63
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/DriverLogManager.cs
@@ -0,0 +1,134 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using NLog;
+using NLog.Config;
+using NLog.Layouts;
+using NLog.Targets;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Logging
+{
+ public class DriverLogManager
+ {
+ const string LOGSFILEPATH = "AltTester.log";
+
+ public static LogFactory Instance { get { return instance.Value; } }
+
+ private static readonly Lazy instance = new Lazy(buildLogFactory);
+
+ internal static void SetupAltDriverLogging(Dictionary minLogLevels)
+ {
+ foreach (var key in minLogLevels.Keys)
+ {
+ SetMinLogLevel(key, minLogLevels[key]);
+ }
+
+ Instance.GetCurrentClassLogger().Info(AltLogLevel.Info.ToNLogLevel());
+ AltLogLevel level;
+ if (minLogLevels.TryGetValue(AltLogger.File, out level) && level != AltLogLevel.Off)
+ Instance.GetCurrentClassLogger().Info("AltTester® logs are saved at: " + Path.Combine(System.Environment.CurrentDirectory, LOGSFILEPATH));
+ }
+
+ ///
+ /// Reconfigures the NLog logging level.
+ ///
+ /// The to be set.
+ public static void SetMinLogLevel(AltLogger loggerType, AltLogLevel minLogLevel)
+ {
+
+ foreach (var rule in Instance.Configuration.LoggingRules)
+ {
+ if (rule.Targets[0].Name == string.Format("AltDriver{0}Target", loggerType))
+ {
+ if (minLogLevel == AltLogLevel.Off)
+ {
+ rule.SetLoggingLevels(LogLevel.Off, LogLevel.Off);
+ }
+ else
+ {
+ rule.SetLoggingLevels(minLogLevel.ToNLogLevel(), LogLevel.Fatal);
+ }
+ }
+ }
+
+ Instance.ReconfigExistingLoggers();
+ }
+
+ public static void ResumeLogging()
+ {
+ Instance.ResumeLogging();
+ }
+
+ public static void SuspendLogging()
+ {
+ Instance.SuspendLogging();
+ }
+
+ public static bool IsLoggingEnabled()
+ {
+ return Instance.IsLoggingEnabled();
+ }
+
+ public static void StopLogging()
+ {
+ while (IsLoggingEnabled())
+ SuspendLogging();
+ }
+
+ private static LogFactory buildLogFactory()
+ {
+ var config = new LoggingConfiguration();
+
+#if UNITY_EDITOR || ALTTESTER
+ var unityTarget = new UnityTarget("AltDriverUnityTarget")
+ {
+ Layout = Layout.FromString("${longdate}|Driver|${level:uppercase=true}|${message}"),
+ };
+ config.AddRuleForOneLevel(LogLevel.Off, unityTarget);
+ config.LoggingRules[config.LoggingRules.Count - 1].RuleName = "AltServerUnityRule";
+#else
+ var consoleTarget = new ConsoleTarget("AltDriverConsoleTarget")
+ {
+ Layout = Layout.FromString("${longdate}|${level:uppercase=true}|${message}")
+ };
+ config.AddRuleForOneLevel(LogLevel.Off, consoleTarget);
+ config.LoggingRules[config.LoggingRules.Count - 1].RuleName = "AltServerConsoleRule";
+#endif
+ var path = Path.Combine(System.Environment.CurrentDirectory, LOGSFILEPATH);
+ var logfile = new FileTarget("AltDriverFileTarget")
+ {
+ FileName = path,
+ Layout = Layout.FromString("${longdate}|${level:uppercase=true}|${message}"),
+ DeleteOldFileOnStartup = true, //overwrite existing log file.
+ KeepFileOpen = true,
+ ConcurrentWrites = false
+ };
+ config.AddRuleForOneLevel(LogLevel.Debug, logfile);
+ config.LoggingRules[config.LoggingRules.Count - 1].RuleName = "AltServerFileRule";
+
+ LogFactory logFactory = new LogFactory
+ {
+ Configuration = config,
+ AutoShutdown = true
+ };
+ return logFactory;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/DriverLogManager.cs.meta b/Assets/AltTester/Runtime/AltDriver/Logging/DriverLogManager.cs.meta
new file mode 100644
index 00000000..88a0511d
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/DriverLogManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 03790dc916ec7224fae16cdc174d9c90
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/UnityTarget.cs b/Assets/AltTester/Runtime/AltDriver/Logging/UnityTarget.cs
new file mode 100644
index 00000000..8bfca207
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/UnityTarget.cs
@@ -0,0 +1,57 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#if UNITY_EDITOR || ALTTESTER
+using NLog;
+using NLog.Targets;
+using UnityEngine;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Logging
+{
+ /// An appender which logs to the unity console.
+ public class UnityTarget : TargetWithLayout
+ {
+ public UnityTarget(string name)
+ {
+ this.Name = name;
+ }
+ ///
+ protected override void Write(LogEventInfo logEvent)
+ {
+ string message = this.Layout.Render(logEvent);
+
+ if (logEvent.Level >= LogLevel.Error)
+ {
+ // everything above or equal to error is an error
+ Debug.LogError(message);
+ }
+ else if (logEvent.Level >= LogLevel.Warn)
+ {
+ // everything that is a warning up to error is logged as warning
+ Debug.LogWarning(message);
+ }
+ else
+ {
+ // everything else we'll just log normally
+ Debug.Log(message);
+ }
+ }
+
+ }
+
+}
+#endif
diff --git a/Assets/AltTester/Runtime/AltDriver/Logging/UnityTarget.cs.meta b/Assets/AltTester/Runtime/AltDriver/Logging/UnityTarget.cs.meta
new file mode 100644
index 00000000..8b743980
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Logging/UnityTarget.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 41bd57b20af2391448d8d511d8e89b18
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications.meta b/Assets/AltTester/Runtime/AltDriver/Notifications.meta
new file mode 100644
index 00000000..3c0b33f2
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5361c82b649b1164f94152d5d865c3ad
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneMode.cs b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneMode.cs
new file mode 100644
index 00000000..33823314
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneMode.cs
@@ -0,0 +1,27 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+namespace AltTester.AltTesterUnitySDK.Driver.Notifications
+{
+ public enum AltLoadSceneMode
+ {
+
+ Single = 0,
+
+ Additive = 1
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneMode.cs.meta b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneMode.cs.meta
new file mode 100644
index 00000000..86a95307
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneMode.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0677ab2eea893a844a563fe86e52664b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneNotificationResultParams.cs b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneNotificationResultParams.cs
new file mode 100644
index 00000000..22d29cc3
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneNotificationResultParams.cs
@@ -0,0 +1,32 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+
+namespace AltTester.AltTesterUnitySDK.Driver.Notifications
+{
+ public class AltLoadSceneNotificationResultParams
+ {
+ public string sceneName;
+ public AltLoadSceneMode loadSceneMode;
+
+ public AltLoadSceneNotificationResultParams(string sceneName, AltLoadSceneMode loadSceneMode)
+ {
+ this.sceneName = sceneName;
+ this.loadSceneMode = loadSceneMode;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneNotificationResultParams.cs.meta b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneNotificationResultParams.cs.meta
new file mode 100644
index 00000000..0d923bee
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLoadSceneNotificationResultParams.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b926785747e84384fad93ecd29684558
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/AltLogNotificationResultParams.cs b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLogNotificationResultParams.cs
new file mode 100644
index 00000000..6f568916
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLogNotificationResultParams.cs
@@ -0,0 +1,35 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Notifications
+{
+ public class AltLogNotificationResultParams
+ {
+ public string message;
+ public string stackTrace;
+ public AltLogLevel level;
+
+ public AltLogNotificationResultParams(string message, string stackTrace, AltLogLevel level)
+ {
+ this.message = message;
+ this.stackTrace = stackTrace;
+ this.level = level;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/AltLogNotificationResultParams.cs.meta b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLogNotificationResultParams.cs.meta
new file mode 100644
index 00000000..413849b8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/AltLogNotificationResultParams.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 59ddd3c86241c0041b6b69985f9a0a8c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/BaseNotificationCallBacks.cs b/Assets/AltTester/Runtime/AltDriver/Notifications/BaseNotificationCallBacks.cs
new file mode 100644
index 00000000..9176d7e9
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/BaseNotificationCallBacks.cs
@@ -0,0 +1,43 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using AltTester.AltTesterUnitySDK.Driver.Logging;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Notifications
+{
+ public class BaseNotificationCallBacks : INotificationCallbacks
+ {
+ private static readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
+ public void SceneLoadedCallback(AltLoadSceneNotificationResultParams altLoadSceneNotificationResultParams)
+ {
+ logger.Log(NLog.LogLevel.Info, String.Format("Scene {0} was loaded {1}", altLoadSceneNotificationResultParams.sceneName, altLoadSceneNotificationResultParams.loadSceneMode.ToString()));
+ }
+ public void SceneUnloadedCallback(string sceneName)
+ {
+ logger.Log(NLog.LogLevel.Info, String.Format("Scene {0} was unloaded", sceneName));
+ }
+ public void LogCallback(AltLogNotificationResultParams altLogNotificationResultParams)
+ {
+ logger.Log(NLog.LogLevel.Info, String.Format("Log of type {0} with message {1} was received", altLogNotificationResultParams.level, altLogNotificationResultParams.message));
+ }
+ public void ApplicationPausedCallback(bool applicationPaused)
+ {
+ logger.Log(NLog.LogLevel.Info, String.Format("Application paused: {0}", applicationPaused));
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/BaseNotificationCallBacks.cs.meta b/Assets/AltTester/Runtime/AltDriver/Notifications/BaseNotificationCallBacks.cs.meta
new file mode 100644
index 00000000..90446b65
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/BaseNotificationCallBacks.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 029a368c1a5369a4ea1a987251e07767
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/INotificationCallbacks.cs b/Assets/AltTester/Runtime/AltDriver/Notifications/INotificationCallbacks.cs
new file mode 100644
index 00000000..6dc1964a
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/INotificationCallbacks.cs
@@ -0,0 +1,28 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+
+namespace AltTester.AltTesterUnitySDK.Driver.Notifications
+{
+ public interface INotificationCallbacks
+ {
+ void SceneLoadedCallback(AltLoadSceneNotificationResultParams altLoadSceneNotificationResultParams);
+ void SceneUnloadedCallback(string sceneName);
+ void LogCallback(AltLogNotificationResultParams altLogNotificationResultParams);
+ void ApplicationPausedCallback(bool applicationPaused);
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/INotificationCallbacks.cs.meta b/Assets/AltTester/Runtime/AltDriver/Notifications/INotificationCallbacks.cs.meta
new file mode 100644
index 00000000..8f5f67d5
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/INotificationCallbacks.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 521b3bf8eda103846ba186978c73589e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/NotificationType.cs b/Assets/AltTester/Runtime/AltDriver/Notifications/NotificationType.cs
new file mode 100644
index 00000000..028b70a8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/NotificationType.cs
@@ -0,0 +1,28 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+namespace AltTester.AltTesterUnitySDK.Driver.Notifications
+{
+ public enum NotificationType
+ {
+ LOADSCENE = 0,
+ UNLOADSCENE = 1,
+ LOG = 2,
+ APPLICATION_PAUSED = 3
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Notifications/NotificationType.cs.meta b/Assets/AltTester/Runtime/AltDriver/Notifications/NotificationType.cs.meta
new file mode 100644
index 00000000..94723539
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Notifications/NotificationType.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3d7b8b7e5da248f4995d7474935a085b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy.meta b/Assets/AltTester/Runtime/AltDriver/Proxy.meta
new file mode 100644
index 00000000..70d28808
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 806bb1d231a4a4e09b8234580da084d4
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/AndroidProxyFinder.cs b/Assets/AltTester/Runtime/AltDriver/Proxy/AndroidProxyFinder.cs
new file mode 100644
index 00000000..65146e04
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/AndroidProxyFinder.cs
@@ -0,0 +1,39 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#if !UNITY_EDITOR && UNITY_ANDROID
+using System;
+using UnityEngine;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Proxy
+{
+ public class AndroidProxyFinder : IProxyFinder
+ {
+ public string GetProxy(string uri, string host)
+ {
+ return CallJavaGetProxy(uri);
+ }
+
+ private string CallJavaGetProxy(string uri)
+ {
+ using (var JavaClass = new AndroidJavaClass("com.alttester.utils.AltProxyFinder")) {
+ return JavaClass.CallStatic("getProxy", uri);
+ }
+ }
+ }
+}
+#endif
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/AndroidProxyFinder.cs.meta b/Assets/AltTester/Runtime/AltDriver/Proxy/AndroidProxyFinder.cs.meta
new file mode 100644
index 00000000..1a61b31e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/AndroidProxyFinder.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a5181063236cb4e7db9bfdea22ebef41
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/DotnetProxyFinder.cs b/Assets/AltTester/Runtime/AltDriver/Proxy/DotnetProxyFinder.cs
new file mode 100644
index 00000000..4ec0b84e
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/DotnetProxyFinder.cs
@@ -0,0 +1,40 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Proxy
+{
+ public class DotnetProxyFinder : IProxyFinder
+ {
+ public string GetProxy(string uri, string host)
+ {
+ var Proxy = System.Net.WebRequest.GetSystemWebProxy() as System.Net.WebProxy;
+ if (Proxy != null && Proxy.Address != null)
+ {
+ string proxyUri = Proxy.GetProxy(new Uri(uri)).ToString();
+
+ if (proxyUri != uri)
+ {
+ return proxyUri;
+ }
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/DotnetProxyFinder.cs.meta b/Assets/AltTester/Runtime/AltDriver/Proxy/DotnetProxyFinder.cs.meta
new file mode 100644
index 00000000..e9ae07fa
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/DotnetProxyFinder.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 45ae63197f1314b6387d0a5291cb3f98
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/EnvironmentProxyFinder.cs b/Assets/AltTester/Runtime/AltDriver/Proxy/EnvironmentProxyFinder.cs
new file mode 100644
index 00000000..d66be4d8
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/EnvironmentProxyFinder.cs
@@ -0,0 +1,58 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Linq;
+
+namespace AltTester.AltTesterUnitySDK.Driver.Proxy
+{
+ public class EnvironmentProxyFinder : IProxyFinder
+ {
+ public string GetProxy(string uri, string host)
+ {
+ // TODO: Check HTTPS_PROXY if we use wss
+ string proxyUrl = GetEnv("HTTP_PROXY");
+
+ if (proxyUrl == null)
+ {
+ proxyUrl = GetEnv("ALL_PROXY");
+ }
+
+ if (proxyUrl != null)
+ {
+ string exceptions = GetEnv("NO_PROXY");
+
+ if (!string.IsNullOrEmpty(exceptions))
+ {
+ var exceptionsList = exceptions.Split(';').ToList();
+
+ if (exceptionsList.Contains(proxyUrl))
+ {
+ return null;
+ }
+ }
+ }
+
+ return proxyUrl;
+ }
+
+ private string GetEnv(string key)
+ {
+ return System.Environment.GetEnvironmentVariable(key) ?? System.Environment.GetEnvironmentVariable(key.ToLowerInvariant());
+ }
+ }
+}
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/EnvironmentProxyFinder.cs.meta b/Assets/AltTester/Runtime/AltDriver/Proxy/EnvironmentProxyFinder.cs.meta
new file mode 100644
index 00000000..f55d9b06
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/EnvironmentProxyFinder.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3722f2d5e04e8433290b974303d42fba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AltTester/Runtime/AltDriver/Proxy/IOSProxyFinder.cs b/Assets/AltTester/Runtime/AltDriver/Proxy/IOSProxyFinder.cs
new file mode 100644
index 00000000..450c6e2b
--- /dev/null
+++ b/Assets/AltTester/Runtime/AltDriver/Proxy/IOSProxyFinder.cs
@@ -0,0 +1,44 @@
+/*
+ Copyright(C) 2023 Altom Consulting
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see