Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
103 changes: 103 additions & 0 deletions .github/workflows/end_to_end_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: E2E Tests

on:
workflow_dispatch:
inputs:
branch:
description: 'The branch to run the workflow on'
required: true
default: 'main' # Default to 'main' branch

env:
java_version: "17"

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
api-level: [ 31 ]
profile: [ pixel_7_pro ]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Slack Post
uses: devtk0582/slack-post-action@v1.2
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MESSAGE: 🚀 Starting Stagenet Debug Build

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "${{ env.java_version }}"
distribution: corretto

- name: Build project (Stagenet)
run: chmod +x ./gradlew && ./gradlew app:assembleStagenetDebug --stacktrace

# Log APK Path and store it as an environment variable
- name: Log APK Path
id: log_apk
run: |
echo "Listing APK files..."
APK_PATH=$(find app/build/outputs/apk -type f -name "*.apk")
echo "APK_PATH=$APK_PATH"
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV

- name: Slack Post
uses: devtk0582/slack-post-action@v1.2
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MESSAGE: 📱 Test Started on device set :${{ matrix.profile }}

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
profile: ${{ matrix.profile }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Install Appium Dependencies
run: npm install -g appium # Install Appium globally

- name: Install uiautomator2
run: appium driver install uiautomator2 # Install Appium driver globally

- name: Start Appium
run: |
appium --log-level debug & # Start Appium in the background
sleep 10 # Wait for Appium to initialize

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
profile: ${{ matrix.profile }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: avdmanager list device && adb devices && adb -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps; settings delete global hidden_api_policy_p_apps; settings delete global hidden_api_policy' && sleep 10 && adb install "$APK_PATH" && cd cryptox-android-autotests && mvn clean install # Run tests
41 changes: 41 additions & 0 deletions cryptox-android-autotests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
target/
test-results/
logs/
setupData.properties
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/


### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
66 changes: 66 additions & 0 deletions cryptox-android-autotests/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?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>com.example</groupId>
<artifactId>cryptox1.0</artifactId>
<name>my-selenium-project</name>
<version>-tests</version>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<includes>
<include>testng.xml</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.testng.TestNG</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
</project>
Loading