added create habit test for description

This commit is contained in:
Rechee
2020-01-08 20:16:43 -08:00
parent 7366e9a47f
commit 1714cf8050

View File

@@ -38,7 +38,16 @@ import static org.isoron.uhabits.acceptance.steps.ListHabitsSteps.*;
public class HabitsTest extends BaseUserInterfaceTest public class HabitsTest extends BaseUserInterfaceTest
{ {
@Test @Test
public void shouldCreateHabit() throws Exception public void shouldCreateHabit() throws Exception {
shouldCreateHabit("this is a test description");
}
@Test
public void shouldCreateHabitBlankDescription() throws Exception {
shouldCreateHabit("");
}
private void shouldCreateHabit(String description) throws Exception
{ {
launchApp(); launchApp();
@@ -46,14 +55,16 @@ public class HabitsTest extends BaseUserInterfaceTest
clickMenu(ADD); clickMenu(ADD);
verifyShowsScreen(EDIT_HABIT); verifyShowsScreen(EDIT_HABIT);
typeName("Hello world"); String testName = "Hello world";
typeName(testName);
typeQuestion("Did you say hello to the world today?"); typeQuestion("Did you say hello to the world today?");
typeDescription(description);
pickFrequency("Every week"); pickFrequency("Every week");
pickColor(5); pickColor(5);
clickSave(); clickSave();
verifyShowsScreen(LIST_HABITS); verifyShowsScreen(LIST_HABITS);
verifyDisplaysText("Hello world"); verifyDisplaysText(testName);
} }
@Test @Test