Skip to content

Commit

Permalink
Release - 1.4.1 #46
Browse files Browse the repository at this point in the history
dev - added android test orchestrator 
release note - updated build version to 1.4.1
release note - updated view id names
release note - fixed crash when push notification received with missing fields
release note - added view notification acceptance tests
  • Loading branch information
syedahmedjamil committed Feb 11, 2024
2 parents 04248de + a25664b commit 76340bb
Show file tree
Hide file tree
Showing 23 changed files with 453 additions and 86 deletions.
147 changes: 123 additions & 24 deletions .github/workflows/dev-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- 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: Setup JDK And Gradle
uses: ./.github/actions/setup-jdk-gradle
Expand All @@ -37,11 +31,21 @@ jobs:
- name: Run Unit Test
run: ./gradlew test

- name: Assemble Debug
run: ./gradlew assembleDebug

- name: Upload Debug Apk
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: app/build/outputs/apk/debug/*.apk

- name: Upload Unit Test Report
if: always()
uses: actions/upload-artifact@v3
with:
name: unit-test-report
path: build/reports/unitTests
path: build/reports/unitTests

integration-test:
needs: [unit-test]
Expand Down Expand Up @@ -70,13 +74,16 @@ jobs:
- name: Run Integration Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
api-level: 30
target: google_apis
arch: x86_64
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: ./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.cucumberUseAndroidJUnitRunner=true mergeAndroidReports
script: ./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.cucumberUseAndroidJUnitRunner=true mergeAndroidReports --continue

- name: Upload Integration Test Report
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-test-report
Expand Down Expand Up @@ -109,47 +116,139 @@ jobs:
- name: Run Acceptance Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
api-level: 30
target: google_apis
arch: x86_64
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: ./gradlew connectedAndroidTest mergeAndroidReports
script: ./gradlew connectedAndroidTest mergeAndroidReports --continue

- name: Upload Acceptance Test Report
if: always()
uses: actions/upload-artifact@v3
with:
name: acceptance-test-report
path: build/androidTest-results

assemble-debug:
needs: [unit-test, integration-test, acceptance-test]
appium-tests:
needs: [unit-test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: appium-tests

- name: Remove all apk in apps folder
run: rm -rf apps/*

- name: Display structure of downloaded files
run: ls -la apps

- name: Get Debug App That Was Uploaded In Unit-Test Stage
uses: actions/download-artifact@v4
with:
name: debug-apk
path: apps

- name: Copy And Rename APK
run: cp ./apps/[PusherNotif]* ./apps/PusherNotif.apk

- name: Display structure of downloaded files
run: ls -la apps

- 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: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true

- name: Grant Execute Permission For Gradlew
run: chmod +x gradlew
shell: bash

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup And Run Appium
run: |
npm install -g [email protected]
appium -v
appium driver install uiautomator2
appium &
- name: Grant Execute Permission For Fcm
run: chmod +x fcm
shell: bash

- name: check
run: |
echo ~
pwd
ls -la
shell: bash

- name: Run Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: google_apis
arch: x86_64
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: |
adb root
./gradlew test
- name: Upload Report
if: always()
uses: actions/upload-artifact@v3
with:
name: appium-test-report
path: build/reports

upload-debug-firebase-app-distribution:
needs: [unit-test, integration-test, acceptance-test, appium-tests]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK And Gradle
uses: ./.github/actions/setup-jdk-gradle
with:
cache-read-only: false

cache-read-only: false
- name: Get Google Services Json
env:
CERTIFICATE_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > app/google-services.json
- name: Assemble Debug Apk
run: ./gradlew assembleDebug

- name: Upload Debug Apk
uses: actions/upload-artifact@v3
with:
name: debug-apk
path: app/build/outputs/apk/debug/*.apk
- name: Get Firebase App Distribution Key
env:
CERTIFICATE_BASE64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_KEY }}
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > app/main-firebase-app-distribution-admin-key.json
- name: Assemble Debug
run: ./gradlew assembleDebug -PversionCode=${{ github.run_number }}

- name: Upload To Firebase App Distribution
run: ./gradlew appDistributionUploadDebug
4 changes: 2 additions & 2 deletions .github/workflows/main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
workflow_dispatch:

jobs:
upload:
runs-on: macos-latest
upload-signed-release-firebase-app-distribution:
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# About
Android client app that integrates with pusher beams to show realtime in-app notifications.
Android client app that integrates with pusher beams to show realtime push notifications.

Project contains:
- Code structured using `Clean Architecture`
- Acceptance tests written using `Cucumber` `Espresso`
- Code structured using `Clean Architecture` and `MVVM`
- Acceptance tests written using `Cucumber` `Espresso` `UiAutomator2` `Appium`
- Integreation and unit tests written using `JUnit`
- Continous Integration using `Github Actions`
- App Distribution using `Firebase App Distribution`
- Notifications stored locally using `DataStore`
- Dependecy Injection using `Hilt`
- Manual Dependecy Injection using custom `App Container`
- Testing using fakes and mocks using `Mockk`
Expand Down
14 changes: 13 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ android {
minSdk = 24
targetSdk = 33
versionCode = project.property("versionCode").toString().toInt()
versionName = "1.4.0"
versionName = "1.4.1"
testApplicationId = "com.github.syedahmedjamil.pushernotif.test"
// testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// testInstrumentationRunner = "io.cucumber.android.runner.CucumberAndroidJUnitRunner"
testInstrumentationRunner = "com.github.syedahmedjamil.pushernotif.test.CustomRunner"
testInstrumentationRunnerArguments["clearPackageData"] = "true"
//apk file name
setProperty("archivesBaseName", "${rootProject.name}-${versionName}-${versionCode}")
}
Expand All @@ -51,6 +52,13 @@ android {
isDebuggable = true
applicationIdSuffix = ".${suffix}"
versionNameSuffix = "-${suffix}"

firebaseAppDistribution {
serviceCredentialsFile = keystoreProperties["serviceCredentialsFile"] as String
artifactType = "APK"
releaseNotesFile = keystoreProperties["releaseNotesFile"] as String
testersFile = keystoreProperties["testersFile"] as String
}
}
release {
val suffix = "release"
Expand Down Expand Up @@ -99,6 +107,7 @@ android {
useLegacyPackaging = true
}
}
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}

kapt {
Expand Down Expand Up @@ -164,6 +173,9 @@ android {
androidTestImplementation("io.cucumber:cucumber-android-hilt:7.14.0")
androidTestImplementation("io.mockk:mockk-android:1.13.9")
androidTestImplementation("androidx.fragment:fragment-testing:1.6.2") // for DataBindingIdlingResource
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestUtil("androidx.test:orchestrator:1.4.2")
}

}
13 changes: 13 additions & 0 deletions app/src/androidTest/assets/features/view_notifications.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: View Notification
User can view notification for the subscribed interest

Background:
Given I am subscribed to instance

Scenario: User views notification from notification screen
When I receive push notification
Then I should see notification in the list

Scenario: User views notification from status bar
When I receive push notification
Then I should see notification in status bar
Loading

0 comments on commit 76340bb

Please sign in to comment.