From 2cc77fd91f6810d10de1d79e932da4fbca8aab66 Mon Sep 17 00:00:00 2001 From: Kriszta Gombos Date: Wed, 15 May 2024 14:38:14 +0300 Subject: [PATCH 1/4] changed method to lowercase --- .../src/main/java/com/alttester/AltObject.java | 16 +++++++++++++++- .../java/com/alttester/TestsSampleScene1.java | 10 +++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Bindings~/java/src/main/java/com/alttester/AltObject.java b/Bindings~/java/src/main/java/com/alttester/AltObject.java index 1b7ce0a30..f118d925e 100644 --- a/Bindings~/java/src/main/java/com/alttester/AltObject.java +++ b/Bindings~/java/src/main/java/com/alttester/AltObject.java @@ -156,11 +156,12 @@ public T getComponentProperty(AltGetComponentPropertyParams altGetComponentP * @param altWaitForComponentPropertyParams -AltGetComponentPropertyParams * altGetComponentPropertyParams* , * double timeout , double interval , T - * propertyValue* , Altoject obj*. + * propertyValue* , AltObject obj*. * @param propertyValue - The value of the property expected * @param returnType - The type of the property * @return - The value of the given component property */ + @Deprecated public T WaitForComponentProperty(AltWaitForComponentPropertyParams altWaitForComponentPropertyParams, T propertyValue, Class returnType) { @@ -174,6 +175,19 @@ public T WaitForComponentProperty(AltWaitForComponentPropertyParams altWa return response; } + public T waitForComponentProperty(AltWaitForComponentPropertyParams altWaitForComponentPropertyParams, + T propertyValue, + Class returnType) { + + altWaitForComponentPropertyParams.setAltObject(this); + T response = new AltWaitForComponentProperty(messageHandler, + altWaitForComponentPropertyParams, + propertyValue, this) + .Execute(returnType); + Utils.sleepFor(messageHandler.getDelayAfterCommand()); + return response; + } + /** * Sets value of the given component property. * diff --git a/Bindings~/java/src/test/java/com/alttester/TestsSampleScene1.java b/Bindings~/java/src/test/java/com/alttester/TestsSampleScene1.java index 87c77a37a..3c2b1525e 100644 --- a/Bindings~/java/src/test/java/com/alttester/TestsSampleScene1.java +++ b/Bindings~/java/src/test/java/com/alttester/TestsSampleScene1.java @@ -345,7 +345,7 @@ public void testWaitForComponentProperty() throws InterruptedException { componentName, propertyName, "").build(); AltWaitForComponentPropertyParams altWaitForComponentPropertyParams = new AltWaitForComponentPropertyParams.Builder( altGetComponentPropertyParams).build(); - String propertyValue = altElement.WaitForComponentProperty( + String propertyValue = altElement.waitForComponentProperty( altWaitForComponentPropertyParams, "__default__", String.class); @@ -369,7 +369,7 @@ public void testWaitForComponentPropertyComponentNotFound() throws InterruptedEx altGetComponentPropertyParams).build(); assertThrows(ComponentNotFoundException.class, () -> { - Boolean propertyValue = altElement.WaitForComponentProperty( + Boolean propertyValue = altElement.waitForComponentProperty( altWaitForComponentPropertyParams, false, Boolean.class); @@ -394,7 +394,7 @@ public void TestWaitForComponentPropertyNotFound() throws InterruptedException { altGetComponentPropertyParams).build(); assertThrows(PropertyNotFoundException.class, () -> { - Boolean propertyValue = altElement.WaitForComponentProperty( + Boolean propertyValue = altElement.waitForComponentProperty( altWaitForComponentPropertyParams, false, Boolean.class); @@ -418,7 +418,7 @@ public void TestWaitForComponentPropertyTimeOut() throws InterruptedException { altGetComponentPropertyParams).withTimeout(2).build(); assertThrows(WaitTimeOutException.class, () -> { - altElement.WaitForComponentProperty( + altElement.waitForComponentProperty( altWaitForComponentPropertyParams, "Test", String.class); @@ -443,7 +443,7 @@ public void TestWaitForComponentPropertyAssemblyNotFound() throws InterruptedExc altGetComponentPropertyParams).build(); assertThrows(AssemblyNotFoundException.class, () -> { - altElement.WaitForComponentProperty( + altElement.waitForComponentProperty( altWaitForComponentPropertyParams, false, Boolean.class); From d10a752c8ca75999ab3b60ae76e676d0baab5a22 Mon Sep 17 00:00:00 2001 From: Kriszta Gombos Date: Wed, 15 May 2024 14:42:02 +0300 Subject: [PATCH 2/4] eliminated duplicated code --- Bindings~/java/src/main/java/com/alttester/AltObject.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Bindings~/java/src/main/java/com/alttester/AltObject.java b/Bindings~/java/src/main/java/com/alttester/AltObject.java index f118d925e..1a30ebac4 100644 --- a/Bindings~/java/src/main/java/com/alttester/AltObject.java +++ b/Bindings~/java/src/main/java/com/alttester/AltObject.java @@ -166,13 +166,7 @@ public T WaitForComponentProperty(AltWaitForComponentPropertyParams altWa T propertyValue, Class returnType) { - altWaitForComponentPropertyParams.setAltObject(this); - T response = new AltWaitForComponentProperty(messageHandler, - altWaitForComponentPropertyParams, - propertyValue, this) - .Execute(returnType); - Utils.sleepFor(messageHandler.getDelayAfterCommand()); - return response; + return waitForComponentProperty(altWaitForComponentPropertyParams, propertyValue, returnType); } public T waitForComponentProperty(AltWaitForComponentPropertyParams altWaitForComponentPropertyParams, From 180047d20b718dca9d095ee57c14eae7a735f3f4 Mon Sep 17 00:00:00 2001 From: Iuliana Todoran <62327834+iulianatodoran@users.noreply.github.com> Date: Tue, 21 May 2024 10:20:16 +0300 Subject: [PATCH 3/4] Changed unity version to 2020 (#1604) --- Assets/AltTester/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/AltTester/package.json b/Assets/AltTester/package.json index bb9f7d63d..80240d035 100644 --- a/Assets/AltTester/package.json +++ b/Assets/AltTester/package.json @@ -3,7 +3,7 @@ "version": "2.1.1", "displayName": "AltTester Unity SDK", "description": "AltTester Unity SDK is an open-source UI driven test automation tool that helps you find objects in your game and interacts with them using tests written in C#, Python, Java or Robot Framework.", - "unity": "2021.3", + "unity": "2020.3", "documentationUrl": "https://alttester.com/docs/sdk/latest/", "author": { "name": "AltTester", From 37bd87c99c53ac66dd9dcb9506f15cd399c96d72 Mon Sep 17 00:00:00 2001 From: Iuliana Todoran <62327834+iulianatodoran@users.noreply.github.com> Date: Tue, 21 May 2024 16:25:05 +0300 Subject: [PATCH 4/4] Removed (R) and spaces from code snippets (#1608) --- Docs/source/pages/alttester-with-cloud.md | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Docs/source/pages/alttester-with-cloud.md b/Docs/source/pages/alttester-with-cloud.md index 0996542da..61e1b8946 100644 --- a/Docs/source/pages/alttester-with-cloud.md +++ b/Docs/source/pages/alttester-with-cloud.md @@ -807,8 +807,8 @@ Keep in mind that the setup is different for Android and iOS. - wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopLinuxBatchmode.zip - unzip AltTesterDesktopLinuxBatchmode.zip - cd AltTesterDesktopLinux - - chmod +x "AltTester(R) Desktop.x86_64" - - ./"AltTester(R) Desktop.x86_64" -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & + - chmod +x AltTester Desktop.x86_64 + - ./AltTesterDesktop.x86_64 -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & ``` The `&` symbol is used to make the application run in the background. Failure to add the symbol will cause the commands following it to not be triggered. @@ -826,7 +826,7 @@ Keep in mind that the setup is different for Android and iOS. - kill the AltTester® Desktop process ``` - cd AltTesterDesktopLinux - - kill -2 $(ps -ef | awk '/AltTester\(R\) Desktop.x86_64/{print $2}') + - kill -2 `ps -ef | awk '/AltTesterDesktop.x86_64/{print $2}'` ``` - **for remote connection** - a way to connect to AltTester® Server, within the AltTester® Desktop application is by installing AltTester® Desktop on an [Amazon EC2 Instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Instances.html). The details of creating an EC2 Instance are out of scope, however, these are the main things to take into account for a successful connection: - create a [Windows instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_Infrastructure.html) @@ -841,7 +841,7 @@ Keep in mind that the setup is different for Android and iOS. ```eval_rst .. image:: ../_static/img/alttester-with-cloud/aws-connect-to-instance.png ``` - - [Download AltTester® Desktop for Windows](https://alttester.com/app/uploads/AltTester/desktop/AltTester(R)%20Desktop__v2.1.1.exe) and install it on the Instance + - [Download AltTester® Desktop for Windows](https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktop__v2.1.1.exe) and install it on the Instance - [Associate an Elastic IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-associating), so that the IP remains constant after each opening of the instance ```eval_rst .. image:: ../_static/img/alttester-with-cloud/aws-associate-elastic-ip.png @@ -1022,8 +1022,8 @@ Keep in mind that the setup is different for Android and iOS. - wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopLinuxBatchmode.zip - unzip AltTesterDesktopLinuxBatchmode.zip - cd AltTesterDesktopLinux - - chmod +x "AltTester(R) Desktop.x86_64" - - ./A"AltTester(R) Desktop.x86_64" -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & + - chmod +x AltTesterDesktop.x86_64 + - ./AltTesterDesktop.x86_64 -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & ``` The `&` symbol is used to make the application run in the background. Failure to add the symbol will cause the commands following it to not be triggered. @@ -1041,7 +1041,7 @@ Keep in mind that the setup is different for Android and iOS. - kill the AltTester® Desktop process: ``` - cd AltTesterDesktopLinux - - kill -2 $(ps -ef | awk '/AltTester\(R\) Desktop.x86_64/{print $2}') + - kill -2 `ps -ef | awk '/AltTesterDesktop.x86_64/{print $2}'` ``` - **for remote connection** - a way to connect to AltTester® Server, within the AltTester® Desktop application is by installing AltTester® Desktop on an [Amazon EC2 Instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Instances.html). The details of creating an EC2 Instance are out of scope, however, these are the main things to take into account for a successful connection: @@ -1057,7 +1057,7 @@ Keep in mind that the setup is different for Android and iOS. ```eval_rst .. image:: ../_static/img/alttester-with-cloud/aws-connect-to-instance.png ``` - - [Download AltTester® Desktop for Windows](https://alttester.com/app/uploads/AltTester/desktop/AltTester(R)%20Desktop__v2.1.1.exe) and install it on the Instance + - [Download AltTester® Desktop for Windows](https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktop__v2.1.1.exe) and install it on the Instance - [Associate an Elastic IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-associating), so that the IP remains constant after each opening of the instance ```eval_rst .. image:: ../_static/img/alttester-with-cloud/aws-associate-elastic-ip.png @@ -1183,7 +1183,7 @@ You can connect to AltTester® Desktop in two ways in order to run the tests ser - run command: ``` - "AltTester(R) Desktop.exe" -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt + AltTesterDesktop.exe -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt ``` We have now a VM where AltTester® Server is listening for connections. Further on we will use the IP of this machine to have the communication between the main actors. @@ -1201,13 +1201,13 @@ You can connect to AltTester® Desktop in two ways in order to run the tests ser wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopLinuxBatchmode.zip unzip AltTesterDesktopLinuxBatchmode.zip cd AltTesterDesktopLinux - chmod +x ./"AltTester(R) Desktop.x86_64" - ./"AltTester(R) Desktop.x86_64" -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & + chmod +x ./AltTesterDesktop.x86_64 + ./AltTesterDesktop.x86_64 -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & ``` Kill the AltTester® Desktop process: ``` - kill -2 $(ps -ef | awk '/AltTester\(R\) Desktop.x86_64/{print $2}') + kill -2 `ps -ef | awk '/AltTesterDesktop.x86_64/{print $2}'` ``` #### **Preparation steps** @@ -1433,7 +1433,7 @@ We used [Azure](https://azure.microsoft.com/en-us/products/virtual-machines/) to - run command: ``` - "AltTester(R) Desktop.exe" -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt + AltTesterDesktop.exe -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt ``` We have now a VM where AltTester® Server is listening for connections. Further on we will use the IP of this machine to have the communication between the main actors. @@ -1643,7 +1643,7 @@ You can connect to AltTester® Desktop in two ways in order to run the tests ser - run command: ``` - "AltTester(R) Desktop.exe" -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt + AltTesterDesktop.exe -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt ``` We have now a VM where AltTester® Server is listening for connections. Further on we will use the IP of this machine to have the communication between the main actors. @@ -1661,13 +1661,13 @@ You can connect to AltTester® Desktop in two ways in order to run the tests ser wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopLinuxBatchmode.zip unzip AltTesterDesktopLinuxBatchmode.zip cd AltTesterDesktopLinux - chmod +x ./"AltTester(R) Desktop.x86_64" - ./"AltTester(R) Desktop.x86_64" -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & + chmod +x ./AltTesterDesktop.x86_64 + ./AltTesterDesktop.x86_64 -batchmode -port 13000 -license $LICENSE_KEY -nographics -termsAndConditionsAccepted & ``` Kill the AltTester® Desktop process: ``` - kill -2 $(ps -ef | awk '/AltTester\(R\) Desktop.x86_64/{print $2}') + kill -2 `ps -ef | awk '/AltTesterDesktop.x86_64/{print $2}'` ``` #### **Preparation steps** @@ -1880,7 +1880,7 @@ We used [Azure](https://azure.microsoft.com/en-us/products/virtual-machines/) to - run command: ``` - "AltTester(R) Desktop.exe" -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt + AltTesterDesktop.exe -batchmode -port 13000 -license -nographics -logfile LOGFILE.txt ``` We have now a VM where AltTester® Server is listening for connections. Further on we will use the IP of this machine to have the communication between the main actors.