Test infra: shared accessibility IDs + PageObjects + AAA_SeedTests
Ports iOS HoneyDueUITests AccessibilityIdentifiers + PageObjects pattern to Android Compose UI Test. Kotlin AccessibilityIds object mirrors Swift verbatim so scripts/verify_test_tag_parity.sh can gate on divergence. AAA_SeedTests bracketed first alphanumerically; SuiteZZ cleanup to follow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.tt.honeyDue.fixtures
|
||||
|
||||
import com.tt.honeyDue.models.TaskCreateRequest
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* Test task fixture mirroring `TestFixtures.TestTask` in Swift.
|
||||
*
|
||||
* The Go API requires a residenceId and assigns category/priority IDs from
|
||||
* DataManager lookups — callers pass the ID of a seeded test residence plus
|
||||
* optional lookup IDs after a prefetch.
|
||||
*/
|
||||
data class TestTask(
|
||||
val title: String,
|
||||
val description: String,
|
||||
val residenceId: Int,
|
||||
val priorityId: Int? = null,
|
||||
val categoryId: Int? = null,
|
||||
val estimatedCost: Double? = null,
|
||||
) {
|
||||
fun toCreateRequest(): TaskCreateRequest = TaskCreateRequest(
|
||||
residenceId = residenceId,
|
||||
title = title,
|
||||
description = description,
|
||||
categoryId = categoryId,
|
||||
priorityId = priorityId,
|
||||
estimatedCost = estimatedCost,
|
||||
)
|
||||
|
||||
companion object {
|
||||
fun basic(residenceId: Int, suffix: String = randomSuffix()): TestTask = TestTask(
|
||||
title = "Test Task $suffix",
|
||||
description = "A test task",
|
||||
residenceId = residenceId,
|
||||
)
|
||||
|
||||
fun urgent(
|
||||
residenceId: Int,
|
||||
priorityId: Int? = null,
|
||||
suffix: String = randomSuffix(),
|
||||
): TestTask = TestTask(
|
||||
title = "Urgent Task $suffix",
|
||||
description = "An urgent task",
|
||||
residenceId = residenceId,
|
||||
priorityId = priorityId,
|
||||
)
|
||||
|
||||
private fun randomSuffix(): String =
|
||||
Random.nextInt(1000, 9999).toString()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user