From 2b1e1df10a6c176f108f4ae9d314572bc74ec611 Mon Sep 17 00:00:00 2001 From: Akhil Appini Date: Thu, 19 Feb 2026 12:48:00 +0530 Subject: [PATCH] Migrated the addon to EU Region --- convert_date_format/pom.xml | 102 ++++++++++++++++++ .../addons/android/DateFormatConversion.java | 74 +++++++++++++ .../addons/ios/DateFormatConversion.java | 71 ++++++++++++ .../mobileweb/DateFormatConversion.java | 74 +++++++++++++ .../addons/restapi/DateFormatConversion.java | 71 ++++++++++++ .../addons/web/DateFormatConversion.java | 73 +++++++++++++ .../addons/windows/DateFormatConversion.java | 71 ++++++++++++ .../main/resources/testsigma-sdk.properties | 1 + 8 files changed, 537 insertions(+) create mode 100644 convert_date_format/pom.xml create mode 100644 convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java create mode 100644 convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java create mode 100644 convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java create mode 100644 convert_date_format/src/main/java/com/testsigma/addons/restapi/DateFormatConversion.java create mode 100644 convert_date_format/src/main/java/com/testsigma/addons/web/DateFormatConversion.java create mode 100644 convert_date_format/src/main/java/com/testsigma/addons/windows/DateFormatConversion.java create mode 100644 convert_date_format/src/main/resources/testsigma-sdk.properties diff --git a/convert_date_format/pom.xml b/convert_date_format/pom.xml new file mode 100644 index 00000000..8c5574de --- /dev/null +++ b/convert_date_format/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + com.testsigma.addons + convert_date_format + 1.0.0 + jar + + + UTF-8 + 11 + 11 + 1.2.24_cloud + 5.8.0-M1 + 1.0.0 + 3.2.1 + 1.18.30 + + + + + + com.testsigma + testsigma-java-sdk + ${testsigma.sdk.version} + + + org.projectlombok + lombok + ${lombok.version} + true + + + org.junit.jupiter + junit-jupiter-api + ${junit.jupiter.version} + test + + + org.testng + testng + 6.14.3 + + + + org.seleniumhq.selenium + selenium-java + 4.33.0 + + + + io.appium + java-client + 9.4.0 + + + com.fasterxml.jackson.core + jackson-annotations + 2.13.0 + + + org.apache.commons + commons-lang3 + 3.14.0 + + + + + convert_date_format + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven.source.plugin.version} + + + attach-sources + + jar + + + + + + + diff --git a/convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java b/convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java new file mode 100644 index 00000000..56c61004 --- /dev/null +++ b/convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java @@ -0,0 +1,74 @@ +package com.testsigma.addons.android; + +import com.testsigma.sdk.AndroidAction; +import com.testsigma.sdk.ApplicationType; +import com.testsigma.sdk.Result; +import com.testsigma.sdk.WebAction; +import com.testsigma.sdk.annotation.Action; +import com.testsigma.sdk.annotation.RunTimeData; +import com.testsigma.sdk.annotation.TestData; +import lombok.Data; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.openqa.selenium.NoSuchElementException; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", + description = "To store the number of char from testdata into runtime variable", + applicationType = ApplicationType.ANDROID) + +public class DateFormatConversion extends AndroidAction +{ + + @TestData(reference = "testdata") + private com.testsigma.sdk.TestData testData1; + + @TestData(reference = "format1") + private com.testsigma.sdk.TestData testData2; + + @TestData(reference = "format2") + private com.testsigma.sdk.TestData testData3; + + @TestData(reference = "variable") + private com.testsigma.sdk.TestData runtimeVar; + + @RunTimeData + private com.testsigma.sdk.RunTimeData runTimeData; + + @Override + public Result execute() throws NoSuchElementException + { + //Your Awesome code starts here + logger.info("Initiating execution"); + Result result = Result.SUCCESS; + + try { + SimpleDateFormat inputFormat = new SimpleDateFormat(testData2.getValue().toString()); + SimpleDateFormat outputFormat = new SimpleDateFormat(testData3.getValue().toString()); + logger.info("testdata = " + testData1.getValue().toString()); + logger.info("format1 = " + testData2.getValue().toString()); + logger.info("format2 = " + testData3.getValue().toString()); + logger.info("variable = " + runtimeVar.getValue().toString()); + + String inputDateString = testData1.getValue().toString(); + Date parsedDate = inputFormat.parse(inputDateString); + + String outputDateString = outputFormat.format(parsedDate); + logger.info("outputDateString = " + outputDateString); + + runTimeData.setKey(runtimeVar.getValue().toString()); + runTimeData.setValue(outputDateString); + + logger.info("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + setSuccessMessage("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + } catch(Exception e) { + logger.warn("Operation failed , the error message is ::::"+ ExceptionUtils.getStackTrace(e)); + setErrorMessage("Operation failed , the error message is ::::"+ ExceptionUtils.getMessage(e)); + result = Result.FAILED; + } + return result; + } +} + diff --git a/convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java b/convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java new file mode 100644 index 00000000..11e087fa --- /dev/null +++ b/convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java @@ -0,0 +1,71 @@ +package com.testsigma.addons.ios; + +import com.testsigma.sdk.*; +import com.testsigma.sdk.annotation.Action; +import com.testsigma.sdk.annotation.RunTimeData; +import com.testsigma.sdk.annotation.TestData; +import lombok.Data; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.devtools.v135.io.IO; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", + description = "To store the number of char from testdata into runtime variable", + applicationType = ApplicationType.IOS) + +public class DateFormatConversion extends IOSAction { + + @TestData(reference = "testdata") + private com.testsigma.sdk.TestData testData1; + + @TestData(reference = "format1") + private com.testsigma.sdk.TestData testData2; + + @TestData(reference = "format2") + private com.testsigma.sdk.TestData testData3; + + @TestData(reference = "variable") + private com.testsigma.sdk.TestData runtimeVar; + + @RunTimeData + private com.testsigma.sdk.RunTimeData runTimeData; + + @Override + public Result execute() throws NoSuchElementException + { + //Your Awesome code starts here + logger.info("Initiating execution"); + Result result = Result.SUCCESS; + + try { + SimpleDateFormat inputFormat = new SimpleDateFormat(testData2.getValue().toString()); + SimpleDateFormat outputFormat = new SimpleDateFormat(testData3.getValue().toString()); + logger.info("testdata = " + testData1.getValue().toString()); + logger.info("format1 = " + testData2.getValue().toString()); + logger.info("format2 = " + testData3.getValue().toString()); + logger.info("variable = " + runtimeVar.getValue().toString()); + + String inputDateString = testData1.getValue().toString(); + Date parsedDate = inputFormat.parse(inputDateString); + + String outputDateString = outputFormat.format(parsedDate); + logger.info("outputDateString = " + outputDateString); + + runTimeData.setKey(runtimeVar.getValue().toString()); + runTimeData.setValue(outputDateString); + + logger.info("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + setSuccessMessage("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + } catch(Exception e) { + logger.warn("Operation failed , the error message is ::::"+ ExceptionUtils.getStackTrace(e)); + setErrorMessage("Operation failed , the error message is ::::"+ ExceptionUtils.getMessage(e)); + result = Result.FAILED; + } + return result; + } +} + diff --git a/convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java b/convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java new file mode 100644 index 00000000..0d6fd41e --- /dev/null +++ b/convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java @@ -0,0 +1,74 @@ +package com.testsigma.addons.mobileweb; + +import com.testsigma.sdk.AndroidAction; +import com.testsigma.sdk.ApplicationType; +import com.testsigma.sdk.Result; +import com.testsigma.sdk.WebAction; +import com.testsigma.sdk.annotation.Action; +import com.testsigma.sdk.annotation.RunTimeData; +import com.testsigma.sdk.annotation.TestData; +import lombok.Data; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.openqa.selenium.NoSuchElementException; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", + description = "To store the number of char from testdata into runtime variable", + applicationType = ApplicationType.MOBILE_WEB) + +public class DateFormatConversion extends WebAction +{ + + @TestData(reference = "testdata") + private com.testsigma.sdk.TestData testData1; + + @TestData(reference = "format1") + private com.testsigma.sdk.TestData testData2; + + @TestData(reference = "format2") + private com.testsigma.sdk.TestData testData3; + + @TestData(reference = "variable") + private com.testsigma.sdk.TestData runtimeVar; + + @RunTimeData + private com.testsigma.sdk.RunTimeData runTimeData; + + @Override + public Result execute() throws NoSuchElementException + { + //Your Awesome code starts here + logger.info("Initiating execution"); + Result result = Result.SUCCESS; + + try { + SimpleDateFormat inputFormat = new SimpleDateFormat(testData2.getValue().toString()); + SimpleDateFormat outputFormat = new SimpleDateFormat(testData3.getValue().toString()); + logger.info("testdata = " + testData1.getValue().toString()); + logger.info("format1 = " + testData2.getValue().toString()); + logger.info("format2 = " + testData3.getValue().toString()); + logger.info("variable = " + runtimeVar.getValue().toString()); + + String inputDateString = testData1.getValue().toString(); + Date parsedDate = inputFormat.parse(inputDateString); + + String outputDateString = outputFormat.format(parsedDate); + logger.info("outputDateString = " + outputDateString); + + runTimeData.setKey(runtimeVar.getValue().toString()); + runTimeData.setValue(outputDateString); + + logger.info("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + setSuccessMessage("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + } catch(Exception e) { + logger.warn("Operation failed , the error message is ::::"+ ExceptionUtils.getStackTrace(e)); + setErrorMessage("Operation failed , the error message is ::::"+ ExceptionUtils.getMessage(e)); + result = Result.FAILED; + } + return result; + } +} + diff --git a/convert_date_format/src/main/java/com/testsigma/addons/restapi/DateFormatConversion.java b/convert_date_format/src/main/java/com/testsigma/addons/restapi/DateFormatConversion.java new file mode 100644 index 00000000..19d8dbdd --- /dev/null +++ b/convert_date_format/src/main/java/com/testsigma/addons/restapi/DateFormatConversion.java @@ -0,0 +1,71 @@ +package com.testsigma.addons.restapi; + +import com.testsigma.sdk.*; +import com.testsigma.sdk.annotation.Action; +import com.testsigma.sdk.annotation.RunTimeData; +import com.testsigma.sdk.annotation.TestData; +import lombok.Data; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.openqa.selenium.NoSuchElementException; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", + description = "To store the number of char from testdata into runtime variable", + applicationType = ApplicationType.REST_API) + +public class DateFormatConversion extends RestApiAction +{ + + @TestData(reference = "testdata") + private com.testsigma.sdk.TestData testData1; + + @TestData(reference = "format1") + private com.testsigma.sdk.TestData testData2; + + @TestData(reference = "format2") + private com.testsigma.sdk.TestData testData3; + + @TestData(reference = "variable") + private com.testsigma.sdk.TestData runtimeVar; + + @RunTimeData + private com.testsigma.sdk.RunTimeData runTimeData; + + @Override + public Result execute() throws NoSuchElementException + { + //Your Awesome code starts here + logger.info("Initiating execution"); + Result result = Result.SUCCESS; + + try { + SimpleDateFormat inputFormat = new SimpleDateFormat(testData2.getValue().toString()); + SimpleDateFormat outputFormat = new SimpleDateFormat(testData3.getValue().toString()); + logger.info("testdata = " + testData1.getValue().toString()); + logger.info("format1 = " + testData2.getValue().toString()); + logger.info("format2 = " + testData3.getValue().toString()); + logger.info("variable = " + runtimeVar.getValue().toString()); + + String inputDateString = testData1.getValue().toString(); + Date parsedDate = inputFormat.parse(inputDateString); + + String outputDateString = outputFormat.format(parsedDate); + logger.info("outputDateString = " + outputDateString); + + runTimeData.setKey(runtimeVar.getValue().toString()); + runTimeData.setValue(outputDateString); + + logger.info("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + setSuccessMessage("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + } catch(Exception e) { + logger.warn("Operation failed , the error message is ::::"+ ExceptionUtils.getStackTrace(e)); + setErrorMessage("Operation failed , the error message is ::::"+ ExceptionUtils.getMessage(e)); + result = Result.FAILED; + } + return result; + } +} + diff --git a/convert_date_format/src/main/java/com/testsigma/addons/web/DateFormatConversion.java b/convert_date_format/src/main/java/com/testsigma/addons/web/DateFormatConversion.java new file mode 100644 index 00000000..3146fc36 --- /dev/null +++ b/convert_date_format/src/main/java/com/testsigma/addons/web/DateFormatConversion.java @@ -0,0 +1,73 @@ +package com.testsigma.addons.web; + +import com.testsigma.sdk.ApplicationType; +import com.testsigma.sdk.Result; +import com.testsigma.sdk.WebAction; +import com.testsigma.sdk.annotation.Action; +import com.testsigma.sdk.annotation.RunTimeData; +import com.testsigma.sdk.annotation.TestData; +import lombok.Data; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.openqa.selenium.NoSuchElementException; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", + description = "To store the number of char from testdata into runtime variable", + applicationType = ApplicationType.WEB) + +public class DateFormatConversion extends WebAction +{ + + @TestData(reference = "testdata") + private com.testsigma.sdk.TestData testData1; + + @TestData(reference = "format1") + private com.testsigma.sdk.TestData testData2; + + @TestData(reference = "format2") + private com.testsigma.sdk.TestData testData3; + + @TestData(reference = "variable") + private com.testsigma.sdk.TestData runtimeVar; + + @RunTimeData + private com.testsigma.sdk.RunTimeData runTimeData; + + @Override + public Result execute() throws NoSuchElementException + { + //Your Awesome code starts here + logger.info("Initiating execution"); + Result result = Result.SUCCESS; + + try { + SimpleDateFormat inputFormat = new SimpleDateFormat(testData2.getValue().toString()); + SimpleDateFormat outputFormat = new SimpleDateFormat(testData3.getValue().toString()); + logger.info("testdata = " + testData1.getValue().toString()); + logger.info("format1 = " + testData2.getValue().toString()); + logger.info("format2 = " + testData3.getValue().toString()); + logger.info("variable = " + runtimeVar.getValue().toString()); + + String inputDateString = testData1.getValue().toString(); + Date parsedDate = inputFormat.parse(inputDateString); + + String outputDateString = outputFormat.format(parsedDate); + logger.info("outputDateString = " + outputDateString); + + runTimeData.setKey(runtimeVar.getValue().toString()); + runTimeData.setValue(outputDateString); + + logger.info("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + setSuccessMessage("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + } catch(Exception e) { + logger.warn("Operation failed , the error message is ::::"+ ExceptionUtils.getStackTrace(e)); + setErrorMessage("Operation failed , the error message is ::::"+ ExceptionUtils.getMessage(e)); + result = Result.FAILED; + } + return result; + } +} + diff --git a/convert_date_format/src/main/java/com/testsigma/addons/windows/DateFormatConversion.java b/convert_date_format/src/main/java/com/testsigma/addons/windows/DateFormatConversion.java new file mode 100644 index 00000000..8fc30d08 --- /dev/null +++ b/convert_date_format/src/main/java/com/testsigma/addons/windows/DateFormatConversion.java @@ -0,0 +1,71 @@ +package com.testsigma.addons.windows; + +import com.testsigma.sdk.*; +import com.testsigma.sdk.annotation.Action; +import com.testsigma.sdk.annotation.RunTimeData; +import com.testsigma.sdk.annotation.TestData; +import lombok.Data; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.openqa.selenium.NoSuchElementException; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", + description = "To store the number of char from testdata into runtime variable", + applicationType = ApplicationType.WINDOWS) + +public class DateFormatConversion extends WindowsAction +{ + + @TestData(reference = "testdata") + private com.testsigma.sdk.TestData testData1; + + @TestData(reference = "format1") + private com.testsigma.sdk.TestData testData2; + + @TestData(reference = "format2") + private com.testsigma.sdk.TestData testData3; + + @TestData(reference = "variable") + private com.testsigma.sdk.TestData runtimeVar; + + @RunTimeData + private com.testsigma.sdk.RunTimeData runTimeData; + + @Override + public Result execute() throws NoSuchElementException + { + //Your Awesome code starts here + logger.info("Initiating execution"); + Result result = Result.SUCCESS; + + try { + SimpleDateFormat inputFormat = new SimpleDateFormat(testData2.getValue().toString()); + SimpleDateFormat outputFormat = new SimpleDateFormat(testData3.getValue().toString()); + logger.info("testdata = " + testData1.getValue().toString()); + logger.info("format1 = " + testData2.getValue().toString()); + logger.info("format2 = " + testData3.getValue().toString()); + logger.info("variable = " + runtimeVar.getValue().toString()); + + String inputDateString = testData1.getValue().toString(); + Date parsedDate = inputFormat.parse(inputDateString); + + String outputDateString = outputFormat.format(parsedDate); + logger.info("outputDateString = " + outputDateString); + + runTimeData.setKey(runtimeVar.getValue().toString()); + runTimeData.setValue(outputDateString); + + logger.info("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + setSuccessMessage("Successfully converted date from " + testData2.getValue().toString() + " to " + testData3.getValue().toString() + " and stored in runtime variable = " +outputDateString); + } catch(Exception e) { + logger.warn("Operation failed , the error message is ::::"+ ExceptionUtils.getStackTrace(e)); + setErrorMessage("Operation failed , the error message is ::::"+ ExceptionUtils.getMessage(e)); + result = Result.FAILED; + } + return result; + } +} + diff --git a/convert_date_format/src/main/resources/testsigma-sdk.properties b/convert_date_format/src/main/resources/testsigma-sdk.properties new file mode 100644 index 00000000..5af358aa --- /dev/null +++ b/convert_date_format/src/main/resources/testsigma-sdk.properties @@ -0,0 +1 @@ +testsigma-sdk.api.key=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyNTgxZDNlYy02Zjk2LTg3NDktZThmNS1hYjEwMWIwZDA1NTQiLCJ1bmlxdWVJZCI6IjM0NzUiLCJpZGVudGl0eUFjY291bnRVVUlkIjoiODZlMGQ1ODUtZTVlYi05NmIxLTAyZDktOTRkODM3N2RiMzlmIn0._yGbSllZqQTBvmNoMYpRuCsd4Z_9565FWjGtrNAmZzQP1i8WSpndSNDbUrzo8Iv6FxIAyvH_c5inCIIHuWX0ow \ No newline at end of file