diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1529c32..03842c92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,31 +43,28 @@ jobs: path: app/build/outputs/apk/release/app-release.apk send: - name: Send APK - runs-on: macos-latest - needs: build - steps: - - name: Checkout - uses: actions/checkout@v4 + name: Send APK + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Download APK - uses: actions/download-artifact@v4 - with: - name: logfox-release + - name: Download APK + uses: actions/download-artifact@v4 + with: + name: logfox-release - - name: Check directory - run: ls -a + - name: Send APK to Telegram + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + format: markdown + document: app-release.apk + disable_web_page_preview: true + message: | + *${{ github.actor }}* committed to *${{ github.repository }}* - - name: Send APK to Telegram - uses: appleboy/telegram-action@master - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - format: markdown - document: app-release.apk - disable_web_page_preview: true - message: | - *${{ github.actor }}* committed to *${{ github.repository }}* - - Branch: *${{ github.head_ref }}* - Commit message: `${{ github.event.pull_request.head.label }}` + Branch: *${{ github.head_ref }}* + Commit message: `${{ github.event.pull_request.head.label }}` diff --git a/core/core-tests/src/main/kotlin/com/f0x1d/logfox/core/tests/ScreenshotTest.kt b/core/core-tests/src/main/kotlin/com/f0x1d/logfox/core/tests/ScreenshotTest.kt index b0ab49aa..c2438b5a 100644 --- a/core/core-tests/src/main/kotlin/com/f0x1d/logfox/core/tests/ScreenshotTest.kt +++ b/core/core-tests/src/main/kotlin/com/f0x1d/logfox/core/tests/ScreenshotTest.kt @@ -21,7 +21,7 @@ import org.robolectric.annotation.GraphicsMode qualifiers = RobolectricDeviceQualifiers.Pixel7, ) @GraphicsMode(GraphicsMode.Mode.NATIVE) -abstract class ScreenshotTestOf { +abstract class ScreenshotTest { @JvmField @Rule @@ -45,11 +45,13 @@ abstract class ScreenshotTestOf { composeRule.setContent { content() } composeRule.actions() - composeRule.waitForIdle() + waitForIdle() composeRule.whatToCapture().captureRoboImage() } + protected fun waitForIdle() = composeRule.waitForIdle() + protected fun String.node(): SemanticsNodeInteraction = composeRule.onNode(this) companion object { diff --git a/feature/feature-setup/src/test/kotlin/com/f0x1d/logfox/setup/compose/SetupScreenContentTest.kt b/feature/feature-setup/src/test/kotlin/com/f0x1d/logfox/setup/compose/SetupScreenContentTest.kt index d7a9dee4..027f5eff 100644 --- a/feature/feature-setup/src/test/kotlin/com/f0x1d/logfox/setup/compose/SetupScreenContentTest.kt +++ b/feature/feature-setup/src/test/kotlin/com/f0x1d/logfox/setup/compose/SetupScreenContentTest.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -import com.f0x1d.logfox.core.tests.ScreenshotTestOf +import com.f0x1d.logfox.core.tests.ScreenshotTest import com.f0x1d.logfox.core.tests.compose.clickOn import com.f0x1d.logfox.feature.setup.ui.fragment.setup.compose.MockSetupScreenListener import com.f0x1d.logfox.feature.setup.ui.fragment.setup.compose.SetupAdbButtonTestTag @@ -14,7 +14,7 @@ import com.f0x1d.logfox.feature.setup.ui.fragment.setup.compose.SetupScreenState import com.f0x1d.logfox.ui.compose.theme.LogFoxTheme import org.junit.Test -class SetupScreenContentTest : ScreenshotTestOf() { +class SetupScreenContentTest : ScreenshotTest() { @Test fun shouldShowSetupScreenContent() = screenshotTestOf { @@ -25,6 +25,17 @@ class SetupScreenContentTest : ScreenshotTestOf() { @Test fun shouldShowAdbDialogOnSetupScreenContent() = screenshotTestOf( + whatToCapture = { SetupAdbDialogTestTag.node() }, + ) { + LogFoxTheme { + SetupScreenContent( + state = SetupScreenState(showAdbDialog = true), + ) + } + } + + @Test + fun shouldOpenAdbDialogOnSetupScreenContent() = screenshotTestOf( actions = { clickOn(SetupAdbButtonTestTag) }, whatToCapture = { SetupAdbDialogTestTag.node() }, ) { @@ -37,7 +48,7 @@ class SetupScreenContentTest : ScreenshotTestOf() { state = state, listener = MockSetupScreenListener.copy( onAdbClick = { state = state.copy(showAdbDialog = true) }, - ) + ), ) } } diff --git a/feature/feature-setup/src/test/screenshots/com.f0x1d.logfox.setup.compose.SetupScreenContentTest.shouldOpenAdbDialogOnSetupScreenContent.png b/feature/feature-setup/src/test/screenshots/com.f0x1d.logfox.setup.compose.SetupScreenContentTest.shouldOpenAdbDialogOnSetupScreenContent.png new file mode 100644 index 00000000..87f8cfb9 Binary files /dev/null and b/feature/feature-setup/src/test/screenshots/com.f0x1d.logfox.setup.compose.SetupScreenContentTest.shouldOpenAdbDialogOnSetupScreenContent.png differ