-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's a pre task for Strict violations oberservations
- Loading branch information
Showing
3 changed files
with
109 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,24 @@ on: | |
pull_request: | ||
branches: | ||
- master | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
jobs: | ||
env-job: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }} | ||
name: Modify branch name | ||
steps: | ||
- name: Sets MODIFIED_BRANCH_NAME | ||
id: env | ||
env: | ||
name: "${{env.BRANCH_NAME}}" | ||
run: | | ||
echo "MODIFIED_BRANCH_NAME=${name//\//-}" >> ${GITHUB_OUTPUT} | ||
cat ${GITHUB_OUTPUT} | ||
buildTest: | ||
name: Build & Run Unit-Tests | ||
runs-on: ubuntu-latest | ||
|
@@ -27,13 +43,15 @@ jobs: | |
run: ./gradlew assembleDebug | ||
- name: Run tests | ||
run: ./gradlew test | ||
# - name: Jacoco | ||
# run: ./gradlew :tracker:jacocoTestReport | ||
# - name: Codecov | ||
# run: bash <(curl -s https://codecov.io/bash) | ||
# - name: Jacoco | ||
# run: ./gradlew :tracker:jacocoTestReport | ||
# - name: Codecov | ||
# run: bash <(curl -s https://codecov.io/bash) | ||
Check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
needs: | ||
- env-job | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -50,5 +68,41 @@ jobs: | |
uses: actions/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
name: Matomo-Lint-report | ||
name: Matomo-Lint-${{ needs.env-job.outputs.modified-branch-name }} | ||
path: tracker/build/reports/lint-results.html | ||
|
||
EspressoTest: | ||
runs-on: macOS-latest | ||
needs: | ||
- env-job | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- name: show envs | ||
run: | | ||
echo ${{ needs.env-job.outputs.modified-branch-name }} | ||
- name: prepare | ||
run: brew install exiftool imagemagick | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
- name: Install Android SDK | ||
uses: malinskiy/action-android/install-sdk@release/0.1.4 | ||
- name: Run instrumentation tests | ||
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.4 | ||
with: | ||
cmd: ./gradlew cAT --continue | ||
api: 28 | ||
tag: default | ||
abi: x86_64 | ||
cmdOptions: -noaudio -no-boot-anim -no-window | ||
- name: Archive Espresso results | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: matomo-Espresso-report | ||
path: demo/build/reports/androidTests/connected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
exampleapp/src/androidTest/java/org/matomo/demo/SmokeTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.matomo.demo | ||
|
||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.core.graphics.writeToTestStorage | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import androidx.test.espresso.screenshot.captureToBitmap | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.rules.TestName | ||
import org.junit.runner.RunWith | ||
import org.matomo.demo.DemoActivity | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class SmokeTest { | ||
|
||
private val WAIT_SLIDER = 600L | ||
|
||
@get:Rule | ||
val activityScenarioRule = activityScenarioRule<DemoActivity>() | ||
|
||
@get:Rule | ||
var nameRule = TestName() | ||
|
||
@Test | ||
fun testExpand() { | ||
onView(withId(R.id.trackMainScreenViewButton)).perform(click()) | ||
onView(withId(R.id.trackDispatchNow)).perform(click()) | ||
onView(withId(R.id.trackCustomVarsButton)).perform(click()) | ||
onView(withId(R.id.raiseExceptionButton)).perform(click()) | ||
onView(withId(R.id.addEcommerceItemButton)).perform(click()) | ||
onView(withId(R.id.trackEcommerceCartUpdateButton)).perform(click()) | ||
onView(withId(R.id.completeEcommerceOrderButton)).perform(click()) | ||
onView(withId(R.id.trackGoalButton)).perform(click()) | ||
onView(withId(R.id.goalTextEditView)).perform(click()) | ||
} | ||
|
||
} |