Skip to content

Commit

Permalink
Release 1.6.2 (#141)
Browse files Browse the repository at this point in the history
* update Bouncer SDK (#132)

* Release scan lib v1.0.3 (#135)

* Firebase Test Lab Integration (#84)

* Update HTTPMethod.kt (#133)

* Fix custom fonts (#136)

* Implement ability to add collect data in collections (#138)

* Add FlatMap implementation

* Add deepMerge logic implementation

* Refactor

* Add map tests

* Add array list tests

* Update VGSRequest.kt, add VGSCollectFieldNameMappingPolicy.kt, update tests, improve deep merge logic

* Fix tests

* Implement new logic

* Fix tests

* Improve array deepMerge logic

* Update comments

* Update comments

* Add analytics

* Update visibility modifier

* Update release script (Maven) (#140)

* Update cardio distribution flow (switch to maven)

* Revert "Update cardio distribution flow (switch to maven)"

This reverts commit e94700e

* Revert "Update cardio distribution flow (switch to maven)"

Update release script, add possibility to release on maven

* Version name & code rise

* Update docs

* Fix UI tests

* Fix UI tests

* Fix UI tests

* Remove incorrect step

* Add start screen wait

* Update docs

* Update device list

* Remove broken device

Co-authored-by: Dmytro Kos <dmitriy.kosolapenko@vgs.io>
  • Loading branch information
DmytroDm and Dmytro Kos authored Mar 22, 2021
1 parent e98f2e8 commit 64e9691
Show file tree
Hide file tree
Showing 201 changed files with 2,738 additions and 1,951 deletions.
170 changes: 65 additions & 105 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,118 +1,78 @@
version: 2.1
aliases:
- &restore_gem_cache
name: Restore cache
keys:
- jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

- &save_gem_cache
name: Saving cache
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
paths:
- ~/.gradle

- &attach_workspace
attach_workspace:
at: ~/code

- &download_dep
- checkout
- *attach_workspace
- run:
name: Download Dependencies
command: |
sudo chmod +x gradlew
./gradlew androidDependencies
- &run_lint
- checkout
- *attach_workspace
- restore_cache: *restore_gem_cache
- run:
name: Run Lint
command: ./gradlew lintDebug
- save_cache: *save_gem_cache

- &run_unit_tests
- checkout
- *attach_workspace
- run:
name: Run Unit Tests
command: ./gradlew testDebugUnitTest



- &assembleDebug
- checkout
- *attach_workspace
- run:
name: Build Debug
command: ./gradlew assembleDebug
- store_artifacts:
path: app/build/outputs/apk/debug/app-debug.apk
destination: app-debug.apk



- &deploy_environment
working_directory: ~/code
docker:
- image: circleci/android:api-29
- &test_environment
aliases:
- &environment
working_directory: ~/code
docker:
- image: circleci/android:api-29


# dependency groups
- &prepare_sources
- "Prepared_Sources"

- &all_test
- "Run_Lint"
- "Run_Unit_Tests"

- &debug_build
- "Assemble_Debug_Build"

jobs:
"Prepared_Sources":
<<: *test_environment
environment:
JVM_OPTS: -Xmx3200m
steps: *download_dep

"Run_Lint":
<<: *test_environment
environment:
JVM_OPTS: -Xmx3200m
steps: *run_lint

"Run_Unit_Tests":
<<: *test_environment
environment:
JVM_OPTS: -Xmx3200m
steps: *run_unit_tests

"Assemble_Debug_Build":
<<: *test_environment
environment:
JVM_OPTS: -Xmx3200m
steps: *assembleDebug


jobs:
"Run_Unit_Test_And_Build":
<<: *environment
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: |
sudo chmod +x gradlew
./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run Lint
command: ./gradlew lintDebug
- run:
name: Run Unit tests
command: ./gradlew testDebugUnitTest
- run:
name: Generate apk
command: ./gradlew assembleDebug assembleAndroidTest
- persist_to_workspace:
root: ~/code
paths:
- app
"Run_UI_Test":
<<: *environment
steps:
- attach_workspace:
at: ~/code
- run:
name: Check if release branch
command: |
if [[ $CIRCLE_BRANCH != *"release/"* ]] && [ $CIRCLE_BRANCH != master* ]; then
echo "Skipped, reason: UI tests should be running only on release branches or master!"
circleci-agent step halt
fi
- run:
name: Store Google Service Account
command: echo $GCLOUD_SERVICE_KEY | base64 -di > ${HOME}/gcloud-service-key.json
- run:
name: Authorize gcloud and set config defaults
command: |
sudo gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
sudo gcloud --quiet config set project ${GOOGLE_PROJECT_ID}
- run:
name: Test with Firebase Test Lab
command: >
sudo gcloud firebase test android run \
--app app/build/outputs/apk/debug/app-debug.apk \
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device model=lv0,version=23,locale=en,orientation=portrait \
--device model=capricorn,version=26,locale=en,orientation=portrait \
--device model=tissot_sprout,version=28,locale=en,orientation=portrait \
--device model=x1q,version=29,locale=en,orientation=portrait \
--device model=flame,version=30,locale=en,orientation=portrait \
workflows:
version: 2.1
main:
jobs:
- "Prepared_Sources"
- "Run_Lint":
requires:
*prepare_sources
- "Run_Unit_Tests":
requires:
*prepare_sources
- "Assemble_Debug_Build":
- "Run_Unit_Test_And_Build"
- "Run_UI_Test":
requires:
*all_test
- "Run_Unit_Test_And_Build"
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 30
Expand Down Expand Up @@ -71,6 +72,9 @@ def getLocalProperty(String propName) {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:26.3.0')
implementation 'com.google.firebase:firebase-analytics-ktx'

implementation "androidx.appcompat:appcompat:$android_support_libraries"
implementation "com.google.android.material:material:1.2.1"

Expand Down
68 changes: 68 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"project_info": {
"project_number": "562744519177",
"project_id": "vgs-collect-show-mobile",
"storage_bucket": "vgs-collect-show-mobile.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:562744519177:android:f50d3502b71e788998e6d8",
"android_client_info": {
"package_name": "com.verygoodsecurity.demoapp"
}
},
"oauth_client": [
{
"client_id": "562744519177-nkkq796tgp357quqmi6cut67c3dn1s15.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDKfiuIW17Ojt6iX0FfOfElOV7p31rbYQY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "562744519177-nkkq796tgp357quqmi6cut67c3dn1s15.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:562744519177:android:6f3805cf56e8606498e6d8",
"android_client_info": {
"package_name": "com.verygoodsecurity.demoshow"
}
},
"oauth_client": [
{
"client_id": "562744519177-nkkq796tgp357quqmi6cut67c3dn1s15.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDKfiuIW17Ojt6iX0FfOfElOV7p31rbYQY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "562744519177-nkkq796tgp357quqmi6cut67c3dn1s15.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import android.app.Instrumentation.ActivityResult
import android.content.Intent
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents.*
import androidx.test.espresso.intent.matcher.IntentMatchers.*
Expand Down Expand Up @@ -43,7 +43,7 @@ class ActivityCaseInstrumentedTest {
const val CARD_HOLDER= "Gohn G"

const val CARD_EXP_DATE_WRONG = "22/2222"
const val CARD_EXP_DATE= "02/2023"
const val CARD_EXP_DATE= "02/25"

const val CARD_CVC_WRONG = "12"
const val CARD_CVC= "123"
Expand Down Expand Up @@ -174,13 +174,17 @@ class ActivityCaseInstrumentedTest {

private fun interactWithResponseContainer(): ViewInteraction {
return onView(withId(R.id.responseContainerView))
.perform(scrollTo())
.check(matches(isDisplayed()))
}

private fun startMainScreen() {
val startWithActivityBtn = onView(withId(R.id.startWithActivityBtn))
.check(matches(isDisplayed()))

onView(withId(R.id.userVault)).perform(typeText(Utils.DEFAULT_TENANT_ID), closeSoftKeyboard())
onView(withId(R.id.userPath)).perform(typeText(Utils.DEFAULT_PATH), closeSoftKeyboard())

performClick(startWithActivityBtn)
}

Expand Down Expand Up @@ -222,6 +226,7 @@ class ActivityCaseInstrumentedTest {

private fun interactWithSubmitButton(): ViewInteraction {
return onView(withId(R.id.submitBtn))
.perform(scrollTo())
.check(matches(isDisplayed()))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import android.app.Instrumentation
import android.content.Intent
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents.*
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
Expand Down Expand Up @@ -135,6 +135,7 @@ class FragmentCaseInstrumentedTest {
cardCVCInputField.check(matches(withCardCVCState(CARD_CVC)))


submitBtn.perform(scrollTo())
performClick(submitBtn)

pauseTestFor(7000)
Expand Down Expand Up @@ -165,7 +166,6 @@ class FragmentCaseInstrumentedTest {
bin = CARD_NUMBER_WRONG_BIN_CHECK
)))
cardHolderNameInputField.check(matches(withCardHolderState(CARD_HOLDER)))
cardExpDateInputField.check(matches(withCardExpDateState("09")))
cardCVCInputField.check(matches(withCardCVCState(CARD_CVC_WRONG)))

performClick(submitBtn)
Expand Down Expand Up @@ -203,13 +203,17 @@ class FragmentCaseInstrumentedTest {

private fun interactWithResponseContainer(): ViewInteraction {
return onView(withId(R.id.responseContainerView))
.perform(scrollTo())
.check(matches(isDisplayed()))
}

private fun startMainScreen() {
val startWithActivityBtn = onView(withId(R.id.startWithFragmentBtn))
.check(matches(isDisplayed()))

onView(withId(R.id.userVault)).perform(typeText(Utils.DEFAULT_TENANT_ID))
onView(withId(R.id.userPath)).perform(typeText(Utils.DEFAULT_PATH), closeSoftKeyboard())

startWithActivityBtn.perform(click())
}

Expand Down Expand Up @@ -242,7 +246,9 @@ class FragmentCaseInstrumentedTest {
}

private fun interactWithSubmitButton(): ViewInteraction {
return onView(withId(R.id.submitBtn)).check(matches(isDisplayed()))
return onView(withId(R.id.submitBtn))
.perform(scrollTo())
.check(matches(isDisplayed()))
}

private fun performClick(interaction: ViewInteraction) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.verygoodsecurity.demoapp

object Utils {

const val DEFAULT_TENANT_ID = "tntpszqgikn"
const val DEFAULT_PATH = "/post"
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class VGSCollectActivity: AppCompatActivity(), VgsCollectResponseListener, View.

private fun setupCardHolderField() {
val rule : PersonNameRule = PersonNameRule.ValidationBuilder()
// .setRegex("^([a-zA-Z]{2,}\\s[a-zA-z]{1,})\$")
.setAllowableMinLength(3)
.setAllowableMaxLength(7)
.build()
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ buildscript {

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath 'com.google.gms:google-services:4.3.4'
}
}

Expand Down
Loading

0 comments on commit 64e9691

Please sign in to comment.