From 1af2ffd097c51a281bbfad7e83e9f85ac35397e5 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:09:36 +0000 Subject: [PATCH 01/96] add base for test job in .gitlab-ci.yml --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0601958f2e..7f7de4135c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,12 @@ stages: before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew +test: + stage: test + tags: + - rpi-vb + script: + echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" cache: key: ${CI_PROJECT_ID} -- GitLab From 94aa435a6a2809ac21f3bb15e4c0f9999735cab2 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:41:19 +0000 Subject: [PATCH 02/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f7de4135c..dfad3ca314 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ stages: before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew + test: stage: test tags: -- GitLab From d98eb1c2b3012cf5c71b61273d3b36d9fffde95a Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:43:04 +0000 Subject: [PATCH 03/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfad3ca314..ff40e1a045 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,6 @@ before_script: - chmod +x ./gradlew test: - stage: test tags: - rpi-vb script: -- GitLab From edfc33193576ed3f84b6109e070b8a20e5ca1fa0 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:43:37 +0000 Subject: [PATCH 04/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff40e1a045..ffd2af05be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ before_script: - chmod +x ./gradlew test: + stage: .post tags: - rpi-vb script: -- GitLab From 45541b7201f04cd560dcbfbc35a82bf150b6e4e9 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 09:39:31 +0000 Subject: [PATCH 05/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffd2af05be..b2aa9ef145 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ before_script: - chmod +x ./gradlew test: - stage: .post + stage: .pre tags: - rpi-vb script: -- GitLab From 38bc00cbbf5771c8c0eb8e3bff9f3fefeb17f523 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:47:44 +0000 Subject: [PATCH 06/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2aa9ef145..49d0e00a1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,8 @@ test: tags: - rpi-vb script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" + - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" + - pwd cache: key: ${CI_PROJECT_ID} -- GitLab From 30ae97f6d7ca9e144c289873e98e48ad70335883 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:48:47 +0000 Subject: [PATCH 07/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49d0e00a1c..62288050b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,8 @@ test: script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd + - cd ../../.. + - pwd cache: key: ${CI_PROJECT_ID} -- GitLab From 580c10fa8546e60e38fd5cfbd80d537a729ab219 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:50:35 +0000 Subject: [PATCH 08/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62288050b4..b4a2cf30bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd - - cd ../../.. + - cd home/pi/Desktop/linux-x86/framework - pwd cache: -- GitLab From f0ab434c8b6440be7990fa9d89319d46120bf815 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:53:35 +0000 Subject: [PATCH 09/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b4a2cf30bd..d3640275ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd - - cd home/pi/Desktop/linux-x86/framework + - cd /home/pi/Desktop/linux-x86/framework - pwd cache: -- GitLab From c60d9a3cd662f170d778c51e1ac456a375b8f7c7 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 13:06:36 +0000 Subject: [PATCH 10/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d3640275ea..b9b76af2d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,9 @@ test: - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd + - ./tradefed.sh + - help run + - run example/helloworld cache: key: ${CI_PROJECT_ID} -- GitLab From 8ba72ad51e0683f707cb0c652561d4c03805c7c8 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 13:07:38 +0000 Subject: [PATCH 11/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b9b76af2d3..bcff4601c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,9 +16,7 @@ test: - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh - - help run - - run example/helloworld + - ./tradefed.sh run example/helloworld cache: key: ${CI_PROJECT_ID} -- GitLab From 1f99ec9647ed5d488852f828c09fb0131bd1e8de Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 13:20:05 +0000 Subject: [PATCH 12/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcff4601c3..7cbe20092e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,6 @@ test: tags: - rpi-vb script: - - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd -- GitLab From 25aa56d04fa91289c3c7aa4e2063a77afb1af05d Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Thu, 19 Nov 2020 15:36:21 +0100 Subject: [PATCH 13/96] add two test for LauncherActivity. One which just check everything is here after a left swipe and a second one which fails at the moment at the last step: check that Calendar appears in suggested app after a search for 'calendar' --- app/build.gradle | 4 +- .../ExampleInstrumentedTest.java | 41 ------ .../launcher/LauncherActivityUiTest.java | 119 ++++++++++++++++++ 3 files changed, 122 insertions(+), 42 deletions(-) delete mode 100755 app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java create mode 100644 app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java diff --git a/app/build.gradle b/app/build.gradle index bd0fba222b..5cff9576b7 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,7 +19,7 @@ android { targetSdkVersion Versions.target_sdk versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 versionName "${versionMajor}.${versionMinor}.${versionPatch}" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" renderscriptTargetApi 28 renderscriptSupportModeEnabled true @@ -132,6 +132,8 @@ dependencies { androidTestImplementation Libs.AndroidX.Test.runner androidTestImplementation Libs.AndroidX.Test.rules implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' + androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' + } apply plugin: 'com.getkeepsafe.dexcount' diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java deleted file mode 100755 index f0223b5428..0000000000 --- a/app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2018 /e/. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package foundation.e.blisslauncher; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("org.indin.blisslaunchero", appContext.getPackageName()); - } -} diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java new file mode 100644 index 0000000000..5908d62bda --- /dev/null +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -0,0 +1,119 @@ +package foundation.e.blisslauncher.features.launcher; + + +import androidx.test.espresso.ViewInteraction; +import androidx.test.espresso.action.ViewActions; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.ActivityTestRule; +import androidx.test.uiautomator.UiDevice; + +import org.hamcrest.Matcher; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.io.IOException; + +import foundation.e.blisslauncher.R; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.*; +import static androidx.test.espresso.matcher.ViewMatchers.*; +import static androidx.test.espresso.matcher.ViewMatchers.hasChildCount; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withHint; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.not; + + + +@RunWith(AndroidJUnit4ClassRunner.class) +public class LauncherActivityUiTest { + + private UiDevice device; + @Rule + public ActivityTestRule mLauncherActivityTestRule = + new ActivityTestRule(LauncherActivity.class); + + + + @Test + public void displayLeftPanelTest() throws Exception{ + //Swipe on the main view to display the left panel + onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); + + //Check every element that should be here are here: Search bar, app suggestion, edit widget buttons and weather widget + + //Check app suggestion is displayed + onView(allOf(withId(R.id.suggestedAppGrid), hasChildCount(4))).check(matches(isDisplayed())); + + //check edit widget button is displayed + onView(withId(R.id.edit_widgets_button)).check(matches(isDisplayed())); + + //check that search_input is displayed + //Note: it was a pain to find the "not(withParent(withParent(withParent(withId(swipe_search_container))))" + //because it told that was more than one match with other trials, but in the "run" window , there was only one + //I had to add breakpoint and analyse Object "editText" to find the other one then to find for difference between both... + final Matcher searchInputMatcher = allOf(withId(R.id.search_input), not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ) ); + ViewInteraction editText = onView(searchInputMatcher); + + editText.check(matches(withHint("Search"))) + .check(matches( isDisplayed() ) ); + + //check that weather widget is displayed + onView(withId(R.id.weather_info_layout)).check(matches(isDisplayed())); + } + + @Test + public void searchCalendarAppTest() throws Exception{ + final String Calendar_app_name = "Calendar"; + + device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + + //Swipe on the main view to display the left panel + onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); + final Matcher notChildOfSwipeSearchContainer = not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ); + final Matcher searchInputMatcher = allOf(withId(R.id.search_input), notChildOfSwipeSearchContainer ); + + //Click on "search input bar" + final ViewInteraction editText = onView(searchInputMatcher); + editText.perform(ViewActions.click()); + + final String checkKeyboardCmd = "dumpsys input_method | grep mInputShown"; + + //check soft keyboard displayed + boolean softKeyboardShown = false; + try { + softKeyboardShown = device.executeShellCommand(checkKeyboardCmd).contains("mInputShown=true"); + } catch ( IOException e) { + System.out.println(e.toString()); + throw new RuntimeException("Keyboard check failed", e); + } + + Assert.assertTrue(softKeyboardShown); + + //Type "Calendar" into the textBox + editText.perform(ViewActions.typeText(Calendar_app_name)); + + //Check the value is set in input + editText.check(matches(withText(Calendar_app_name))); + + + //check the clear button is present + onView(allOf(withId(R.id.clearSuggestionImageView), notChildOfSwipeSearchContainer) ) + .check(matches( not(withEffectiveVisibility(Visibility.GONE)))); + + + //Check calendar is the only displayed in suggested app + final ViewInteraction appGrid = onView(allOf(withId(R.id.suggestedAppGrid), hasMinimumChildCount(1) ) ); + + //This test fails because it doesn't find the label under the icon... + appGrid.check(matches(withChild(withText(Calendar_app_name)))); + + } + +} -- GitLab From 1c8941f1fc222c265bda944b772317e94a41a902 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Fri, 20 Nov 2020 08:50:38 +0000 Subject: [PATCH 14/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cbe20092e..931193929f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,14 +8,14 @@ before_script: - chmod +x ./gradlew test: - stage: .pre + stage: .post tags: - rpi-vb script: - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh run example/helloworld + - ./tradefed.sh run tf/instrumentation --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest #--install-file cache: key: ${CI_PROJECT_ID} -- GitLab From 531d74ffffef145d019886c090cfe4449d1885b0 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 23 Nov 2020 15:08:25 +0000 Subject: [PATCH 15/96] Change TF command --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 931193929f..27f15cf0ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,10 +12,9 @@ test: tags: - rpi-vb script: - - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh run tf/instrumentation --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest #--install-file + - ./tradefed.sh instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner AndroidJUnitRunner #--install-file cache: key: ${CI_PROJECT_ID} -- GitLab From 68278f11de290be7d3cb01af42aa9a61b792338b Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 23 Nov 2020 15:47:21 +0000 Subject: [PATCH 16/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27f15cf0ae..aebe028590 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner AndroidJUnitRunner #--install-file + - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" cache: key: ${CI_PROJECT_ID} -- GitLab From bfa8f45f4c0c2b347982460a583b16f9eecaa8b9 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 15:18:30 +0100 Subject: [PATCH 17/96] add element to build test apk --- app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 5cff9576b7..b460026ce0 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,6 +34,10 @@ android { signingConfig signingConfigs.debug } + test { + applicationIdSuffix '.test' + signingConfig signingConfigs.debug + } applicationVariants.all { variant -> if (variant.buildType.name == "debug") { variant.outputs.all { output -> -- GitLab From c77b8bf588866e43b86be8428efb7a46dc4a8452 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 15:28:41 +0100 Subject: [PATCH 18/96] add element to build test apk --- app/build.gradle | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b460026ce0..24a0381afc 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,11 +33,6 @@ android { applicationIdSuffix '.debug' signingConfig signingConfigs.debug } - - test { - applicationIdSuffix '.test' - signingConfig signingConfigs.debug - } applicationVariants.all { variant -> if (variant.buildType.name == "debug") { variant.outputs.all { output -> @@ -47,6 +42,7 @@ android { } } + testBuildType "release" signingConfigs { debug { -- GitLab From 82aee20ffc58ebea192e0c984a0a956bfddcee80 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 16:24:48 +0100 Subject: [PATCH 19/96] update build.gradle --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 24a0381afc..7003b9c49d 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 versionName "${versionMajor}.${versionMinor}.${versionPatch}" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - + testBuildType System.getProperty('testBuildType', 'debug') renderscriptTargetApi 28 renderscriptSupportModeEnabled true } @@ -42,7 +42,7 @@ android { } } - testBuildType "release" + signingConfigs { debug { -- GitLab From 4ccd547703371be4e889640ff004c3e17b3b44ea Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 16:26:18 +0100 Subject: [PATCH 20/96] add build of test apk in build file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aebe028590..d8569be0a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,7 @@ build: stage: build script: - ./gradlew build + - ./gradlew assembleAndroidTest artifacts: paths: - app/build/outputs/apk -- GitLab From 0e34b570164a13b6dbed78a602b129299b6448ec Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 09:11:34 +0000 Subject: [PATCH 21/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8569be0a9..874c49151f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,9 @@ test: - cd /home/pi/Desktop/linux-x86/framework - pwd - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" - + artifacts: + paths: + - /tmp cache: key: ${CI_PROJECT_ID} paths: -- GitLab From 3673fb17361a5069fcd362b02fe3b1055485bb6c Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 09:17:04 +0000 Subject: [PATCH 22/96] add node about artifact of tests ; Update .gitlab-ci.yml --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 874c49151f..998a240392 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest stages: - build - +- test before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew @@ -16,8 +16,9 @@ test: - pwd - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" artifacts: - paths: - - /tmp + reports: + junit: foobar.xml + cache: key: ${CI_PROJECT_ID} paths: -- GitLab From 7d76fe676dfae82af83d729300f56694bd06f0da Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 10:22:09 +0000 Subject: [PATCH 23/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 998a240392..b03fe7291d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" + - ./tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" artifacts: reports: junit: foobar.xml -- GitLab From 1f455f7c981ecd881be41cc54dcba4a713d28a06 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 12:25:41 +0000 Subject: [PATCH 24/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b03fe7291d..aeccbdabf8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,12 +3,13 @@ image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest stages: - build - test + before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew test: - stage: .post + stage: test tags: - rpi-vb script: -- GitLab From 38ec0c4109cb77f97315a46422ee2006534a6aaf Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 14:34:03 +0000 Subject: [PATCH 25/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeccbdabf8..ae5747b917 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,7 @@ test: tags: - rpi-vb script: - - cd /home/pi/Desktop/linux-x86/framework - - pwd - - ./tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" + - ./home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: junit: foobar.xml -- GitLab From 625257d703d9c911f4ef0c7c57ab342df507b7f2 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 14:45:27 +0000 Subject: [PATCH 26/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae5747b917..8d2bf028f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ test: tags: - rpi-vb script: - - ./home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" + - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: junit: foobar.xml -- GitLab From 108cdb8be9ae79a6cfa55a0c3e878037d4e0c21b Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:02:52 +0000 Subject: [PATCH 27/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d2bf028f4..71198f2737 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ test: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: - junit: foobar.xml + junit: /tmp/0/stub/**/**/foobar.xml cache: key: ${CI_PROJECT_ID} -- GitLab From dc5d79e8455e8f82aa8b85557cd777e47715d2f6 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:03:37 +0000 Subject: [PATCH 28/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71198f2737..6cad395177 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ test: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: - junit: /tmp/0/stub/**/**/foobar.xml + junit: /tmp/0/stub/**/*.zip cache: key: ${CI_PROJECT_ID} -- GitLab From 9fc192e3afef761cb65e8e164d817ab1d7463460 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:12:40 +0000 Subject: [PATCH 29/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6cad395177..785a74fbb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,7 @@ test: script: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: - reports: - junit: /tmp/0/stub/**/*.zip + paths: /tmp/0/stub/ cache: key: ${CI_PROJECT_ID} -- GitLab From e71a4730c510d7f37a635f682220c3db3d0e72d2 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:13:35 +0000 Subject: [PATCH 30/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 785a74fbb6..2eef8b63b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,8 @@ test: script: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: - paths: /tmp/0/stub/ + paths: + - /tmp/0/stub/ cache: key: ${CI_PROJECT_ID} -- GitLab From cd6f61782dc03d3490ad59c12123ddcbfb166bbc Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 1 Dec 2020 14:14:21 +0000 Subject: [PATCH 31/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2eef8b63b5..305b9236be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,9 +14,12 @@ test: - rpi-vb script: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" + - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) + - mkdir result + - cp --recursive "$resultDirectory" result/ artifacts: paths: - - /tmp/0/stub/ + - result/ cache: key: ${CI_PROJECT_ID} -- GitLab From 67a5806c16a0384d2561d0b52c85248ea8098592 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 1 Dec 2020 14:30:45 +0000 Subject: [PATCH 32/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 305b9236be..9a114c9e96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,9 +17,11 @@ test: - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) - mkdir result - cp --recursive "$resultDirectory" result/ + - OUTPUT_RESULT_DIR=$(ls -dt result/* |head -n 1) + - echo "$OUTPUT_RESULT_DIR" artifacts: paths: - - result/ + - "$OUTPUT_RESULT_DIR" cache: key: ${CI_PROJECT_ID} -- GitLab From ee03a6d1693ffd7cb05e9c166013d3be7c268a8a Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 1 Dec 2020 15:42:26 +0000 Subject: [PATCH 33/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a114c9e96..305b9236be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,11 +17,9 @@ test: - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) - mkdir result - cp --recursive "$resultDirectory" result/ - - OUTPUT_RESULT_DIR=$(ls -dt result/* |head -n 1) - - echo "$OUTPUT_RESULT_DIR" artifacts: paths: - - "$OUTPUT_RESULT_DIR" + - result/ cache: key: ${CI_PROJECT_ID} -- GitLab From 17fee08f53577982d785d0ff536b64900de2ba8b Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Thu, 3 Dec 2020 14:42:56 +0000 Subject: [PATCH 34/96] add a mockup test result --- test_result_mockup.xml | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test_result_mockup.xml diff --git a/test_result_mockup.xml b/test_result_mockup.xml new file mode 100644 index 0000000000..bbb99fedaf --- /dev/null +++ b/test_result_mockup.xml @@ -0,0 +1,45 @@ + + + + + androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'has child: with text: is "Calendar"' doesn't match the selected view. +Expected: has child: with text: is "Calendar" + Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" + + at dalvik.system.VMStack.getThreadStackTrace(Native Method) + at java.lang.Thread.getStackTrace(Thread.java:1566) + at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:96) + at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59) + at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:324) + at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:306) + at foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest.searchCalendarAppTest(LauncherActivityUiTest.java:115) + at java.lang.reflect.Method.invoke(Native Method) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) + at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) + at java.util.concurrent.FutureTask.run(FutureTask.java:237) + at java.lang.Thread.run(Thread.java:761) +Caused by: junit.framework.AssertionFailedError: 'has child: with text: is "Calendar"' doesn't match the selected view. +Expected: has child: with text: is "Calendar" + Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" + + at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:540) + at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:105) + at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:425) + at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:288) + at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:272) + at java.util.concurrent.FutureTask.run(FutureTask.java:237) + at android.os.Handler.handleCallback(Handler.java:751) + at android.os.Handler.dispatchMessage(Handler.java:95) + at android.os.Looper.loop(Looper.java:154) + at android.app.ActivityThread.main(ActivityThread.java:6186) + at java.lang.reflect.Method.invoke(Native Method) + at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) + at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) + + + + \ No newline at end of file -- GitLab From c1f873a4b4f76b6b6be78b46b06a1ea6a286d826 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Thu, 3 Dec 2020 14:47:02 +0000 Subject: [PATCH 35/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 305b9236be..b2f1ce3ba7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,8 @@ test: artifacts: paths: - result/ + reports: + junit: test_result_mockup.xml cache: key: ${CI_PROJECT_ID} -- GitLab From 2b5889cfa2cf9fe8a4a399c2bc93ea6c7d4e9605 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Thu, 3 Dec 2020 15:11:59 +0000 Subject: [PATCH 36/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2f1ce3ba7..6b945373e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,7 @@ test: artifacts: paths: - result/ + - test_result_mockup.xml reports: junit: test_result_mockup.xml -- GitLab From 53a05477ae4b903f7fc3761a1e0a743adf5a2064 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:03:01 +0000 Subject: [PATCH 37/96] Delete test_result_mockup.xml --- test_result_mockup.xml | 45 ------------------------------------------ 1 file changed, 45 deletions(-) delete mode 100644 test_result_mockup.xml diff --git a/test_result_mockup.xml b/test_result_mockup.xml deleted file mode 100644 index bbb99fedaf..0000000000 --- a/test_result_mockup.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'has child: with text: is "Calendar"' doesn't match the selected view. -Expected: has child: with text: is "Calendar" - Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" - - at dalvik.system.VMStack.getThreadStackTrace(Native Method) - at java.lang.Thread.getStackTrace(Thread.java:1566) - at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:96) - at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59) - at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:324) - at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:306) - at foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest.searchCalendarAppTest(LauncherActivityUiTest.java:115) - at java.lang.reflect.Method.invoke(Native Method) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) - at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) - at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) - at java.util.concurrent.FutureTask.run(FutureTask.java:237) - at java.lang.Thread.run(Thread.java:761) -Caused by: junit.framework.AssertionFailedError: 'has child: with text: is "Calendar"' doesn't match the selected view. -Expected: has child: with text: is "Calendar" - Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" - - at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:540) - at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:105) - at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:425) - at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:288) - at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:272) - at java.util.concurrent.FutureTask.run(FutureTask.java:237) - at android.os.Handler.handleCallback(Handler.java:751) - at android.os.Handler.dispatchMessage(Handler.java:95) - at android.os.Looper.loop(Looper.java:154) - at android.app.ActivityThread.main(ActivityThread.java:6186) - at java.lang.reflect.Method.invoke(Native Method) - at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) - at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) - - - - \ No newline at end of file -- GitLab From d395c3427ec7d519508ce6a3f5dc8cbe01cc17b8 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:13:54 +0000 Subject: [PATCH 38/96] Remove test jobs in .gitlab-ci.yml --- .gitlab-ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b945373e8..a906e2d705 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,28 +2,11 @@ image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest stages: - build -- test before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew -test: - stage: test - tags: - - rpi-vb - script: - - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" - - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) - - mkdir result - - cp --recursive "$resultDirectory" result/ - artifacts: - paths: - - result/ - - test_result_mockup.xml - reports: - junit: test_result_mockup.xml - cache: key: ${CI_PROJECT_ID} paths: -- GitLab From b882153b733ec1eb68526d94810de9afce3ce8ac Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:46:48 +0000 Subject: [PATCH 39/96] Add BlissLauncherTestSuite --- .../e/blisslauncher/BlissLauncherTestSuite.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java new file mode 100644 index 0000000000..ecf7326d89 --- /dev/null +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -0,0 +1,9 @@ + @RunWith(Suite::class + @Suite.Classes( + /* Here list all you tests classes that are part of the suite + * eg: + * mainActivityTest::class, * secondActivityTest::class, + * serviceTest::class + */ + ) + class BlissLauncherTestSuite -- GitLab From 025aaa5343e3deae0ac4abd8b59cb676bd43e225 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:54:52 +0000 Subject: [PATCH 40/96] add import & package lines. Add LauncherActivityUiTest as test to run in BlissLauncherTestSuite.java --- .../blisslauncher/BlissLauncherTestSuite.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index ecf7326d89..2e70ee6fa0 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -1,9 +1,17 @@ - @RunWith(Suite::class - @Suite.Classes( - /* Here list all you tests classes that are part of the suite - * eg: - * mainActivityTest::class, * secondActivityTest::class, - * serviceTest::class - */ - ) - class BlissLauncherTestSuite +package foundation.e.blisslauncher; + + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import foundation.e.blisslauncher.features.launcher; + +@RunWith(Suite::class +@Suite.Classes( +/* Here list all you tests classes that are part of the suite +* eg: +* mainActivityTest::class, * secondActivityTest::class, +* serviceTest::class +*/ + LauncherActivityUiTest::class +) +class BlissLauncherTestSuite -- GitLab From cb2720bfbf825d3e1c78e1cc8035fb2d03d66594 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 16:03:33 +0100 Subject: [PATCH 41/96] add comment --- .../blisslauncher/features/launcher/LauncherActivityUiTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 5908d62bda..33e8b712a2 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -28,7 +28,7 @@ import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.not; - +//instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner @RunWith(AndroidJUnit4ClassRunner.class) -- GitLab From 69d2f723292ad390f73cf3416275017a95eb290e Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 16:10:11 +0100 Subject: [PATCH 42/96] remove import --- .../java/foundation/e/blisslauncher/BlissLauncherTestSuite.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index 2e70ee6fa0..8557c7018a 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -3,7 +3,6 @@ package foundation.e.blisslauncher; import org.junit.runner.RunWith; import org.junit.runners.Suite; -import foundation.e.blisslauncher.features.launcher; @RunWith(Suite::class @Suite.Classes( -- GitLab From 927c46fb66943d74ce1dd65ea20c3e72c19b68b8 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 16:31:48 +0100 Subject: [PATCH 43/96] update BlissLauncherTestSuite.java --- .../e/blisslauncher/BlissLauncherTestSuite.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index 8557c7018a..a879a3232a 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -1,11 +1,13 @@ package foundation.e.blisslauncher; - import org.junit.runner.RunWith; import org.junit.runners.Suite; -@RunWith(Suite::class -@Suite.Classes( + +import foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest; + +@RunWith(Suite::class) +@Suite.SuiteClasses( /* Here list all you tests classes that are part of the suite * eg: * mainActivityTest::class, * secondActivityTest::class, -- GitLab From d82fecc1133a2db4059709e4645e7e3c3f4c0b05 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 17:17:59 +0100 Subject: [PATCH 44/96] fix issue with BlissLauncherTestSuite.java --- .../blisslauncher/BlissLauncherTestSuite.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index a879a3232a..4abe0f2c63 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -6,13 +6,16 @@ import org.junit.runners.Suite; import foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest; -@RunWith(Suite::class) -@Suite.SuiteClasses( +@RunWith(Suite.class) /* Here list all you tests classes that are part of the suite -* eg: -* mainActivityTest::class, * secondActivityTest::class, -* serviceTest::class -*/ - LauncherActivityUiTest::class + * eg: + * mainActivityTest.class, + * secondActivityTest.class, + * serviceTest.class + */ +@Suite.SuiteClasses( + LauncherActivityUiTest.class ) -class BlissLauncherTestSuite +public class BlissLauncherTestSuite{ + +} -- GitLab From d15bcafa2f29537c94411348900f5d3718c8f043 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 12 Jan 2021 17:25:55 +0100 Subject: [PATCH 45/96] tried to fix second test. failure --- .../launcher/LauncherActivityUiTest.java | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 33e8b712a2..312850db9b 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -1,14 +1,20 @@ package foundation.e.blisslauncher.features.launcher; +import android.view.View; + +import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; +import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.rule.ActivityTestRule; +import androidx.test.uiautomator.UiAutomatorInstrumentationTestRunner; import androidx.test.uiautomator.UiDevice; import org.hamcrest.Matcher; +import org.hamcrest.core.IsInstanceOf; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -74,11 +80,21 @@ public class LauncherActivityUiTest { device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + + + //Swipe on the main view to display the left panel onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); final Matcher notChildOfSwipeSearchContainer = not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ); final Matcher searchInputMatcher = allOf(withId(R.id.search_input), notChildOfSwipeSearchContainer ); + + //Check there is 4 app suggested + final ViewInteraction appGrid = onView(allOf(withId(R.id.suggestedAppGrid), withParent(withParent(withId(R.id.used_apps_layout) ) ), isDisplayed() ) ); + appGrid.check(matches(hasChildCount(4))); + + + //Click on "search input bar" final ViewInteraction editText = onView(searchInputMatcher); editText.perform(ViewActions.click()); @@ -109,10 +125,32 @@ public class LauncherActivityUiTest { //Check calendar is the only displayed in suggested app - final ViewInteraction appGrid = onView(allOf(withId(R.id.suggestedAppGrid), hasMinimumChildCount(1) ) ); + appGrid.check(matches(withChild(hasChildCount(1)))); //DOESN't WORK + + + /* + final ViewInteraction appIcon = onView( allOf( + withId(R.id.icon_calendar), + isDisplayed() + ) + ); + + + + appIcon.check(matches(allOf( withChild( withId(R.id.calendar_month_textview)), + withChild( withId(R.id.calendar_date_textview)))));*/ + + final ViewInteraction appLabel = onView( + allOf( + withId( R.id.app_label), + withText(Calendar_app_name), + withParent( + withParent(IsInstanceOf.instanceOf(android.widget.FrameLayout.class) ) + ) + ) ) ; + + appLabel.check(matches(withText(Calendar_app_name))); - //This test fails because it doesn't find the label under the icon... - appGrid.check(matches(withChild(withText(Calendar_app_name)))); } -- GitLab From e3b5d60bda6430e7a2536f1cec9de0a0f9421c1d Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 13 Jan 2021 16:19:31 +0100 Subject: [PATCH 46/96] fix second test of BlissLauncher --- .../launcher/LauncherActivityUiTest.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 312850db9b..0edf4ebc79 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -3,6 +3,7 @@ package foundation.e.blisslauncher.features.launcher; import android.view.View; +import androidx.test.espresso.DataInteraction; import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; @@ -23,6 +24,9 @@ import org.junit.runner.RunWith; import java.io.IOException; import foundation.e.blisslauncher.R; + +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.*; import static androidx.test.espresso.matcher.ViewMatchers.*; @@ -74,6 +78,10 @@ public class LauncherActivityUiTest { onView(withId(R.id.weather_info_layout)).check(matches(isDisplayed())); } + /** + * This test requires Calendar App to be installed on the device + * @throws Exception + */ @Test public void searchCalendarAppTest() throws Exception{ final String Calendar_app_name = "Calendar"; @@ -119,39 +127,35 @@ public class LauncherActivityUiTest { editText.check(matches(withText(Calendar_app_name))); + //check the clear button is present onView(allOf(withId(R.id.clearSuggestionImageView), notChildOfSwipeSearchContainer) ) .check(matches( not(withEffectiveVisibility(Visibility.GONE)))); - //Check calendar is the only displayed in suggested app - appGrid.check(matches(withChild(hasChildCount(1)))); //DOESN't WORK + //close soft keyboard + closeSoftKeyboard(); + Thread.sleep(5000); //required to wait for update of UI - /* - final ViewInteraction appIcon = onView( allOf( - withId(R.id.icon_calendar), - isDisplayed() - ) - ); + //Check that there is only one app show in grid + final ViewInteraction appGrid2 = onView(allOf(withId(R.id.suggestedAppGrid), withParent(withParent(withId(R.id.used_apps_layout) ) ), isDisplayed() ) ); + appGrid2.check(matches(hasChildCount(1))); //DOESN't WORK - appIcon.check(matches(allOf( withChild( withId(R.id.calendar_month_textview)), - withChild( withId(R.id.calendar_date_textview)))));*/ + // Check that Calendar icon is clickable final ViewInteraction appLabel = onView( allOf( withId( R.id.app_label), withText(Calendar_app_name), withParent( withParent(IsInstanceOf.instanceOf(android.widget.FrameLayout.class) ) - ) + ), isDisplayed() ) ) ; - appLabel.check(matches(withText(Calendar_app_name))); - - + appLabel.check(matches(withParent(withChild(allOf(withId(R.id.app_icon), isClickable()))))); } } -- GitLab From b2164f17262b2140edda24cded718b0e9df40a2a Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 13 Jan 2021 16:27:00 +0100 Subject: [PATCH 47/96] remove useless import in LauncherActivityUiTest.java --- .../features/launcher/LauncherActivityUiTest.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 0edf4ebc79..a0985bf07c 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -3,15 +3,11 @@ package foundation.e.blisslauncher.features.launcher; import android.view.View; -import androidx.test.espresso.DataInteraction; -import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; -import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.rule.ActivityTestRule; -import androidx.test.uiautomator.UiAutomatorInstrumentationTestRunner; import androidx.test.uiautomator.UiDevice; import org.hamcrest.Matcher; @@ -20,13 +16,10 @@ import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; - import java.io.IOException; - import foundation.e.blisslauncher.R; import static androidx.test.espresso.Espresso.closeSoftKeyboard; -import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.*; import static androidx.test.espresso.matcher.ViewMatchers.*; @@ -38,6 +31,8 @@ import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.not; + + //instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner @@ -88,9 +83,6 @@ public class LauncherActivityUiTest { device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); - - - //Swipe on the main view to display the left panel onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); final Matcher notChildOfSwipeSearchContainer = not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ); -- GitLab From 4e55106a0f06d4f8e028afcf7e9cf33443142f4c Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 18 Jan 2021 14:43:29 +0000 Subject: [PATCH 48/96] make androidTest build to be release and not debug --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 7003b9c49d..a0cd35a5c9 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 versionName "${versionMajor}.${versionMinor}.${versionPatch}" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - testBuildType System.getProperty('testBuildType', 'debug') + testBuildType System.getProperty('testBuildType', 'release') renderscriptTargetApi 28 renderscriptSupportModeEnabled true } -- GitLab From 944c04ef6284dfcb36b5c7d6225d191a9f36a756 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Thu, 19 Nov 2020 15:36:21 +0100 Subject: [PATCH 49/96] add two test for LauncherActivity. One which just check everything is here after a left swipe and a second one which fails at the moment at the last step: check that Calendar appears in suggested app after a search for 'calendar' --- app/build.gradle | 4 +- .../ExampleInstrumentedTest.java | 41 ------ .../launcher/LauncherActivityUiTest.java | 119 ++++++++++++++++++ 3 files changed, 122 insertions(+), 42 deletions(-) delete mode 100755 app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java create mode 100644 app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java diff --git a/app/build.gradle b/app/build.gradle index fb5da052f8..8a67ab6d19 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,7 +19,7 @@ android { targetSdkVersion Versions.target_sdk versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 versionName "${versionMajor}.${versionMinor}.${versionPatch}" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" renderscriptTargetApi 28 renderscriptSupportModeEnabled true @@ -150,6 +150,8 @@ dependencies { androidTestImplementation Libs.AndroidX.Test.runner androidTestImplementation Libs.AndroidX.Test.rules implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' + androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' + } apply plugin: 'com.getkeepsafe.dexcount' diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java deleted file mode 100755 index f0223b5428..0000000000 --- a/app/src/androidTest/java/foundation/e/blisslauncher/ExampleInstrumentedTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2018 /e/. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package foundation.e.blisslauncher; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("org.indin.blisslaunchero", appContext.getPackageName()); - } -} diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java new file mode 100644 index 0000000000..5908d62bda --- /dev/null +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -0,0 +1,119 @@ +package foundation.e.blisslauncher.features.launcher; + + +import androidx.test.espresso.ViewInteraction; +import androidx.test.espresso.action.ViewActions; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.rule.ActivityTestRule; +import androidx.test.uiautomator.UiDevice; + +import org.hamcrest.Matcher; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.io.IOException; + +import foundation.e.blisslauncher.R; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.assertion.ViewAssertions.*; +import static androidx.test.espresso.matcher.ViewMatchers.*; +import static androidx.test.espresso.matcher.ViewMatchers.hasChildCount; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.withHint; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; +import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.not; + + + +@RunWith(AndroidJUnit4ClassRunner.class) +public class LauncherActivityUiTest { + + private UiDevice device; + @Rule + public ActivityTestRule mLauncherActivityTestRule = + new ActivityTestRule(LauncherActivity.class); + + + + @Test + public void displayLeftPanelTest() throws Exception{ + //Swipe on the main view to display the left panel + onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); + + //Check every element that should be here are here: Search bar, app suggestion, edit widget buttons and weather widget + + //Check app suggestion is displayed + onView(allOf(withId(R.id.suggestedAppGrid), hasChildCount(4))).check(matches(isDisplayed())); + + //check edit widget button is displayed + onView(withId(R.id.edit_widgets_button)).check(matches(isDisplayed())); + + //check that search_input is displayed + //Note: it was a pain to find the "not(withParent(withParent(withParent(withId(swipe_search_container))))" + //because it told that was more than one match with other trials, but in the "run" window , there was only one + //I had to add breakpoint and analyse Object "editText" to find the other one then to find for difference between both... + final Matcher searchInputMatcher = allOf(withId(R.id.search_input), not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ) ); + ViewInteraction editText = onView(searchInputMatcher); + + editText.check(matches(withHint("Search"))) + .check(matches( isDisplayed() ) ); + + //check that weather widget is displayed + onView(withId(R.id.weather_info_layout)).check(matches(isDisplayed())); + } + + @Test + public void searchCalendarAppTest() throws Exception{ + final String Calendar_app_name = "Calendar"; + + device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + + //Swipe on the main view to display the left panel + onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); + final Matcher notChildOfSwipeSearchContainer = not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ); + final Matcher searchInputMatcher = allOf(withId(R.id.search_input), notChildOfSwipeSearchContainer ); + + //Click on "search input bar" + final ViewInteraction editText = onView(searchInputMatcher); + editText.perform(ViewActions.click()); + + final String checkKeyboardCmd = "dumpsys input_method | grep mInputShown"; + + //check soft keyboard displayed + boolean softKeyboardShown = false; + try { + softKeyboardShown = device.executeShellCommand(checkKeyboardCmd).contains("mInputShown=true"); + } catch ( IOException e) { + System.out.println(e.toString()); + throw new RuntimeException("Keyboard check failed", e); + } + + Assert.assertTrue(softKeyboardShown); + + //Type "Calendar" into the textBox + editText.perform(ViewActions.typeText(Calendar_app_name)); + + //Check the value is set in input + editText.check(matches(withText(Calendar_app_name))); + + + //check the clear button is present + onView(allOf(withId(R.id.clearSuggestionImageView), notChildOfSwipeSearchContainer) ) + .check(matches( not(withEffectiveVisibility(Visibility.GONE)))); + + + //Check calendar is the only displayed in suggested app + final ViewInteraction appGrid = onView(allOf(withId(R.id.suggestedAppGrid), hasMinimumChildCount(1) ) ); + + //This test fails because it doesn't find the label under the icon... + appGrid.check(matches(withChild(withText(Calendar_app_name)))); + + } + +} -- GitLab From 0350e68c163f1787e1ce2feaf3c807c3b3724658 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:09:36 +0000 Subject: [PATCH 50/96] add base for test job in .gitlab-ci.yml --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0601958f2e..7f7de4135c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,12 @@ stages: before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew +test: + stage: test + tags: + - rpi-vb + script: + echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" cache: key: ${CI_PROJECT_ID} -- GitLab From 72c3ebd652145ad75d3588ef2ed64d0d2ba11d9f Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:41:19 +0000 Subject: [PATCH 51/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f7de4135c..dfad3ca314 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ stages: before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew + test: stage: test tags: -- GitLab From 7bd632f34ce3dcbb763d45e33f3391552f0e37b2 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:43:04 +0000 Subject: [PATCH 52/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfad3ca314..ff40e1a045 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,6 @@ before_script: - chmod +x ./gradlew test: - stage: test tags: - rpi-vb script: -- GitLab From dfea4f11755b8c4f96f9cafe00f8dcd6f27e5d36 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 16 Nov 2020 15:43:37 +0000 Subject: [PATCH 53/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff40e1a045..ffd2af05be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ before_script: - chmod +x ./gradlew test: + stage: .post tags: - rpi-vb script: -- GitLab From fa15aa5ea916665c6b68ca583a0371c436f2106e Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 09:39:31 +0000 Subject: [PATCH 54/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffd2af05be..b2aa9ef145 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ before_script: - chmod +x ./gradlew test: - stage: .post + stage: .pre tags: - rpi-vb script: -- GitLab From f3b23f89775cd476c8844d161f812fb76aa0766f Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:47:44 +0000 Subject: [PATCH 55/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2aa9ef145..49d0e00a1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,8 @@ test: tags: - rpi-vb script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" + - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" + - pwd cache: key: ${CI_PROJECT_ID} -- GitLab From c6a7073edf1d3cc19c14532c676fd20d4385a32f Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:48:47 +0000 Subject: [PATCH 56/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49d0e00a1c..62288050b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,8 @@ test: script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd + - cd ../../.. + - pwd cache: key: ${CI_PROJECT_ID} -- GitLab From 0f96c4154722cdc365e9b31cde42e784af1d7228 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:50:35 +0000 Subject: [PATCH 57/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62288050b4..b4a2cf30bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd - - cd ../../.. + - cd home/pi/Desktop/linux-x86/framework - pwd cache: -- GitLab From 3ce7c493a88e3e89fd6ccf4ddee3200c71b27f24 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 12:53:35 +0000 Subject: [PATCH 58/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b4a2cf30bd..d3640275ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd - - cd home/pi/Desktop/linux-x86/framework + - cd /home/pi/Desktop/linux-x86/framework - pwd cache: -- GitLab From 33220cc045de070f773da103995307e2bbc5c7fa Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 13:06:36 +0000 Subject: [PATCH 59/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d3640275ea..b9b76af2d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,9 @@ test: - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd + - ./tradefed.sh + - help run + - run example/helloworld cache: key: ${CI_PROJECT_ID} -- GitLab From 39e6a83f70d103a9a2d03ce737dd473683ce6099 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 13:07:38 +0000 Subject: [PATCH 60/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b9b76af2d3..bcff4601c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,9 +16,7 @@ test: - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh - - help run - - run example/helloworld + - ./tradefed.sh run example/helloworld cache: key: ${CI_PROJECT_ID} -- GitLab From ffed3aa2e710e0b9757df26c1912a8830961dcd3 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 17 Nov 2020 13:20:05 +0000 Subject: [PATCH 61/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcff4601c3..7cbe20092e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,6 @@ test: tags: - rpi-vb script: - - echo "ho ho ho! I'm running test! let it snow let it snow let it snow!!" - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd -- GitLab From 8c7f62a4ef82584ca78ea89d531fb52060213261 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 15:18:30 +0100 Subject: [PATCH 62/96] add element to build test apk --- app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 8a67ab6d19..075776fa00 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,6 +34,10 @@ android { signingConfig signingConfigs.debug } + test { + applicationIdSuffix '.test' + signingConfig signingConfigs.debug + } applicationVariants.all { variant -> if (variant.buildType.name == "debug") { variant.outputs.all { output -> -- GitLab From e3332a2680792a96623df7c2b963379f89a828d3 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Fri, 20 Nov 2020 08:50:38 +0000 Subject: [PATCH 63/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cbe20092e..931193929f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,14 +8,14 @@ before_script: - chmod +x ./gradlew test: - stage: .pre + stage: .post tags: - rpi-vb script: - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh run example/helloworld + - ./tradefed.sh run tf/instrumentation --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest #--install-file cache: key: ${CI_PROJECT_ID} -- GitLab From a4ee0391857796a938057614707a0ef63d47bcaa Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 23 Nov 2020 15:08:25 +0000 Subject: [PATCH 64/96] Change TF command --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 931193929f..27f15cf0ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,10 +12,9 @@ test: tags: - rpi-vb script: - - pwd - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh run tf/instrumentation --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest #--install-file + - ./tradefed.sh instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner AndroidJUnitRunner #--install-file cache: key: ${CI_PROJECT_ID} -- GitLab From 5ec1f5f0fdebee29e9add3876fc975f6ee4dca02 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 23 Nov 2020 15:47:21 +0000 Subject: [PATCH 65/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27f15cf0ae..aebe028590 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner AndroidJUnitRunner #--install-file + - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" cache: key: ${CI_PROJECT_ID} -- GitLab From e5ad63e3fd26521019577a44bb0e6eba886a5786 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 15:28:41 +0100 Subject: [PATCH 66/96] add element to build test apk --- app/build.gradle | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 075776fa00..fc1c398605 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,11 +33,6 @@ android { applicationIdSuffix '.debug' signingConfig signingConfigs.debug } - - test { - applicationIdSuffix '.test' - signingConfig signingConfigs.debug - } applicationVariants.all { variant -> if (variant.buildType.name == "debug") { variant.outputs.all { output -> @@ -47,6 +42,7 @@ android { } } + testBuildType "release" signingConfigs { debug { -- GitLab From 0a5e92091aaf2f88e3d6cb9eadd40c51ce49158d Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 16:24:48 +0100 Subject: [PATCH 67/96] update build.gradle --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fc1c398605..45f5115722 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 versionName "${versionMajor}.${versionMinor}.${versionPatch}" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - + testBuildType System.getProperty('testBuildType', 'debug') renderscriptTargetApi 28 renderscriptSupportModeEnabled true } @@ -42,7 +42,7 @@ android { } } - testBuildType "release" + signingConfigs { debug { -- GitLab From 80eee3caddb51e96d77373aa483e925d17d10728 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 24 Nov 2020 16:26:18 +0100 Subject: [PATCH 68/96] add build of test apk in build file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aebe028590..d8569be0a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,7 @@ build: stage: build script: - ./gradlew build + - ./gradlew assembleAndroidTest artifacts: paths: - app/build/outputs/apk -- GitLab From 767a8e4e11247cac8147828a0138f6ddcaaac42e Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 09:11:34 +0000 Subject: [PATCH 69/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8569be0a9..874c49151f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,9 @@ test: - cd /home/pi/Desktop/linux-x86/framework - pwd - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" - + artifacts: + paths: + - /tmp cache: key: ${CI_PROJECT_ID} paths: -- GitLab From b597b89909d0b7ae65f3cff59bc67309b053418f Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 09:17:04 +0000 Subject: [PATCH 70/96] add node about artifact of tests ; Update .gitlab-ci.yml --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 874c49151f..998a240392 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest stages: - build - +- test before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew @@ -16,8 +16,9 @@ test: - pwd - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" artifacts: - paths: - - /tmp + reports: + junit: foobar.xml + cache: key: ${CI_PROJECT_ID} paths: -- GitLab From 2ad90c53e4e844ae67b1663ab92c2c48fd367f29 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 10:22:09 +0000 Subject: [PATCH 71/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 998a240392..b03fe7291d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ test: script: - cd /home/pi/Desktop/linux-x86/framework - pwd - - ./tradefed.sh run instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" + - ./tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" artifacts: reports: junit: foobar.xml -- GitLab From 507317f3377cd46f5a0137337e8de550e36f6b9d Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 25 Nov 2020 12:25:41 +0000 Subject: [PATCH 72/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b03fe7291d..aeccbdabf8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,12 +3,13 @@ image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest stages: - build - test + before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew test: - stage: .post + stage: test tags: - rpi-vb script: -- GitLab From ce0faac5d7d29c253b79b63aabb6fc78d1bd3071 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 14:34:03 +0000 Subject: [PATCH 73/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeccbdabf8..ae5747b917 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,7 @@ test: tags: - rpi-vb script: - - cd /home/pi/Desktop/linux-x86/framework - - pwd - - ./tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" + - ./home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: junit: foobar.xml -- GitLab From 40106d0350b1fefe3e97866c2d1be8a6b5dbc21a Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 14:45:27 +0000 Subject: [PATCH 74/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae5747b917..8d2bf028f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ test: tags: - rpi-vb script: - - ./home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" + - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: junit: foobar.xml -- GitLab From f5f2bb04803d680c3514daf3882582dabb42e7ca Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:02:52 +0000 Subject: [PATCH 75/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d2bf028f4..71198f2737 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ test: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: - junit: foobar.xml + junit: /tmp/0/stub/**/**/foobar.xml cache: key: ${CI_PROJECT_ID} -- GitLab From eb8b8851a247de501a7d46b4168c3caedab1dbd2 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:03:37 +0000 Subject: [PATCH 76/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71198f2737..6cad395177 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ test: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: reports: - junit: /tmp/0/stub/**/**/foobar.xml + junit: /tmp/0/stub/**/*.zip cache: key: ${CI_PROJECT_ID} -- GitLab From 72e89034ca3272bba23fe75ad7e5830462b46f0f Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:12:40 +0000 Subject: [PATCH 77/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6cad395177..785a74fbb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,7 @@ test: script: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: - reports: - junit: /tmp/0/stub/**/*.zip + paths: /tmp/0/stub/ cache: key: ${CI_PROJECT_ID} -- GitLab From 49d36394f3d0735a907957951a0ffff11115df60 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 30 Nov 2020 16:13:35 +0000 Subject: [PATCH 78/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 785a74fbb6..2eef8b63b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,8 @@ test: script: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" artifacts: - paths: /tmp/0/stub/ + paths: + - /tmp/0/stub/ cache: key: ${CI_PROJECT_ID} -- GitLab From 4de6be985bf890509963dce3c198eddc5e8c7463 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 1 Dec 2020 14:14:21 +0000 Subject: [PATCH 79/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2eef8b63b5..305b9236be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,9 +14,12 @@ test: - rpi-vb script: - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" + - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) + - mkdir result + - cp --recursive "$resultDirectory" result/ artifacts: paths: - - /tmp/0/stub/ + - result/ cache: key: ${CI_PROJECT_ID} -- GitLab From 06f0d531e5f70ebf583772b724ef671590b7cd66 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 1 Dec 2020 14:30:45 +0000 Subject: [PATCH 80/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 305b9236be..9a114c9e96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,9 +17,11 @@ test: - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) - mkdir result - cp --recursive "$resultDirectory" result/ + - OUTPUT_RESULT_DIR=$(ls -dt result/* |head -n 1) + - echo "$OUTPUT_RESULT_DIR" artifacts: paths: - - result/ + - "$OUTPUT_RESULT_DIR" cache: key: ${CI_PROJECT_ID} -- GitLab From 3b9dd8abd619a0d4f4e4173982d058142e742c51 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Tue, 1 Dec 2020 15:42:26 +0000 Subject: [PATCH 81/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a114c9e96..305b9236be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,11 +17,9 @@ test: - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) - mkdir result - cp --recursive "$resultDirectory" result/ - - OUTPUT_RESULT_DIR=$(ls -dt result/* |head -n 1) - - echo "$OUTPUT_RESULT_DIR" artifacts: paths: - - "$OUTPUT_RESULT_DIR" + - result/ cache: key: ${CI_PROJECT_ID} -- GitLab From 808cb873815322fa6d67e12f983d938989a4412f Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Thu, 3 Dec 2020 14:42:56 +0000 Subject: [PATCH 82/96] add a mockup test result --- test_result_mockup.xml | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test_result_mockup.xml diff --git a/test_result_mockup.xml b/test_result_mockup.xml new file mode 100644 index 0000000000..bbb99fedaf --- /dev/null +++ b/test_result_mockup.xml @@ -0,0 +1,45 @@ + + + + + androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'has child: with text: is "Calendar"' doesn't match the selected view. +Expected: has child: with text: is "Calendar" + Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" + + at dalvik.system.VMStack.getThreadStackTrace(Native Method) + at java.lang.Thread.getStackTrace(Thread.java:1566) + at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:96) + at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59) + at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:324) + at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:306) + at foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest.searchCalendarAppTest(LauncherActivityUiTest.java:115) + at java.lang.reflect.Method.invoke(Native Method) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) + at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) + at java.util.concurrent.FutureTask.run(FutureTask.java:237) + at java.lang.Thread.run(Thread.java:761) +Caused by: junit.framework.AssertionFailedError: 'has child: with text: is "Calendar"' doesn't match the selected view. +Expected: has child: with text: is "Calendar" + Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" + + at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:540) + at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:105) + at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:425) + at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:288) + at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:272) + at java.util.concurrent.FutureTask.run(FutureTask.java:237) + at android.os.Handler.handleCallback(Handler.java:751) + at android.os.Handler.dispatchMessage(Handler.java:95) + at android.os.Looper.loop(Looper.java:154) + at android.app.ActivityThread.main(ActivityThread.java:6186) + at java.lang.reflect.Method.invoke(Native Method) + at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) + at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) + + + + \ No newline at end of file -- GitLab From 69d9c429d60bf5097bd679b6b49a30a3ed14c632 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Thu, 3 Dec 2020 14:47:02 +0000 Subject: [PATCH 83/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 305b9236be..b2f1ce3ba7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,8 @@ test: artifacts: paths: - result/ + reports: + junit: test_result_mockup.xml cache: key: ${CI_PROJECT_ID} -- GitLab From 1ea22bc2abf0e52228671d5dfa35f8b40f1c6a9a Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Thu, 3 Dec 2020 15:11:59 +0000 Subject: [PATCH 84/96] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2f1ce3ba7..6b945373e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,7 @@ test: artifacts: paths: - result/ + - test_result_mockup.xml reports: junit: test_result_mockup.xml -- GitLab From b33b123745ba0ac5c84b4b7f6ec621a8a58e2bf0 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:03:01 +0000 Subject: [PATCH 85/96] Delete test_result_mockup.xml --- test_result_mockup.xml | 45 ------------------------------------------ 1 file changed, 45 deletions(-) delete mode 100644 test_result_mockup.xml diff --git a/test_result_mockup.xml b/test_result_mockup.xml deleted file mode 100644 index bbb99fedaf..0000000000 --- a/test_result_mockup.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'has child: with text: is "Calendar"' doesn't match the selected view. -Expected: has child: with text: is "Calendar" - Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" - - at dalvik.system.VMStack.getThreadStackTrace(Native Method) - at java.lang.Thread.getStackTrace(Thread.java:1566) - at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:96) - at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59) - at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:324) - at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:306) - at foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest.searchCalendarAppTest(LauncherActivityUiTest.java:115) - at java.lang.reflect.Method.invoke(Native Method) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) - at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) - at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) - at java.util.concurrent.FutureTask.run(FutureTask.java:237) - at java.lang.Thread.run(Thread.java:761) -Caused by: junit.framework.AssertionFailedError: 'has child: with text: is "Calendar"' doesn't match the selected view. -Expected: has child: with text: is "Calendar" - Got: "GridLayout{id=2131296449, res-name=suggestedAppGrid, visibility=VISIBLE, width=1384, height=410, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@504a538, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}" - - at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:540) - at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:105) - at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:425) - at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:288) - at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:272) - at java.util.concurrent.FutureTask.run(FutureTask.java:237) - at android.os.Handler.handleCallback(Handler.java:751) - at android.os.Handler.dispatchMessage(Handler.java:95) - at android.os.Looper.loop(Looper.java:154) - at android.app.ActivityThread.main(ActivityThread.java:6186) - at java.lang.reflect.Method.invoke(Native Method) - at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) - at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) - - - - \ No newline at end of file -- GitLab From 1e830fb5d7f4534fa3b1a8549058a2668d0e4091 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:13:54 +0000 Subject: [PATCH 86/96] Remove test jobs in .gitlab-ci.yml --- .gitlab-ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b945373e8..a906e2d705 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,28 +2,11 @@ image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest stages: - build -- test before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew -test: - stage: test - tags: - - rpi-vb - script: - - /home/pi/Desktop/linux-x86/framework/tradefed.sh run commandAndExit instrument --package "foundation.e.blisslauncher.debug.test" --class "foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest" --runner "androidx.test.runner.AndroidJUnitRunner" --install-file "app/build/outputs/apk/androidTest/apiNougat/debug/app-apiNougat-debug-androidTest.apk" - - resultDirectory=$(ls -dt /tmp/0/stub/* |head -n 1) - - mkdir result - - cp --recursive "$resultDirectory" result/ - artifacts: - paths: - - result/ - - test_result_mockup.xml - reports: - junit: test_result_mockup.xml - cache: key: ${CI_PROJECT_ID} paths: -- GitLab From 3d6c5934f65ecba5d030d78c43d48753c500c2f6 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:46:48 +0000 Subject: [PATCH 87/96] Add BlissLauncherTestSuite --- .../e/blisslauncher/BlissLauncherTestSuite.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java new file mode 100644 index 0000000000..ecf7326d89 --- /dev/null +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -0,0 +1,9 @@ + @RunWith(Suite::class + @Suite.Classes( + /* Here list all you tests classes that are part of the suite + * eg: + * mainActivityTest::class, * secondActivityTest::class, + * serviceTest::class + */ + ) + class BlissLauncherTestSuite -- GitLab From 55dcea6b1b1911749c0f83e13bb458767bc20a30 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 11 Jan 2021 14:54:52 +0000 Subject: [PATCH 88/96] add import & package lines. Add LauncherActivityUiTest as test to run in BlissLauncherTestSuite.java --- .../blisslauncher/BlissLauncherTestSuite.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index ecf7326d89..2e70ee6fa0 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -1,9 +1,17 @@ - @RunWith(Suite::class - @Suite.Classes( - /* Here list all you tests classes that are part of the suite - * eg: - * mainActivityTest::class, * secondActivityTest::class, - * serviceTest::class - */ - ) - class BlissLauncherTestSuite +package foundation.e.blisslauncher; + + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import foundation.e.blisslauncher.features.launcher; + +@RunWith(Suite::class +@Suite.Classes( +/* Here list all you tests classes that are part of the suite +* eg: +* mainActivityTest::class, * secondActivityTest::class, +* serviceTest::class +*/ + LauncherActivityUiTest::class +) +class BlissLauncherTestSuite -- GitLab From c60faf25cd00f77a517406c8ff72ddf6efd99c91 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 16:03:33 +0100 Subject: [PATCH 89/96] add comment --- .../blisslauncher/features/launcher/LauncherActivityUiTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 5908d62bda..33e8b712a2 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -28,7 +28,7 @@ import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.not; - +//instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner @RunWith(AndroidJUnit4ClassRunner.class) -- GitLab From e364a502331916e0144dec33f23b90ab2b3adec1 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 16:10:11 +0100 Subject: [PATCH 90/96] remove import --- .../java/foundation/e/blisslauncher/BlissLauncherTestSuite.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index 2e70ee6fa0..8557c7018a 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -3,7 +3,6 @@ package foundation.e.blisslauncher; import org.junit.runner.RunWith; import org.junit.runners.Suite; -import foundation.e.blisslauncher.features.launcher; @RunWith(Suite::class @Suite.Classes( -- GitLab From 028b1504ba681f1c6703291d1f9897ec0a37bfbc Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 16:31:48 +0100 Subject: [PATCH 91/96] update BlissLauncherTestSuite.java --- .../e/blisslauncher/BlissLauncherTestSuite.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index 8557c7018a..a879a3232a 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -1,11 +1,13 @@ package foundation.e.blisslauncher; - import org.junit.runner.RunWith; import org.junit.runners.Suite; -@RunWith(Suite::class -@Suite.Classes( + +import foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest; + +@RunWith(Suite::class) +@Suite.SuiteClasses( /* Here list all you tests classes that are part of the suite * eg: * mainActivityTest::class, * secondActivityTest::class, -- GitLab From fef9fe5e680e9a6885a87704dfa803b82aa5d4d4 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Jan 2021 17:17:59 +0100 Subject: [PATCH 92/96] fix issue with BlissLauncherTestSuite.java --- .../blisslauncher/BlissLauncherTestSuite.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java index a879a3232a..4abe0f2c63 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/BlissLauncherTestSuite.java @@ -6,13 +6,16 @@ import org.junit.runners.Suite; import foundation.e.blisslauncher.features.launcher.LauncherActivityUiTest; -@RunWith(Suite::class) -@Suite.SuiteClasses( +@RunWith(Suite.class) /* Here list all you tests classes that are part of the suite -* eg: -* mainActivityTest::class, * secondActivityTest::class, -* serviceTest::class -*/ - LauncherActivityUiTest::class + * eg: + * mainActivityTest.class, + * secondActivityTest.class, + * serviceTest.class + */ +@Suite.SuiteClasses( + LauncherActivityUiTest.class ) -class BlissLauncherTestSuite +public class BlissLauncherTestSuite{ + +} -- GitLab From 2dec8a8d2f4fd41b38caea201de28f1f2a24ee6e Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 12 Jan 2021 17:25:55 +0100 Subject: [PATCH 93/96] tried to fix second test. failure --- .../launcher/LauncherActivityUiTest.java | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 33e8b712a2..312850db9b 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -1,14 +1,20 @@ package foundation.e.blisslauncher.features.launcher; +import android.view.View; + +import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; +import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.rule.ActivityTestRule; +import androidx.test.uiautomator.UiAutomatorInstrumentationTestRunner; import androidx.test.uiautomator.UiDevice; import org.hamcrest.Matcher; +import org.hamcrest.core.IsInstanceOf; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -74,11 +80,21 @@ public class LauncherActivityUiTest { device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + + + //Swipe on the main view to display the left panel onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); final Matcher notChildOfSwipeSearchContainer = not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ); final Matcher searchInputMatcher = allOf(withId(R.id.search_input), notChildOfSwipeSearchContainer ); + + //Check there is 4 app suggested + final ViewInteraction appGrid = onView(allOf(withId(R.id.suggestedAppGrid), withParent(withParent(withId(R.id.used_apps_layout) ) ), isDisplayed() ) ); + appGrid.check(matches(hasChildCount(4))); + + + //Click on "search input bar" final ViewInteraction editText = onView(searchInputMatcher); editText.perform(ViewActions.click()); @@ -109,10 +125,32 @@ public class LauncherActivityUiTest { //Check calendar is the only displayed in suggested app - final ViewInteraction appGrid = onView(allOf(withId(R.id.suggestedAppGrid), hasMinimumChildCount(1) ) ); + appGrid.check(matches(withChild(hasChildCount(1)))); //DOESN't WORK + + + /* + final ViewInteraction appIcon = onView( allOf( + withId(R.id.icon_calendar), + isDisplayed() + ) + ); + + + + appIcon.check(matches(allOf( withChild( withId(R.id.calendar_month_textview)), + withChild( withId(R.id.calendar_date_textview)))));*/ + + final ViewInteraction appLabel = onView( + allOf( + withId( R.id.app_label), + withText(Calendar_app_name), + withParent( + withParent(IsInstanceOf.instanceOf(android.widget.FrameLayout.class) ) + ) + ) ) ; + + appLabel.check(matches(withText(Calendar_app_name))); - //This test fails because it doesn't find the label under the icon... - appGrid.check(matches(withChild(withText(Calendar_app_name)))); } -- GitLab From 7238d118ae7c0caf2cd5c18a4b0427ce2a2ceba6 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 13 Jan 2021 16:19:31 +0100 Subject: [PATCH 94/96] fix second test of BlissLauncher --- .../launcher/LauncherActivityUiTest.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 312850db9b..0edf4ebc79 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -3,6 +3,7 @@ package foundation.e.blisslauncher.features.launcher; import android.view.View; +import androidx.test.espresso.DataInteraction; import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; @@ -23,6 +24,9 @@ import org.junit.runner.RunWith; import java.io.IOException; import foundation.e.blisslauncher.R; + +import static androidx.test.espresso.Espresso.closeSoftKeyboard; +import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.*; import static androidx.test.espresso.matcher.ViewMatchers.*; @@ -74,6 +78,10 @@ public class LauncherActivityUiTest { onView(withId(R.id.weather_info_layout)).check(matches(isDisplayed())); } + /** + * This test requires Calendar App to be installed on the device + * @throws Exception + */ @Test public void searchCalendarAppTest() throws Exception{ final String Calendar_app_name = "Calendar"; @@ -119,39 +127,35 @@ public class LauncherActivityUiTest { editText.check(matches(withText(Calendar_app_name))); + //check the clear button is present onView(allOf(withId(R.id.clearSuggestionImageView), notChildOfSwipeSearchContainer) ) .check(matches( not(withEffectiveVisibility(Visibility.GONE)))); - //Check calendar is the only displayed in suggested app - appGrid.check(matches(withChild(hasChildCount(1)))); //DOESN't WORK + //close soft keyboard + closeSoftKeyboard(); + Thread.sleep(5000); //required to wait for update of UI - /* - final ViewInteraction appIcon = onView( allOf( - withId(R.id.icon_calendar), - isDisplayed() - ) - ); + //Check that there is only one app show in grid + final ViewInteraction appGrid2 = onView(allOf(withId(R.id.suggestedAppGrid), withParent(withParent(withId(R.id.used_apps_layout) ) ), isDisplayed() ) ); + appGrid2.check(matches(hasChildCount(1))); //DOESN't WORK - appIcon.check(matches(allOf( withChild( withId(R.id.calendar_month_textview)), - withChild( withId(R.id.calendar_date_textview)))));*/ + // Check that Calendar icon is clickable final ViewInteraction appLabel = onView( allOf( withId( R.id.app_label), withText(Calendar_app_name), withParent( withParent(IsInstanceOf.instanceOf(android.widget.FrameLayout.class) ) - ) + ), isDisplayed() ) ) ; - appLabel.check(matches(withText(Calendar_app_name))); - - + appLabel.check(matches(withParent(withChild(allOf(withId(R.id.app_icon), isClickable()))))); } } -- GitLab From 00b4eab29f12b8f9a77c86156531a6270c4e0366 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 13 Jan 2021 16:27:00 +0100 Subject: [PATCH 95/96] remove useless import in LauncherActivityUiTest.java --- .../features/launcher/LauncherActivityUiTest.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java index 0edf4ebc79..a0985bf07c 100644 --- a/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java +++ b/app/src/androidTest/java/foundation/e/blisslauncher/features/launcher/LauncherActivityUiTest.java @@ -3,15 +3,11 @@ package foundation.e.blisslauncher.features.launcher; import android.view.View; -import androidx.test.espresso.DataInteraction; -import androidx.test.espresso.ViewAssertion; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; -import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.rule.ActivityTestRule; -import androidx.test.uiautomator.UiAutomatorInstrumentationTestRunner; import androidx.test.uiautomator.UiDevice; import org.hamcrest.Matcher; @@ -20,13 +16,10 @@ import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; - import java.io.IOException; - import foundation.e.blisslauncher.R; import static androidx.test.espresso.Espresso.closeSoftKeyboard; -import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.assertion.ViewAssertions.*; import static androidx.test.espresso.matcher.ViewMatchers.*; @@ -38,6 +31,8 @@ import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.not; + + //instrument --package foundation.e.blisslauncher.features.launcher --class LauncherActivityUiTest --runner @@ -88,9 +83,6 @@ public class LauncherActivityUiTest { device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); - - - //Swipe on the main view to display the left panel onView(withId(R.id.appGrid)).perform(ViewActions.swipeRight()); final Matcher notChildOfSwipeSearchContainer = not( withParent( withParent( withParent( withId(R.id.swipe_search_container ) ) ) ) ); -- GitLab From 27ec3f47ee8a74154fa21f1e2ac0a93725229942 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Mon, 18 Jan 2021 14:43:29 +0000 Subject: [PATCH 96/96] make androidTest build to be release and not debug --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 45f5115722..82218632e3 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 versionName "${versionMajor}.${versionMinor}.${versionPatch}" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - testBuildType System.getProperty('testBuildType', 'debug') + testBuildType System.getProperty('testBuildType', 'release') renderscriptTargetApi 28 renderscriptSupportModeEnabled true } -- GitLab