Обновить Stage 2 регрессию и roadmap
This commit is contained in:
+2
-2
@@ -10,8 +10,8 @@ android {
|
||||
applicationId 'com.projectsacrifice.game'
|
||||
minSdk 23
|
||||
targetSdk 34
|
||||
versionCode 3
|
||||
versionName '0.2.1-level5-proof'
|
||||
versionCode 4
|
||||
versionName '0.3.0-stage2-playability'
|
||||
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user