Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8259cdb
feat(forge): 重写自适应导航壳与首页
EstimateFaster Nov 9, 2026
181effa
feat(forge): rewrite Storage/About screens with Forge Framework v1
EstimateFaster Nov 9, 2026
b567d26
feat(ui-projects): rebuild project library and import sheet with Forg…
EstimateFaster Nov 9, 2026
085fa8f
feat(ui-tasks-settings): 按 Forge 框架重写任务与设置页
EstimateFaster Nov 9, 2026
eb03d3f
feat(ui): rewrite project, chapters, batch and tuning with Forge comp…
EstimateFaster Nov 9, 2026
183c9a9
feat(ui): 用 Forge 组件与 Lucide 图标重写引导 / 播放器 / 导出
EstimateFaster Nov 9, 2026
e97435d
feat(ui-script-characters): rebuild script, characters and sheets on …
EstimateFaster Nov 9, 2026
5774fe7
Merge branch 'feat/ui-projects' into feat/forge-ui-final
EstimateFaster Nov 9, 2026
919c3f7
Merge branch 'feat/ui-project' into feat/forge-ui-final
EstimateFaster Nov 9, 2026
94c9b33
merge ui-script-characters
EstimateFaster Nov 9, 2026
519d2ff
Merge branch 'feat/ui-tasks-settings' into feat/forge-ui-final
EstimateFaster Nov 9, 2026
aaf5ebc
Merge branch 'feat/ui-storage-about' into feat/forge-ui-final
EstimateFaster Nov 9, 2026
23bc4e7
Merge branch 'feat/ui-onboarding-player-export' into feat/forge-ui-final
EstimateFaster Nov 9, 2026
a937f2b
fix(ui): remove nested comment opener in tasks kdoc
EstimateFaster Nov 9, 2026
68256db
test(ui): update smoke selectors and add theme switch
EstimateFaster Nov 9, 2026
c26b763
test(ui): align smoke with Forge labels and duplicate titles
EstimateFaster Nov 9, 2026
42c6d36
test(ui): drop non-visible duplicate import label assertion
EstimateFaster Nov 9, 2026
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.estimatefaster.audioforge.ui

import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsSelected
import androidx.compose.ui.test.hasClickAction
import androidx.compose.ui.test.hasScrollToNodeAction
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onAllNodesWithText
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onFirst
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performScrollToNode
Expand Down Expand Up @@ -54,62 +57,80 @@ class NavigationSmokeTest {
composeRule.onNodeWithText(onboardingTitle).assertIsDisplayed()
composeRule.onNodeWithText(skip).assertIsDisplayed().performClick()

waitForText(text(R.string.project_library_title))
composeRule.onNodeWithText(text(R.string.project_library_title)).assertIsDisplayed()
waitForText(text(R.string.ux2_projects_title))
assertTextDisplayed(text(R.string.ux2_projects_title))

// 数据库已清空,项目库应稳定落在空态;导入 FAB 始终可见。
waitForText(text(R.string.project_library_empty_title))
composeRule.onNodeWithText(text(R.string.project_library_empty_title)).assertIsDisplayed()
composeRule.onNodeWithText(text(R.string.project_library_empty_action)).assertIsDisplayed()
composeRule.onNodeWithText(text(R.string.project_library_import)).assertIsDisplayed()
waitForText(text(R.string.ux2_projects_empty_title))
assertTextDisplayed(text(R.string.ux2_projects_empty_title))
assertTextDisplayed(text(R.string.ux2_projects_empty_action))
}

@Test
fun bottom_navigation_switches_projects_tasks_and_settings() {
skipOnboarding()

openTopLevelTab(R.string.nav_tasks)
waitForText(text(R.string.tasks_subtitle))
composeRule.onNodeWithText(text(R.string.tasks_subtitle)).assertIsDisplayed()
openTopLevelTab(R.string.ux_nav_tab_tasks)
waitForText(text(R.string.ux_tasks_subtitle))
assertTextDisplayed(text(R.string.ux_tasks_subtitle))

openTopLevelTab(R.string.nav_settings)
openTopLevelTab(R.string.ux_nav_tab_settings)
waitForText(text(R.string.settings_section_api))
composeRule.onNodeWithText(text(R.string.settings_section_api)).assertIsDisplayed()
assertTextDisplayed(text(R.string.settings_section_api))

openTopLevelTab(R.string.nav_projects)
waitForText(text(R.string.project_library_title))
composeRule.onNodeWithText(text(R.string.project_library_title)).assertIsDisplayed()
openTopLevelTab(R.string.ux_nav_tab_library)
waitForText(text(R.string.ux2_projects_title))
assertTextDisplayed(text(R.string.ux2_projects_title))
}

@Test
fun settings_opens_storage_and_about_then_returns() {
skipOnboarding()
openTopLevelTab(R.string.nav_settings)
openTopLevelTab(R.string.ux_nav_tab_settings)
waitForSettingsContent()

scrollSettingsTo(text(R.string.settings_action_open_storage))
composeRule.onNodeWithText(text(R.string.settings_action_open_storage))
.assertIsDisplayed()
.performClick()

// 设置页没有「刷新」,它是存储页顶栏的稳定标记。
waitForText(text(R.string.action_refresh))
composeRule.onNodeWithText(text(R.string.storage_title)).assertIsDisplayed()
composeRule.onNodeWithText(text(R.string.action_back)).assertIsDisplayed().performClick()
waitForText(text(R.string.storage_title))
assertTextDisplayed(text(R.string.storage_title))
composeRule.onNodeWithContentDescription(text(R.string.action_back)).assertIsDisplayed().performClick()
waitForSettingsContent()

scrollSettingsTo(text(R.string.settings_action_open_about))
composeRule.onNodeWithText(text(R.string.settings_action_open_about))
.assertIsDisplayed()
.performClick()

// 同上:设置页没有「刷新」,用它判断关于页已经进入且转场结束。
waitForText(text(R.string.action_refresh))
composeRule.onNodeWithText(text(R.string.about_title)).assertIsDisplayed()
composeRule.onNodeWithText(text(R.string.action_back)).assertIsDisplayed().performClick()
waitForText(text(R.string.about_title))
assertTextDisplayed(text(R.string.about_title))
composeRule.onNodeWithContentDescription(text(R.string.action_back)).assertIsDisplayed().performClick()
waitForSettingsContent()
}

@Test
fun theme_switch_applies_immediately_and_keeps_navigation() {
skipOnboarding()
openTopLevelTab(R.string.ux_nav_tab_settings)
waitForSettingsContent()

scrollSettingsTo(text(R.string.settings_theme_dark))
composeRule.onNodeWithText(text(R.string.settings_theme_dark)).performClick()
composeRule.waitForIdle()
composeRule.onNodeWithText(text(R.string.settings_theme_dark)).assertIsSelected()

scrollSettingsTo(text(R.string.settings_theme_light))
composeRule.onNodeWithText(text(R.string.settings_theme_light)).performClick()
composeRule.waitForIdle()
composeRule.onNodeWithText(text(R.string.settings_theme_light)).assertIsSelected()

openTopLevelTab(R.string.ux_nav_tab_library)
waitForText(text(R.string.ux2_projects_title))
assertTextDisplayed(text(R.string.ux2_projects_title))
}

// ------------------------------------------------------------------
// 辅助方法
// ------------------------------------------------------------------
Expand All @@ -118,7 +139,7 @@ class NavigationSmokeTest {
val skip = text(R.string.onboarding_skip)
waitForText(skip)
composeRule.onNodeWithText(skip).performClick()
waitForText(text(R.string.project_library_title))
waitForText(text(R.string.ux2_projects_title))
}

private fun openTopLevelTab(labelRes: Int) {
Expand All @@ -130,6 +151,10 @@ class NavigationSmokeTest {
composeRule.onNode(hasScrollToNodeAction()).performScrollToNode(hasText(label))
}

private fun assertTextDisplayed(value: String) {
composeRule.onAllNodesWithText(value).onFirst().assertIsDisplayed()
}

private fun waitForText(value: String) {
composeRule.waitUntil(UI_TIMEOUT_MS) {
composeRule.onAllNodesWithText(value).fetchSemanticsNodes().isNotEmpty()
Expand All @@ -144,7 +169,7 @@ class NavigationSmokeTest {
* 保证 [scrollSettingsTo] 拿到的是设置页自己的 LazyColumn 而不是上一页面的列表。
*/
private fun waitForSettingsContent() {
waitForText(text(R.string.action_save))
waitForText(text(R.string.settings_title))
composeRule.waitUntil(UI_TIMEOUT_MS) {
composeRule.onAllNodes(hasScrollToNodeAction()).fetchSemanticsNodes().isNotEmpty()
}
Expand Down
Loading
Loading