Skip to content

Commit 1935815

Browse files
authored
Merge pull request #77 from AppDevNext/ScreenshotCompare
Screenshot compare tests
2 parents 51f7583 + 7da5baa commit 1935815

File tree

66 files changed

+29
-0
lines changed

Some content is hidden

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

66 files changed

+29
-0
lines changed

.github/workflows/Android-CI.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
uses: actions/checkout@v3.5.3
1919
with:
2020
fetch-depth: 0
21+
submodules: true
22+
- name: prepare
23+
run: brew install exiftool imagemagick
2124
- name: Install JDK ${{ matrix.java_version }}
2225
uses: actions/setup-java@v3
2326
with:
@@ -54,6 +57,19 @@ jobs:
5457
path: |
5558
MPChartExample/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected
5659
MPChartExample/build/outputs/androidTest-results/connected
60+
- name: Compare screenshots
61+
run: |
62+
ls -ls MPChartExample/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected
63+
cp MPChartExample/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/emulator\(AVD\)\ -\ 9/* screenshotsToCompare
64+
./screenShotCompare.sh
65+
- name: Archive screenshots diffs
66+
if: ${{ always() }}
67+
uses: actions/upload-artifact@v3
68+
with:
69+
name: MPChart-Screenshots-diffs
70+
path: |
71+
screenshotDiffs
72+
5773
Check:
5874
name: Check
5975
runs-on: ubuntu-latest

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "git-diff-image"]
2+
path = git-diff-image
3+
url = git@github.com:ewanmellor/git-diff-image.git

git-diff-image

Submodule git-diff-image added at e4932df

screenShotCompare.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
diffFiles=./screenshotDiffs
2+
mkdir $diffFiles
3+
#cp MPChartExample/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/emulator\(AVD\)\ -\ 9/* screenshotsToCompare
4+
set -x
5+
./git-diff-image/install.sh
6+
GIT_DIFF_IMAGE_OUTPUT_DIR=$diffFiles git diff-image
7+
8+
# set error when diffs are there
9+
[ "$(ls -A $diffFiles)" ] && exit 1 || exit 0
25.9 KB
36.4 KB
50.6 KB
60 KB
68 KB
76 KB

0 commit comments

Comments
 (0)