Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-36833---release-0.11.x-customization #472

Open
wants to merge 2 commits into
base: release-0.11.x-customization
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions uitest-regclient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

# Reg-Client Automation - Mobile Automation Framework using Appium

## Overview
Reg-Client Automation is a mobile automation framework designed for Android platforms. It automates both positive and negative scenarios to ensure comprehensive testing of mobile applications.

## Installation
To set up Appium for use with this framework, please follow the installation instructions provided in the [Appium documentation](https://appium.io/docs/en/about-appium/intro/).

## Build
1. **Build the JAR file**:
```bash
mvn clean package -DskipTests=true
```
2. The generated JAR file (`uitest-regclient-0.0.1.jar`) will be located in the `target` directory.
3. **For running tests on a device**: Use the JAR file with dependencies (`uitest-regclient-0.0.1.jar`).

## Configurations

### General Configurations (for both JAR and IDE runs)
1. **Environment Settings**:
- Update `resources/Config/kernal.properties` to modify environment-specific settings.

2. **Test Data**:
- Update the following keys in `resources/testdata.json`:
- `uin`
- `language`
- `rid`

3. **General Configurations**:
- Update `resources/config.properties` with the following values:
- `nodePath`: Path to the Node.js executable.
- `appiumServerExecutable`: Path to the Appium server executable.

4. **Desired Capabilities**:
- Update `resources/DesiredCapabilies.json` with the following keys:
- `appium:udid`: Unique Device Identifier for the target device.
- `appium:app`: Path to the application APK.

## Execution

### Running Tests with JAR
1. **Run the JAR file**:
- Execute the `run_regclient.bat` batch file, which will trigger the test execution.

### Running Tests in IDE
1. **Run Configuration**:
- Set `regclient.utils.TestRunner` as the main class in your IDE run configuration.

2. **Resource File Locations**:
- `kernal.properties` and `testdata.json` are located under `src/main/resources` for IDE runs, as opposed to `resources` in the JAR run.

## Reports
- After test execution, test reports will be available in the `test-output/emailableReports` directory.
81 changes: 81 additions & 0 deletions uitest-regclient/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>io.mosip.regclient</groupId>
<artifactId>uitest-regclient</artifactId>
<name>uitest-regclient</name>
<version>0.0.1</version>
<description>Parent project of MOSIP regclient mobile automation</description>
<url>https://github.com/mosip/android-registration-client</url>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<mainClass>regclient.utils.TestRunner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer>
<mainClass>regclient.utils.TestRunner</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
204 changes: 156 additions & 48 deletions uitest-regclient/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.mosip.regclient</groupId>
<artifactId>uitest-regclient</artifactId>
Expand All @@ -8,56 +8,69 @@
<description>Parent project of MOSIP regclient mobile automation</description>
<url>https://github.com/mosip/android-registration-client</url>

<licenses>
<license>
<name>MPL 2.0</name>
<url>https://www.mozilla.org/en-US/MPL/2.0/</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/mosip/admin-ui.git</connection>
<developerConnection>scm:git:ssh://github.com:mosip/admin-ui.git</developerConnection>
<url>https://github.com/mosip/android-registration-client</url>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
<name>Mosip</name>
<email>[email protected]</email>
<organization>io.mosip</organization>
<organizationUrl>https://github.com/mosip/android-registration-client</organizationUrl>
</developer>
</developers>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<profiles>
<profile>
<id>selenium-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<mainClass>regclient.utils.TestRunner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>regclient.utils.TestRunner</mainClass>
</transformer>
</transformers>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.appium</groupId>
Expand All @@ -74,12 +87,107 @@
<artifactId>testng</artifactId>
<version>7.7.1</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>17.0.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.15.0.Final</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>5.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.29</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId>
<version>3.15.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.15.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client-microprofile</artifactId>
<version>3.15.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.15.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>3.15.0.Final</version>
</dependency>
</dependencies>
</project>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package BaseTest;
package regclient.BaseTest;

import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package BaseTest;
package regclient.BaseTest;


import io.appium.java_client.AppiumDriver;
import regclient.driver.DriverManager;
import regclient.utils.TestDataReader;

import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
Expand All @@ -13,9 +12,6 @@ public class BaseTest {

@BeforeSuite(alwaysRun = true)
public void beforeSuite() {
System.getProperties().setProperty("testng.outpur.dir", "test-output");
System.getProperties().setProperty("emailable.report2.name", "AndroidRegClient-"+TestDataReader.readData("env")
+"-run-" + System.currentTimeMillis() + "-report.html");
DriverManager.startAppiumServer();
}

Expand Down
Loading