Skip to content

Commit 153b529

Browse files
Test automation 1.0 (#270)
1 parent b81f8ae commit 153b529

Some content is hidden

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

49 files changed

+3922
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: E2E Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'The branch to run the workflow on'
8+
required: true
9+
default: 'main' # Default to 'main' branch
10+
11+
env:
12+
java_version: "17"
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
environment:
19+
name: Autotests
20+
url: https://concordium.testmo.net/automation/runs/2
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
api-level: [ 31 ]
26+
profile: [ pixel_7_pro ]
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Slack Post
33+
uses: devtk0582/slack-post-action@v1.2
34+
with:
35+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
36+
MESSAGE: 🚀 Starting Stagenet Debug Build
37+
38+
- name: Set up JDK
39+
uses: actions/setup-java@v4
40+
with:
41+
java-version: "${{ env.java_version }}"
42+
distribution: corretto
43+
44+
- name: Build project (Stagenet)
45+
run: chmod +x ./gradlew && ./gradlew app:assembleStagenetDebug --stacktrace
46+
47+
# Log APK Path and store it as an environment variable
48+
- name: Log APK Path
49+
id: log_apk
50+
run: |
51+
echo "Listing APK files..."
52+
APK_PATH=$(find app/build/outputs/apk -type f -name "*.apk")
53+
echo "APK_PATH=$APK_PATH"
54+
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV
55+
56+
- name: Slack Post
57+
uses: devtk0582/slack-post-action@v1.2
58+
with:
59+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
60+
MESSAGE: 📱 Test Started on device set :${{ matrix.profile }}
61+
62+
- name: Enable KVM
63+
run: |
64+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
65+
sudo udevadm control --reload-rules
66+
sudo udevadm trigger --name-match=kvm
67+
68+
- name: AVD cache
69+
uses: actions/cache@v4
70+
id: avd-cache
71+
with:
72+
path: |
73+
~/.android/avd/*
74+
~/.android/adb*
75+
key: avd-${{ matrix.api-level }}
76+
77+
- name: create AVD and generate snapshot for caching
78+
if: steps.avd-cache.outputs.cache-hit != 'true'
79+
uses: reactivecircus/android-emulator-runner@v2
80+
with:
81+
api-level: ${{ matrix.api-level }}
82+
arch: x86_64
83+
profile: ${{ matrix.profile }}
84+
force-avd-creation: false
85+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot
86+
disable-animations: false
87+
script: echo "Generated AVD snapshot for caching."
88+
89+
- name: Install Appium Dependencies
90+
run: npm install -g appium # Install Appium globally
91+
92+
- name: Install uiautomator2
93+
run: appium driver install uiautomator2 # Install Appium driver globally
94+
95+
- name: Start Appium
96+
run: |
97+
appium --log-level debug & # Start Appium in the background
98+
sleep 10 # Wait for Appium to initialize
99+
100+
- name: Run tests
101+
uses: reactivecircus/android-emulator-runner@v2
102+
with:
103+
api-level: ${{ matrix.api-level }}
104+
arch: x86_64
105+
profile: ${{ matrix.profile }}
106+
force-avd-creation: false
107+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
108+
disable-animations: true
109+
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
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
target/
2+
test-results/
3+
logs/
4+
setupData.properties
5+
!.mvn/wrapper/maven-wrapper.jar
6+
!**/src/main/**/target/
7+
!**/src/test/**/target/
8+
9+
10+
### IntelliJ IDEA ###
11+
.idea/modules.xml
12+
.idea/jarRepositories.xml
13+
.idea/compiler.xml
14+
.idea/libraries/
15+
*.iws
16+
*.iml
17+
*.ipr
18+
### Eclipse ###
19+
.apt_generated
20+
.classpath
21+
.factorypath
22+
.project
23+
.settings
24+
.springBeans
25+
.sts4-cache
26+
27+
### NetBeans ###
28+
/nbproject/private/
29+
/nbbuild/
30+
/dist/
31+
/nbdist/
32+
/.nb-gradle/
33+
build/
34+
!**/src/main/**/build/
35+
!**/src/test/**/build/
36+
37+
### VS Code ###
38+
.vscode/
39+
40+
### Mac OS ###
41+
.DS_Store
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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.example</groupId>
5+
<artifactId>cryptox1.0</artifactId>
6+
<name>my-selenium-project</name>
7+
<version>-tests</version>
8+
<url>http://maven.apache.org</url>
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<artifactId>maven-compiler-plugin</artifactId>
13+
<version>3.13.0</version>
14+
<configuration>
15+
<source>11</source>
16+
<target>11</target>
17+
</configuration>
18+
</plugin>
19+
<plugin>
20+
<artifactId>maven-shade-plugin</artifactId>
21+
<version>3.2.1</version>
22+
<executions>
23+
<execution>
24+
<phase>package</phase>
25+
<goals>
26+
<goal>shade</goal>
27+
</goals>
28+
<configuration>
29+
<filters>
30+
<filter>
31+
<artifact>*:*</artifact>
32+
<includes>
33+
<include>testng.xml</include>
34+
</includes>
35+
</filter>
36+
</filters>
37+
</configuration>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
<plugin>
42+
<artifactId>maven-jar-plugin</artifactId>
43+
<version>3.1.0</version>
44+
<configuration>
45+
<archive>
46+
<manifestEntries>
47+
<Main-Class>org.testng.TestNG</Main-Class>
48+
</manifestEntries>
49+
</archive>
50+
</configuration>
51+
</plugin>
52+
</plugins>
53+
</build>
54+
<dependencies>
55+
<dependency>
56+
<groupId>org.testng</groupId>
57+
<artifactId>testng</artifactId>
58+
<version>7.0.0</version>
59+
<scope>test</scope>
60+
</dependency>
61+
</dependencies>
62+
<properties>
63+
<maven.compiler.target>11</maven.compiler.target>
64+
<maven.compiler.source>11</maven.compiler.source>
65+
</properties>
66+
</project>

0 commit comments

Comments
 (0)