Skip to content

Commit da7cc5a

Browse files
Merge branch 'dev' into CUS-11641
2 parents bb85b87 + 21e0da1 commit da7cc5a

75 files changed

Lines changed: 3464 additions & 120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

0 Bytes
Binary file not shown.
6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.testsigma.addons</groupId>
5+
<artifactId>authenticator_code_generator_</artifactId>
6+
<version>1.0.0</version>
7+
<build>
8+
<finalName>authenticator_code_generator_</finalName>
9+
<plugins>
10+
<plugin>
11+
<artifactId>maven-shade-plugin</artifactId>
12+
<version>${maven.shade.plugin.version}</version>
13+
<executions>
14+
<execution>
15+
<phase>package</phase>
16+
<goals>
17+
<goal>shade</goal>
18+
</goals>
19+
</execution>
20+
</executions>
21+
</plugin>
22+
<plugin>
23+
<artifactId>maven-source-plugin</artifactId>
24+
<version>${maven.source.plugin.version}</version>
25+
<executions>
26+
<execution>
27+
<id>attach-sources</id>
28+
<goals>
29+
<goal>jar</goal>
30+
</goals>
31+
</execution>
32+
</executions>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
<dependencies>
37+
<dependency>
38+
<groupId>org.junit.jupiter</groupId>
39+
<artifactId>junit-jupiter-api</artifactId>
40+
<version>5.12.1</version>
41+
<scope>test</scope>
42+
<exclusions>
43+
<exclusion>
44+
<artifactId>opentest4j</artifactId>
45+
<groupId>org.opentest4j</groupId>
46+
</exclusion>
47+
<exclusion>
48+
<artifactId>junit-platform-commons</artifactId>
49+
<groupId>org.junit.platform</groupId>
50+
</exclusion>
51+
<exclusion>
52+
<artifactId>apiguardian-api</artifactId>
53+
<groupId>org.apiguardian</groupId>
54+
</exclusion>
55+
</exclusions>
56+
</dependency>
57+
</dependencies>
58+
<properties>
59+
<testsigma.sdk.version>1.2.26_cloud</testsigma.sdk.version>
60+
<maven.source.plugin.version>3.2.1</maven.source.plugin.version>
61+
<maven.compiler.source>11</maven.compiler.source>
62+
<junit.jupiter.version>5.12.1</junit.jupiter.version>
63+
<jackson.version>2.13.0</jackson.version>
64+
<maven.shade.plugin.version>3.2.4</maven.shade.plugin.version>
65+
<lombok.version>1.18.30</lombok.version>
66+
<maven.compiler.target>11</maven.compiler.target>
67+
<selenium.version>4.33.0</selenium.version>
68+
<testng.version>7.10.2</testng.version>
69+
<appium.java.client.version>9.4.0</appium.java.client.version>
70+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
71+
<testsigma.addon.maven.plugin>1.0.0</testsigma.addon.maven.plugin>
72+
</properties>
73+
</project>
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
<modelVersion>4.0.0</modelVersion>
7+
<groupId>com.testsigma.addons</groupId>
8+
<artifactId>authenticator_code_generator_</artifactId>
9+
<version>1.0.0</version>
10+
<packaging>jar</packaging>
11+
12+
<properties>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<maven.compiler.source>11</maven.compiler.source>
15+
<maven.compiler.target>11</maven.compiler.target>
16+
<testsigma.sdk.version>1.2.26_cloud</testsigma.sdk.version>
17+
<junit.jupiter.version>5.12.1</junit.jupiter.version>
18+
<testsigma.addon.maven.plugin>1.0.0</testsigma.addon.maven.plugin>
19+
<maven.source.plugin.version>3.2.1</maven.source.plugin.version>
20+
<lombok.version>1.18.30</lombok.version>
21+
<testng.version>7.10.2</testng.version>
22+
<selenium.version>4.33.0</selenium.version>
23+
<appium.java.client.version>9.4.0</appium.java.client.version>
24+
<jackson.version>2.13.0</jackson.version>
25+
<maven.shade.plugin.version>3.2.4</maven.shade.plugin.version>
26+
27+
</properties>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>com.testsigma</groupId>
32+
<artifactId>testsigma-java-sdk</artifactId>
33+
<version>${testsigma.sdk.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.projectlombok</groupId>
37+
<artifactId>lombok</artifactId>
38+
<version>${lombok.version}</version>
39+
<optional>true</optional>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.junit.jupiter</groupId>
43+
<artifactId>junit-jupiter-api</artifactId>
44+
<version>${junit.jupiter.version}</version>
45+
<scope>test</scope>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.testng</groupId>
49+
<artifactId>testng</artifactId>
50+
<version>${testng.version}</version>
51+
</dependency>
52+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
53+
<dependency>
54+
<groupId>org.seleniumhq.selenium</groupId>
55+
<artifactId>selenium-java</artifactId>
56+
<version>${selenium.version}</version>
57+
</dependency>
58+
<!-- https://mvnrepository.com/artifact/io.appium/java-client -->
59+
<dependency>
60+
<groupId>io.appium</groupId>
61+
<artifactId>java-client</artifactId>
62+
<version>${appium.java.client.version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>com.fasterxml.jackson.core</groupId>
66+
<artifactId>jackson-annotations</artifactId>
67+
<version>${jackson.version}</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.jboss.aerogear</groupId>
71+
<artifactId>aerogear-otp-java</artifactId>
72+
<version>1.0.0</version>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.apache.commons</groupId>
76+
<artifactId>commons-lang3</artifactId>
77+
<version>3.17.0</version>
78+
</dependency>
79+
80+
</dependencies>
81+
<build>
82+
<finalName>authenticator_code_generator_</finalName>
83+
<plugins>
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-shade-plugin</artifactId>
87+
<version>${maven.shade.plugin.version}</version>
88+
<executions>
89+
<execution>
90+
<phase>package</phase>
91+
<goals>
92+
<goal>shade</goal>
93+
</goals>
94+
</execution>
95+
</executions>
96+
</plugin>
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-source-plugin</artifactId>
100+
<version>${maven.source.plugin.version}</version>
101+
<executions>
102+
<execution>
103+
<id>attach-sources</id>
104+
<goals>
105+
<goal>jar</goal>
106+
</goals>
107+
</execution>
108+
</executions>
109+
</plugin>
110+
</plugins>
111+
</build>
112+
</project>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.testsigma.addons.android;
2+
3+
import com.testsigma.sdk.ApplicationType;
4+
import com.testsigma.sdk.annotation.Action;
5+
import com.testsigma.sdk.annotation.RunTimeData;
6+
import com.testsigma.sdk.annotation.TestData;
7+
import lombok.Data;
8+
import org.apache.commons.lang3.exception.ExceptionUtils;
9+
import org.jboss.aerogear.security.otp.Totp;
10+
import org.openqa.selenium.NoSuchElementException;
11+
12+
@Data
13+
@Action(actionText = "Generate TOTP using secretkey and store it into a runtime variable testdata",
14+
description = "Generates time based OTP using google authenticator",
15+
applicationType = ApplicationType.ANDROID)
16+
public class AuthCodeGenerator extends com.testsigma.addons.web.AuthCodeGenerator {
17+
18+
@TestData(reference = "secretkey")
19+
private com.testsigma.sdk.TestData secret;
20+
@TestData(reference = "testdata", isRuntimeVariable = true)
21+
private com.testsigma.sdk.TestData testData;
22+
23+
@RunTimeData
24+
private com.testsigma.sdk.RunTimeData runTimeData;
25+
26+
@Override
27+
public com.testsigma.sdk.Result execute() throws NoSuchElementException {
28+
logger.info("Initiating execution");
29+
30+
31+
com.testsigma.sdk.Result result = com.testsigma.sdk.Result.SUCCESS;
32+
try {
33+
Totp otpgenerator = new Totp(secret.getValue().toString());
34+
35+
logger.debug(otpgenerator.toString());
36+
String newotp = otpgenerator.now();
37+
runTimeData.setKey(testData.getValue().toString());
38+
runTimeData.setValue(newotp.toString());
39+
logger.info(runTimeData.getKey().toString() + " " + runTimeData.getValue().toString());
40+
setSuccessMessage("The TOTP is " + newotp + " " + "and has been assigned to runtime variable "
41+
+ testData.getValue().toString());
42+
43+
} catch (Exception error) {
44+
logger.info("stack trace : " + ExceptionUtils.getStackTrace(error));
45+
logger.debug(error.getMessage() + error.getCause());
46+
setErrorMessage("Operation Failed.Please check the logs for more infor");
47+
48+
49+
}
50+
return result;
51+
}
52+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.testsigma.addons.ios;
2+
3+
import com.testsigma.sdk.ApplicationType;
4+
import com.testsigma.sdk.annotation.Action;
5+
import com.testsigma.sdk.annotation.RunTimeData;
6+
import com.testsigma.sdk.annotation.TestData;
7+
import lombok.Data;
8+
import org.apache.commons.lang3.exception.ExceptionUtils;
9+
import org.jboss.aerogear.security.otp.Totp;
10+
import org.openqa.selenium.NoSuchElementException;
11+
12+
@Data
13+
@Action(actionText = "Generate TOTP using secretkey and store it into a runtime variable testdata",
14+
description = "Generates time based OTP using google authenticator",
15+
applicationType = ApplicationType.IOS)
16+
public class AuthCodeGenerator extends com.testsigma.addons.web.AuthCodeGenerator {
17+
18+
@TestData(reference = "secretkey")
19+
private com.testsigma.sdk.TestData secret;
20+
@TestData(reference = "testdata", isRuntimeVariable = true)
21+
private com.testsigma.sdk.TestData testData;
22+
23+
@RunTimeData
24+
private com.testsigma.sdk.RunTimeData runTimeData;
25+
26+
@Override
27+
public com.testsigma.sdk.Result execute() throws NoSuchElementException {
28+
logger.info("Initiating execution");
29+
30+
31+
com.testsigma.sdk.Result result = com.testsigma.sdk.Result.SUCCESS;
32+
try {
33+
Totp otpgenerator = new Totp(secret.getValue().toString());
34+
35+
logger.debug(otpgenerator.toString());
36+
String newotp = otpgenerator.now();
37+
runTimeData.setKey(testData.getValue().toString());
38+
runTimeData.setValue(newotp.toString());
39+
logger.info(runTimeData.getKey().toString() + " " + runTimeData.getValue().toString());
40+
setSuccessMessage("The TOTP is " + newotp + " " + "and has been assigned to runtime variable "
41+
+ testData.getValue().toString());
42+
43+
} catch (Exception error) {
44+
45+
logger.info("stack trace : " + ExceptionUtils.getStackTrace(error));
46+
logger.debug(error.getMessage() + error.getCause());
47+
setErrorMessage("Operation Failed.Please check the logs for more infor");
48+
49+
50+
}
51+
return result;
52+
}
53+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.testsigma.addons.mobileweb;
2+
3+
import com.testsigma.sdk.ApplicationType;
4+
import com.testsigma.sdk.annotation.Action;
5+
import com.testsigma.sdk.annotation.RunTimeData;
6+
import com.testsigma.sdk.annotation.TestData;
7+
import lombok.Data;
8+
import org.apache.commons.lang3.exception.ExceptionUtils;
9+
import org.jboss.aerogear.security.otp.Totp;
10+
import org.openqa.selenium.NoSuchElementException;
11+
12+
@Data
13+
@Action(actionText = "Generate TOTP using secretkey and store it into a runtime variable testdata",
14+
description = "Generates time based OTP using google authenticator",
15+
applicationType = ApplicationType.MOBILE_WEB)
16+
public class AuthCodeGenerator extends com.testsigma.addons.web.AuthCodeGenerator {
17+
18+
@TestData(reference = "secretkey")
19+
private com.testsigma.sdk.TestData secret;
20+
@TestData(reference = "testdata", isRuntimeVariable = true)
21+
private com.testsigma.sdk.TestData testData;
22+
23+
@RunTimeData
24+
private com.testsigma.sdk.RunTimeData runTimeData;
25+
26+
@Override
27+
public com.testsigma.sdk.Result execute() throws NoSuchElementException {
28+
logger.info("Initiating execution");
29+
30+
31+
com.testsigma.sdk.Result result = com.testsigma.sdk.Result.SUCCESS;
32+
try {
33+
Totp otpgenerator = new Totp(secret.getValue().toString());
34+
35+
logger.debug(otpgenerator.toString());
36+
String newotp = otpgenerator.now();
37+
runTimeData.setKey(testData.getValue().toString());
38+
runTimeData.setValue(newotp.toString());
39+
logger.info(runTimeData.getKey().toString() + " " + runTimeData.getValue().toString());
40+
setSuccessMessage("The TOTP is " + newotp + " " + "and has been assigned to runtime variable "
41+
+ testData.getValue().toString());
42+
43+
} catch (Exception error) {
44+
45+
logger.info("stack trace : " + ExceptionUtils.getStackTrace(error));
46+
logger.debug(error.getMessage() + error.getCause());
47+
setErrorMessage("Operation Failed.Please check the logs for more infor");
48+
49+
50+
}
51+
return result;
52+
}
53+
}

0 commit comments

Comments
 (0)