proto error
This commit is contained in:
parent
522ecae87a
commit
74526bc984
6 changed files with 80 additions and 14 deletions
26
.idea/androidTestResultsUserPreferences.xml
generated
26
.idea/androidTestResultsUserPreferences.xml
generated
|
@ -16,6 +16,19 @@
|
||||||
</AndroidTestResultsTableState>
|
</AndroidTestResultsTableState>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry key="-1481613533">
|
||||||
|
<value>
|
||||||
|
<AndroidTestResultsTableState>
|
||||||
|
<option name="preferredColumnWidths">
|
||||||
|
<map>
|
||||||
|
<entry key="Duration" value="90" />
|
||||||
|
<entry key="Pixel_XL_API_30" value="120" />
|
||||||
|
<entry key="Tests" value="360" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</AndroidTestResultsTableState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
<entry key="-1331863396">
|
<entry key="-1331863396">
|
||||||
<value>
|
<value>
|
||||||
<AndroidTestResultsTableState>
|
<AndroidTestResultsTableState>
|
||||||
|
@ -44,6 +57,19 @@
|
||||||
</AndroidTestResultsTableState>
|
</AndroidTestResultsTableState>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry key="1663472220">
|
||||||
|
<value>
|
||||||
|
<AndroidTestResultsTableState>
|
||||||
|
<option name="preferredColumnWidths">
|
||||||
|
<map>
|
||||||
|
<entry key="Duration" value="90" />
|
||||||
|
<entry key="Pixel_XL_API_30" value="120" />
|
||||||
|
<entry key="Tests" value="360" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</AndroidTestResultsTableState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -65,8 +65,6 @@ dependencies {
|
||||||
implementation "androidx.compose.ui:ui:$compose_version"
|
implementation "androidx.compose.ui:ui:$compose_version"
|
||||||
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
|
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
|
||||||
implementation 'androidx.compose.material:material:1.2.0'
|
implementation 'androidx.compose.material:material:1.2.0'
|
||||||
implementation 'androidx.test.ext:junit-ktx:1.1.5'
|
|
||||||
implementation 'androidx.navigation:navigation-testing:2.5.3'
|
|
||||||
|
|
||||||
|
|
||||||
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
|
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
|
||||||
|
@ -98,17 +96,13 @@ dependencies {
|
||||||
|
|
||||||
// JUnit
|
// JUnit
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
|
||||||
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
|
|
||||||
|
|
||||||
// Coroutine testing
|
// Coroutine testing
|
||||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
|
||||||
|
|
||||||
// Mocking
|
// Mocking
|
||||||
testImplementation 'org.mockito.kotlin:mockito-kotlin:3.2.0'
|
testImplementation 'org.mockito.kotlin:mockito-kotlin:3.2.0'
|
||||||
androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline:2.28.1'
|
|
||||||
androidTestImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
|
|
||||||
|
|
||||||
// Networking
|
// Networking
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
|
@ -117,6 +111,8 @@ dependencies {
|
||||||
testImplementation 'androidx.arch.core:core-testing:2.1.0'
|
testImplementation 'androidx.arch.core:core-testing:2.1.0'
|
||||||
|
|
||||||
// GUI testing
|
// GUI testing
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||||
|
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
|
||||||
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
|
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
|
||||||
|
|
||||||
//Firebase
|
//Firebase
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package be.ugent.sel.studeez
|
||||||
|
|
||||||
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
|
import androidx.compose.ui.test.onNodeWithText
|
||||||
|
import androidx.compose.ui.test.performClick
|
||||||
|
import be.ugent.sel.studeez.common.composable.drawer.DrawerActions
|
||||||
|
import be.ugent.sel.studeez.common.composable.feed.FeedUiState
|
||||||
|
import be.ugent.sel.studeez.common.composable.navbar.NavigationBarActions
|
||||||
|
import be.ugent.sel.studeez.data.local.models.FeedEntry
|
||||||
|
import be.ugent.sel.studeez.screens.home.HomeScreen
|
||||||
|
import org.junit.Rule
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class HomeScreenTest {
|
||||||
|
@get:Rule
|
||||||
|
val composeTestRule = createComposeRule()
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun sessionRecapTestt() {
|
||||||
|
var saveCalled = false
|
||||||
|
|
||||||
|
composeTestRule.setContent {
|
||||||
|
HomeScreen(
|
||||||
|
open = {},
|
||||||
|
drawerActions = DrawerActions({}, {}, {}, {}, {}),
|
||||||
|
navigationBarActions = NavigationBarActions({false}, {}, {}, {}, {}, {}, {}, {}),
|
||||||
|
feedUiState = FeedUiState.Succes(mapOf()),
|
||||||
|
continueTask = {_, _ -> },
|
||||||
|
onEmptyFeedHelp = {}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
composeTestRule
|
||||||
|
.onNodeWithText(
|
||||||
|
"continue",
|
||||||
|
substring = true,
|
||||||
|
ignoreCase = true
|
||||||
|
)
|
||||||
|
.assertExists()
|
||||||
|
.performClick()
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ import org.junit.Assert.*
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
* See [testing documentation](http://d.android.com/tools/testing).
|
||||||
*/
|
*/
|
||||||
@RunWith(AndroidJUnit4::class)
|
@RunWith(AndroidJUnit4::class)
|
||||||
class ExampleInstrumentedTest {
|
class InstrumentedTest {
|
||||||
@Test
|
@Test
|
||||||
fun useAppContext() {
|
fun useAppContext() {
|
||||||
// Context of the app under test.
|
// Context of the app under test.
|
|
@ -18,7 +18,7 @@ class SessionScreenTest {
|
||||||
val composeTestRule = createComposeRule()
|
val composeTestRule = createComposeRule()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun SessionRecapTest() {
|
fun sessionRecapTest() {
|
||||||
var saveCalled = false
|
var saveCalled = false
|
||||||
var discardCalled = false
|
var discardCalled = false
|
||||||
|
|
||||||
|
@ -67,4 +67,6 @@ class SessionScreenTest {
|
||||||
Assert.assertTrue(saveCalled)
|
Assert.assertTrue(saveCalled)
|
||||||
Assert.assertTrue(discardCalled)
|
Assert.assertTrue(discardCalled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
|
compose_ui_version = '1.2.0'
|
||||||
compose_version = '1.1.1'
|
compose_version = '1.1.1'
|
||||||
coreTestingVersion = '2.1.0'
|
coreTestingVersion = '2.1.0'
|
||||||
espressoVersion = '3.4.0'
|
espressoVersion = '3.4.0'
|
||||||
|
@ -8,16 +9,15 @@ buildscript {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.google.gms:google-services:4.3.15'
|
classpath 'com.google.gms:google-services:4.3.15'
|
||||||
classpath 'com.android.tools.build:gradle:8.0.0'
|
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
|
||||||
}
|
}
|
||||||
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application' version '8.0.0' apply false
|
id 'com.android.application' version '7.4.2' apply false
|
||||||
id 'com.android.library' version '8.0.0' apply false
|
id 'com.android.library' version '7.4.2' apply false
|
||||||
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
|
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
|
||||||
|
|
||||||
// Hilt
|
// Hilt
|
||||||
id 'com.google.dagger.hilt.android' version '2.44' apply false
|
id 'com.google.dagger.hilt.android' version '2.44' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue