mirror of
https://github.com/TanelOrumaa/Estonian-ID-card-mobile-authenticator-POC.git
synced 2025-08-30 07:10:59 +03:00
Compare commits
1 Commits
Tests
...
iteration4
Author | SHA1 | Date | |
---|---|---|---|
|
b565f6846d |
@@ -44,9 +44,7 @@ dependencies {
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test:rules:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
debugImplementation 'androidx.fragment:fragment-testing:1.4.0'
|
||||
|
||||
//To use activityViewModels
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
@@ -1,30 +0,0 @@
|
||||
package com.tarkvaraprojekt.mobileauthapp
|
||||
|
||||
//import androidx.fragment.app.testing.launchFragmentInContainer
|
||||
import androidx.test.espresso.IdlingPolicies
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.rule.ActivityTestRule
|
||||
|
||||
import org.junit.*
|
||||
import org.junit.runner.RunWith
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
open class BaseUCTest {
|
||||
@get:Rule
|
||||
var activityActivityTestRule: ActivityTestRule<MainActivity> = ActivityTestRule(
|
||||
MainActivity::class.java
|
||||
)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
IdlingPolicies.setMasterPolicyTimeout(3, TimeUnit.SECONDS)
|
||||
IdlingPolicies.setIdlingResourceTimeout(3, TimeUnit.SECONDS)
|
||||
activityActivityTestRule.activity
|
||||
.supportFragmentManager.beginTransaction()
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
package com.tarkvaraprojekt.mobileauthapp
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.NoMatchingViewException
|
||||
import androidx.test.espresso.action.ViewActions.*
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.*
|
||||
|
||||
import org.junit.*
|
||||
|
||||
class UC12Test : BaseUCTest() {
|
||||
|
||||
private fun navigateToPINView() {
|
||||
onView(withId(R.id.menu_settings_option)).perform(click())
|
||||
try {
|
||||
// Delete existing PIN
|
||||
onView(withText(R.string.pin1_delete)).perform(click())
|
||||
} catch (ignore: NoMatchingViewException) {}
|
||||
|
||||
onView(withId(R.id.pin_menu_action)).perform(click())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validPIN() {
|
||||
navigateToPINView()
|
||||
onView(withText(R.string.pin_helper_text)).check(matches(isDisplayed()))
|
||||
onView(supportsInputMethods()).perform(typeText("0000"))
|
||||
onView(withText(R.string.continue_button)).perform(click())
|
||||
|
||||
onView(withText(R.string.pin_status_saved)).check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun tooShortPIN() {
|
||||
navigateToPINView()
|
||||
onView(supportsInputMethods()).perform(typeText("000"))
|
||||
onView(withText(R.string.continue_button)).perform(click())
|
||||
|
||||
onView(withText(R.string.pin_helper_text)).check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun tooLongPIN() {
|
||||
navigateToPINView()
|
||||
onView(supportsInputMethods()).perform(typeText("0".repeat(13)))
|
||||
onView(withText(R.string.continue_button)).perform(click())
|
||||
|
||||
onView(withText(R.string.pin_helper_text)).check(matches(isDisplayed()))
|
||||
}
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package com.tarkvaraprojekt.mobileauthapp
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.NoMatchingViewException
|
||||
import androidx.test.espresso.action.ViewActions.*
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.*
|
||||
|
||||
import org.junit.*
|
||||
|
||||
class UC4Test : BaseUCTest() {
|
||||
|
||||
private fun navigateToCANView() {
|
||||
onView(withId(R.id.menu_settings_option)).perform(click())
|
||||
try {
|
||||
// Delete existing CAN
|
||||
onView(withText(R.string.can_delete)).perform(click())
|
||||
} catch (ignore: NoMatchingViewException) {}
|
||||
|
||||
onView(withId(R.id.can_menu_action)).perform(click())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun validCAN() {
|
||||
navigateToCANView()
|
||||
onView(withText(R.string.can_helper_text)).check(matches(isDisplayed()))
|
||||
onView(supportsInputMethods()).perform(typeText("123456"))
|
||||
onView(withText(R.string.can_delete)).perform(closeSoftKeyboard())
|
||||
|
||||
onView(withText(R.string.can_status_saved)).check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun invalidCAN() {
|
||||
navigateToCANView()
|
||||
onView(supportsInputMethods()).perform(typeText("12345"))
|
||||
onView(withText(R.string.can_helper_text)).check(matches(isDisplayed()))
|
||||
}
|
||||
}
|
1
demoBackend/src/demo-website/dist/css/app.eb039c1f.css
vendored
Normal file
1
demoBackend/src/demo-website/dist/css/app.eb039c1f.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}#nav{padding:30px}#nav a{font-weight:700;color:#2c3e50}#nav a.router-link-exact-active{color:#42b983}.container>div[data-v-2dcb24ca]{margin-top:2vh}.loginButton[data-v-2dcb24ca]{height:4vh;width:20vh;line-height:3vh}.loginButton>p[data-v-2dcb24ca]{font-size:3vh;text-align:center}#canvas[data-v-2dcb24ca]{height:30vh;width:30vh}nav[data-v-21165a6a]{height:5vh}div[data-v-cd8fea1a]{margin-top:2vh}
|
7
demoBackend/src/demo-website/dist/css/chunk-vendors.a251e031.css
vendored
Normal file
7
demoBackend/src/demo-website/dist/css/chunk-vendors.a251e031.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
demoBackend/src/demo-website/dist/favicon.ico
vendored
Normal file
BIN
demoBackend/src/demo-website/dist/favicon.ico
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
1
demoBackend/src/demo-website/dist/index.html
vendored
Normal file
1
demoBackend/src/demo-website/dist/index.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>demo-website</title><link href="/css/app.eb039c1f.css" rel="preload" as="style"><link href="/css/chunk-vendors.a251e031.css" rel="preload" as="style"><link href="/js/app.c2a68e49.js" rel="preload" as="script"><link href="/js/chunk-vendors.22b03028.js" rel="preload" as="script"><link href="/css/chunk-vendors.a251e031.css" rel="stylesheet"><link href="/css/app.eb039c1f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but demo-website doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.22b03028.js"></script><script src="/js/app.c2a68e49.js"></script></body></html>
|
4
demoBackend/src/demo-website/dist/js/app.c2a68e49.js
vendored
Normal file
4
demoBackend/src/demo-website/dist/js/app.c2a68e49.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
demoBackend/src/demo-website/dist/js/app.c2a68e49.js.map
vendored
Normal file
1
demoBackend/src/demo-website/dist/js/app.c2a68e49.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
27
demoBackend/src/demo-website/dist/js/chunk-vendors.22b03028.js
vendored
Normal file
27
demoBackend/src/demo-website/dist/js/chunk-vendors.22b03028.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
demoBackend/src/demo-website/dist/js/chunk-vendors.22b03028.js.map
vendored
Normal file
1
demoBackend/src/demo-website/dist/js/chunk-vendors.22b03028.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user