Обновить Stage 2 регрессию и roadmap

This commit is contained in:
2026-08-18 02:41:02 +03:00
parent a8f5ddc0a9
commit 3ed6d9ebab
5 changed files with 64 additions and 54 deletions
@@ -12,6 +12,8 @@ import org.junit.runner.RunWith;
/** Acceptance test: a bot must finish the same level implementation shipped in the APK. */
@RunWith(AndroidJUnit4.class)
public final class LevelFivePlaythroughTest {
private static final int CONSECUTIVE_RUNS = 3;
@Test
public void testBotCompletesLevelFive() {
try (ActivityScenario<MainActivity> scenario = ActivityScenario.launch(MainActivity.class)) {
@@ -19,15 +21,20 @@ public final class LevelFivePlaythroughTest {
scenario.onActivity(activity -> view[0] = activity.gameViewForAutomation());
LevelPlaytestBot bot = new LevelPlaytestBot();
LevelPlaytestBot.Result result = bot.proveLevelFive(
new AndroidDriver(InstrumentationRegistry.getInstrumentation(), view[0]),
25_000L
);
AndroidDriver driver = new AndroidDriver(
InstrumentationRegistry.getInstrumentation(), view[0]);
for (int run = 1; run <= CONSECUTIVE_RUNS; run++) {
LevelPlaytestBot.Result result = bot.proveLevelFive(driver, 25_000L);
org.junit.Assert.assertTrue(result.diagnostic(), result.completed());
org.junit.Assert.assertTrue("The solution must use at least one volunteer", result.deaths() >= 1);
org.junit.Assert.assertTrue("The delivered corpse must remain in the puzzle", result.corpseCount() >= 1);
org.junit.Assert.assertTrue("The pressure-plate door must open", result.doorOpened());
org.junit.Assert.assertTrue("run=" + run + "; " + result.diagnostic(),
result.completed());
org.junit.Assert.assertEquals("run=" + run + "; exactly one volunteer is required",
1, result.deaths());
org.junit.Assert.assertEquals("run=" + run + "; delivered corpse must remain",
1, result.corpseCount());
org.junit.Assert.assertTrue("run=" + run + "; pressure-plate door must open",
result.doorOpened());
}
}
}