From f1d30e59b05cd56473110d2287d9b106804d0094 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 25 Jul 2023 20:17:27 +0530 Subject: [PATCH] feat: add Search flow to Maestro --- .../dev/msfjarvis/claw/android/ui/lists/SearchList.kt | 3 ++- maestro/feature_graphic.yml | 8 ++++++++ scripts/refresh-feature-graphic.sh | 10 ++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/SearchList.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/SearchList.kt index 629b6eeb..573499b1 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/SearchList.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/SearchList.kt @@ -26,6 +26,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag import androidx.compose.ui.semantics.isTraversalGroup import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp @@ -67,7 +68,7 @@ fun SearchList( triggerSearch(it) searchActive = true }, - modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp), + modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp).testTag("search_bar"), ) if (searchActive) { NetworkPosts( diff --git a/maestro/feature_graphic.yml b/maestro/feature_graphic.yml index 376633d0..45e38055 100644 --- a/maestro/feature_graphic.yml +++ b/maestro/feature_graphic.yml @@ -10,6 +10,14 @@ appId: dev.msfjarvis.claw.android - takeScreenshot: "HottestPosts" - tapOn: "Saved" - takeScreenshot: "SavedPosts" +- tapOn: "Search" +- tapOn: + id: "search_bar" +- inputText: "Rust" +- pressKey: Enter +- hideKeyboard +- waitForAnimationToEnd +- takeScreenshot: "SearchPage" - tapOn: "Hottest" - tapOn: "Open comments" - waitForAnimationToEnd diff --git a/scripts/refresh-feature-graphic.sh b/scripts/refresh-feature-graphic.sh index e78a1a9f..456e4c11 100755 --- a/scripts/refresh-feature-graphic.sh +++ b/scripts/refresh-feature-graphic.sh @@ -11,8 +11,14 @@ SCREENSHOT_DIR="${SCRIPT_DIR}"/../screenshots # Run the Maestro flow to generate the screenshots "${SCRIPT_DIR}"/run-maestro-flows.sh feature_graphic.yml -# Use imagemagick to stitch the screenshots horizontally -convert +append "${SCREENSHOT_DIR}"/HottestPosts.png "${SCREENSHOT_DIR}"/CommentsPage.png "${SCREENSHOT_DIR}"/SavedPosts.png "${SCRIPT_DIR}"/../.github/readme_feature.png +# Use imagemagick to stitch the screenshots in a grid +montage -tile 2x0 -geometry +0+0 \ + -border 0 -density 300 \ + "${SCREENSHOT_DIR}"/HottestPosts.png \ + "${SCREENSHOT_DIR}"/CommentsPage.png \ + "${SCREENSHOT_DIR}"/SavedPosts.png \ + "${SCREENSHOT_DIR}"/SearchPage.png \ + "${SCRIPT_DIR}"/../.github/readme_feature.png # Convert the resulting PNG to WebP cwebp .github/readme_feature.png -o .github/readme_feature.webp