Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checkLaunchServerErrorShot #1253

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
buildConfig = true
}
defaultConfig {
versionCode = 11
versionName = "1.6.0"
versionCode = 12
versionName = "1.6.1"
}
signingConfigs {
create("dev") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package io.github.droidkaigi.confsched2023.testing.robot
import androidx.compose.ui.test.isRoot
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
import com.github.takahirom.roborazzi.captureRoboImage
import io.github.droidkaigi.confsched2023.data.sessions.FakeSessionsApiClient
import io.github.droidkaigi.confsched2023.data.sessions.SessionsApiClient
import io.github.droidkaigi.confsched2023.designsystem.theme.KaigiTheme
import io.github.droidkaigi.confsched2023.staff.StaffScreen
import io.github.droidkaigi.confsched2023.testing.RobotTestRule
Expand All @@ -16,6 +18,10 @@ class StaffScreenRobot @Inject constructor(
) {

@Inject lateinit var robotTestRule: RobotTestRule

@Inject lateinit var sessionsApiClient: SessionsApiClient
val fakeSessionsApiClient: FakeSessionsApiClient
get() = sessionsApiClient as FakeSessionsApiClient
private lateinit var composeTestRule: AndroidComposeTestRule<*, *>

operator fun invoke(
Expand All @@ -39,6 +45,20 @@ class StaffScreenRobot @Inject constructor(
waitUntilIdle()
}

enum class ServerStatus {
Operational,
Error,
}

fun setupServer(serverStatus: ServerStatus) {
fakeSessionsApiClient.setup(
when (serverStatus) {
ServerStatus.Operational -> FakeSessionsApiClient.Status.Operational
ServerStatus.Error -> FakeSessionsApiClient.Status.Error
},
)
}

fun checkScreenCapture() {
composeTestRule
.onNode(isRoot())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ fun TimetableGrid(
end = contentPadding.calculateEndPadding(layoutDirection),
),
) {
TimetableGridHours(
timetableState = timetableGridState,
coroutineScope = coroutineScope,
) { hour ->
HoursItem(hour = hour)
}
// TimetableGridHours(
// timetableState = timetableGridState,
// coroutineScope = coroutineScope,
// ) { hour ->
// HoursItem(hour = hour)
// }
Column {
TimetableGridRooms(
timetableRooms = TimetableRooms(timetable.rooms),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.github.droidkaigi.confsched2023.testing.HiltTestActivity
import io.github.droidkaigi.confsched2023.testing.RobotTestRule
import io.github.droidkaigi.confsched2023.testing.category.ScreenshotTests
import io.github.droidkaigi.confsched2023.testing.robot.StaffScreenRobot
import io.github.droidkaigi.confsched2023.testing.robot.StaffScreenRobot.ServerStatus.Error
import org.junit.Rule
import org.junit.Test
import org.junit.experimental.categories.Category
Expand Down Expand Up @@ -38,4 +39,14 @@ class StaffScreenTest {
checkScreenCapture()
}
}

@Test
@Category(ScreenshotTests::class)
fun checkLaunchServerErrorShot() {
staffScreenRobot {
setupServer(Error)
setupScreenContent()
checkScreenCapture()
}
}
}
Loading