mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28:52 -06:00
Acceptance tests: fix imports; remove unused function
This commit is contained in:
@@ -21,11 +21,12 @@ package org.isoron.uhabits.acceptance
|
|||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.LargeTest
|
import androidx.test.filters.LargeTest
|
||||||
import org.isoron.uhabits.BaseUserInterfaceTest
|
import org.isoron.uhabits.BaseUserInterfaceTest
|
||||||
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.clickText
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDisplaysText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDisplaysText
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.ABOUT
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.SETTINGS
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
||||||
import org.isoron.uhabits.acceptance.steps.WidgetSteps.clickText
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ class AboutTest : BaseUserInterfaceTest() {
|
|||||||
@Test
|
@Test
|
||||||
fun shouldDisplayAboutScreen() {
|
fun shouldDisplayAboutScreen() {
|
||||||
launchApp()
|
launchApp()
|
||||||
clickMenu(ListHabitsSteps.MenuItem.ABOUT)
|
clickMenu(ABOUT)
|
||||||
verifyDisplaysText("Loop Habit Tracker")
|
verifyDisplaysText("Loop Habit Tracker")
|
||||||
verifyDisplaysText("Rate this app on Google Play")
|
verifyDisplaysText("Rate this app on Google Play")
|
||||||
verifyDisplaysText("Developers")
|
verifyDisplaysText("Developers")
|
||||||
@@ -45,7 +46,7 @@ class AboutTest : BaseUserInterfaceTest() {
|
|||||||
@Test
|
@Test
|
||||||
fun shouldDisplayAboutScreenFromSettings() {
|
fun shouldDisplayAboutScreenFromSettings() {
|
||||||
launchApp()
|
launchApp()
|
||||||
clickMenu(ListHabitsSteps.MenuItem.SETTINGS)
|
clickMenu(SETTINGS)
|
||||||
clickText("About")
|
clickText("About")
|
||||||
verifyDisplaysText("Translators")
|
verifyDisplaysText("Translators")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
|||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.longClickText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.longClickText
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDisplaysText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDisplaysText
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDoesNotDisplayText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDoesNotDisplayText
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.DELETE
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
||||||
import org.isoron.uhabits.acceptance.steps.clearBackupFolder
|
import org.isoron.uhabits.acceptance.steps.clearBackupFolder
|
||||||
import org.isoron.uhabits.acceptance.steps.clearDownloadFolder
|
import org.isoron.uhabits.acceptance.steps.clearDownloadFolder
|
||||||
@@ -44,14 +44,11 @@ class BackupTest : BaseUserInterfaceTest() {
|
|||||||
clearBackupFolder()
|
clearBackupFolder()
|
||||||
exportFullBackup()
|
exportFullBackup()
|
||||||
copyBackupToDownloadFolder()
|
copyBackupToDownloadFolder()
|
||||||
|
|
||||||
longClickText("Wake up early")
|
longClickText("Wake up early")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.DELETE)
|
clickMenu(DELETE)
|
||||||
clickText("Yes")
|
clickText("Yes")
|
||||||
verifyDoesNotDisplayText("Wake up early")
|
verifyDoesNotDisplayText("Wake up early")
|
||||||
|
|
||||||
importBackupFromDownloadFolder()
|
importBackupFromDownloadFolder()
|
||||||
|
|
||||||
verifyDisplaysText("Wake up early")
|
verifyDisplaysText("Wake up early")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ package org.isoron.uhabits.acceptance
|
|||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.LargeTest
|
import androidx.test.filters.LargeTest
|
||||||
import org.isoron.uhabits.BaseUserInterfaceTest
|
import org.isoron.uhabits.BaseUserInterfaceTest
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.Screen.EDIT_HABIT
|
||||||
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.Screen.LIST_HABITS
|
||||||
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.Screen.SELECT_HABIT_TYPE
|
||||||
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.Screen.SHOW_HABIT
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.clickText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.clickText
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.longClickText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.longClickText
|
||||||
@@ -37,7 +40,13 @@ import org.isoron.uhabits.acceptance.steps.EditHabitSteps.pickFrequency
|
|||||||
import org.isoron.uhabits.acceptance.steps.EditHabitSteps.typeDescription
|
import org.isoron.uhabits.acceptance.steps.EditHabitSteps.typeDescription
|
||||||
import org.isoron.uhabits.acceptance.steps.EditHabitSteps.typeName
|
import org.isoron.uhabits.acceptance.steps.EditHabitSteps.typeName
|
||||||
import org.isoron.uhabits.acceptance.steps.EditHabitSteps.typeQuestion
|
import org.isoron.uhabits.acceptance.steps.EditHabitSteps.typeQuestion
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.ADD
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.ARCHIVE
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.DELETE
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.EDIT
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.TOGGLE_ARCHIVED
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.TOGGLE_COMPLETED
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.UNARCHIVE
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.longPressCheckmarks
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.longPressCheckmarks
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@@ -61,11 +70,11 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
private fun shouldCreateHabit(description: String) {
|
private fun shouldCreateHabit(description: String) {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
clickMenu(ListHabitsSteps.MenuItem.ADD)
|
clickMenu(ADD)
|
||||||
verifyShowsScreen(CommonSteps.Screen.SELECT_HABIT_TYPE)
|
verifyShowsScreen(SELECT_HABIT_TYPE)
|
||||||
clickText("Yes or No")
|
clickText("Yes or No")
|
||||||
verifyShowsScreen(CommonSteps.Screen.EDIT_HABIT)
|
verifyShowsScreen(EDIT_HABIT)
|
||||||
val testName = "Hello world"
|
val testName = "Hello world"
|
||||||
typeName(testName)
|
typeName(testName)
|
||||||
typeQuestion("Did you say hello to the world today?")
|
typeQuestion("Did you say hello to the world today?")
|
||||||
@@ -73,7 +82,7 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
pickFrequency()
|
pickFrequency()
|
||||||
pickColor(5)
|
pickColor(5)
|
||||||
clickSave()
|
clickSave()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
verifyDisplaysText(testName)
|
verifyDisplaysText(testName)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,9 +90,9 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldShowHabitStatistics() {
|
fun shouldShowHabitStatistics() {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
clickText("Track time")
|
clickText("Track time")
|
||||||
verifyShowsScreen(CommonSteps.Screen.SHOW_HABIT)
|
verifyShowsScreen(SHOW_HABIT)
|
||||||
verifyDisplayGraphs()
|
verifyDisplayGraphs()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,9 +100,9 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldDeleteHabit() {
|
fun shouldDeleteHabit() {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
longClickText("Track time")
|
longClickText("Track time")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.DELETE)
|
clickMenu(DELETE)
|
||||||
clickText("Yes")
|
clickText("Yes")
|
||||||
verifyDoesNotDisplayText("Track time")
|
verifyDoesNotDisplayText("Track time")
|
||||||
}
|
}
|
||||||
@@ -113,15 +122,15 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
private fun shouldEditHabit(description: String) {
|
private fun shouldEditHabit(description: String) {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
longClickText("Track time")
|
longClickText("Track time")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.EDIT)
|
clickMenu(EDIT)
|
||||||
verifyShowsScreen(CommonSteps.Screen.EDIT_HABIT)
|
verifyShowsScreen(EDIT_HABIT)
|
||||||
typeName("Take a walk")
|
typeName("Take a walk")
|
||||||
typeQuestion("Did you take a walk today?")
|
typeQuestion("Did you take a walk today?")
|
||||||
typeDescription(description)
|
typeDescription(description)
|
||||||
clickSave()
|
clickSave()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
verifyDisplaysTextInSequence("Wake up early", "Take a walk", "Meditate")
|
verifyDisplaysTextInSequence("Wake up early", "Take a walk", "Meditate")
|
||||||
verifyDoesNotDisplayText("Track time")
|
verifyDoesNotDisplayText("Track time")
|
||||||
}
|
}
|
||||||
@@ -130,19 +139,19 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldEditHabit_fromStatisticsScreen() {
|
fun shouldEditHabit_fromStatisticsScreen() {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
clickText("Track time")
|
clickText("Track time")
|
||||||
verifyShowsScreen(CommonSteps.Screen.SHOW_HABIT)
|
verifyShowsScreen(SHOW_HABIT)
|
||||||
clickMenu(ListHabitsSteps.MenuItem.EDIT)
|
clickMenu(EDIT)
|
||||||
verifyShowsScreen(CommonSteps.Screen.EDIT_HABIT)
|
verifyShowsScreen(EDIT_HABIT)
|
||||||
typeName("Take a walk")
|
typeName("Take a walk")
|
||||||
typeQuestion("Did you take a walk today?")
|
typeQuestion("Did you take a walk today?")
|
||||||
pickColor(10)
|
pickColor(10)
|
||||||
clickSave()
|
clickSave()
|
||||||
verifyShowsScreen(CommonSteps.Screen.SHOW_HABIT)
|
verifyShowsScreen(SHOW_HABIT)
|
||||||
verifyDisplaysText("Take a walk")
|
verifyDisplaysText("Take a walk")
|
||||||
pressBack()
|
pressBack()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
verifyDisplaysText("Take a walk")
|
verifyDisplaysText("Take a walk")
|
||||||
verifyDoesNotDisplayText("Track time")
|
verifyDoesNotDisplayText("Track time")
|
||||||
}
|
}
|
||||||
@@ -151,15 +160,15 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldArchiveAndUnarchiveHabits() {
|
fun shouldArchiveAndUnarchiveHabits() {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
longClickText("Track time")
|
longClickText("Track time")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.ARCHIVE)
|
clickMenu(ARCHIVE)
|
||||||
verifyDoesNotDisplayText("Track time")
|
verifyDoesNotDisplayText("Track time")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.TOGGLE_ARCHIVED)
|
clickMenu(TOGGLE_ARCHIVED)
|
||||||
verifyDisplaysText("Track time")
|
verifyDisplaysText("Track time")
|
||||||
longClickText("Track time")
|
longClickText("Track time")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.UNARCHIVE)
|
clickMenu(UNARCHIVE)
|
||||||
clickMenu(ListHabitsSteps.MenuItem.TOGGLE_ARCHIVED)
|
clickMenu(TOGGLE_ARCHIVED)
|
||||||
verifyDisplaysText("Track time")
|
verifyDisplaysText("Track time")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,10 +176,10 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldToggleCheckmarksAndUpdateScore() {
|
fun shouldToggleCheckmarksAndUpdateScore() {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
longPressCheckmarks("Wake up early", 2)
|
longPressCheckmarks("Wake up early", 2)
|
||||||
clickText("Wake up early")
|
clickText("Wake up early")
|
||||||
verifyShowsScreen(CommonSteps.Screen.SHOW_HABIT)
|
verifyShowsScreen(SHOW_HABIT)
|
||||||
verifyDisplaysText("10%")
|
verifyDisplaysText("10%")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,15 +187,15 @@ class HabitsTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldHideCompleted() {
|
fun shouldHideCompleted() {
|
||||||
launchApp()
|
launchApp()
|
||||||
verifyShowsScreen(CommonSteps.Screen.LIST_HABITS)
|
verifyShowsScreen(LIST_HABITS)
|
||||||
verifyDisplaysText("Track time")
|
verifyDisplaysText("Track time")
|
||||||
verifyDisplaysText("Wake up early")
|
verifyDisplaysText("Wake up early")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.TOGGLE_COMPLETED)
|
clickMenu(TOGGLE_COMPLETED)
|
||||||
verifyDoesNotDisplayText("Track time")
|
verifyDoesNotDisplayText("Track time")
|
||||||
verifyDisplaysText("Wake up early")
|
verifyDisplaysText("Wake up early")
|
||||||
longPressCheckmarks("Wake up early", 1)
|
longPressCheckmarks("Wake up early", 1)
|
||||||
verifyDoesNotDisplayText("Wake up early")
|
verifyDoesNotDisplayText("Wake up early")
|
||||||
clickMenu(ListHabitsSteps.MenuItem.TOGGLE_COMPLETED)
|
clickMenu(TOGGLE_COMPLETED)
|
||||||
verifyDisplaysText("Track time")
|
verifyDisplaysText("Track time")
|
||||||
verifyDisplaysText("Wake up early")
|
verifyDisplaysText("Wake up early")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,13 @@ package org.isoron.uhabits.acceptance
|
|||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.LargeTest
|
import androidx.test.filters.LargeTest
|
||||||
import org.isoron.uhabits.BaseUserInterfaceTest
|
import org.isoron.uhabits.BaseUserInterfaceTest
|
||||||
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.clickText
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyOpensWebsite
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyOpensWebsite
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.ABOUT
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.HELP
|
||||||
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.MenuItem.SETTINGS
|
||||||
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
import org.isoron.uhabits.acceptance.steps.ListHabitsSteps.clickMenu
|
||||||
import org.isoron.uhabits.acceptance.steps.WidgetSteps.clickText
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
@@ -36,7 +38,7 @@ class LinksTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldLinkToSourceCode() {
|
fun shouldLinkToSourceCode() {
|
||||||
launchApp()
|
launchApp()
|
||||||
clickMenu(ListHabitsSteps.MenuItem.ABOUT)
|
clickMenu(ABOUT)
|
||||||
clickText("View source code at GitHub")
|
clickText("View source code at GitHub")
|
||||||
verifyOpensWebsite("github.com")
|
verifyOpensWebsite("github.com")
|
||||||
}
|
}
|
||||||
@@ -45,7 +47,7 @@ class LinksTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldLinkToTranslationWebsite() {
|
fun shouldLinkToTranslationWebsite() {
|
||||||
launchApp()
|
launchApp()
|
||||||
clickMenu(ListHabitsSteps.MenuItem.ABOUT)
|
clickMenu(ABOUT)
|
||||||
clickText("Help translate this app")
|
clickText("Help translate this app")
|
||||||
verifyOpensWebsite("translate.loophabits.org")
|
verifyOpensWebsite("translate.loophabits.org")
|
||||||
}
|
}
|
||||||
@@ -54,7 +56,7 @@ class LinksTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldLinkToHelp() {
|
fun shouldLinkToHelp() {
|
||||||
launchApp()
|
launchApp()
|
||||||
clickMenu(ListHabitsSteps.MenuItem.HELP)
|
clickMenu(HELP)
|
||||||
verifyOpensWebsite("github.com")
|
verifyOpensWebsite("github.com")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +64,7 @@ class LinksTest : BaseUserInterfaceTest() {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun shouldLinkToHelpFromSettings() {
|
fun shouldLinkToHelpFromSettings() {
|
||||||
launchApp()
|
launchApp()
|
||||||
clickMenu(ListHabitsSteps.MenuItem.SETTINGS)
|
clickMenu(SETTINGS)
|
||||||
clickText("Help & FAQ")
|
clickText("Help & FAQ")
|
||||||
verifyOpensWebsite("github.com")
|
verifyOpensWebsite("github.com")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ package org.isoron.uhabits.acceptance
|
|||||||
|
|
||||||
import androidx.test.filters.LargeTest
|
import androidx.test.filters.LargeTest
|
||||||
import org.isoron.uhabits.BaseUserInterfaceTest
|
import org.isoron.uhabits.BaseUserInterfaceTest
|
||||||
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.clickText
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.launchApp
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.pressHome
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.pressHome
|
||||||
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDisplaysText
|
import org.isoron.uhabits.acceptance.steps.CommonSteps.verifyDisplaysText
|
||||||
import org.isoron.uhabits.acceptance.steps.WidgetSteps.clickCheckmarkWidget
|
import org.isoron.uhabits.acceptance.steps.WidgetSteps.clickCheckmarkWidget
|
||||||
import org.isoron.uhabits.acceptance.steps.WidgetSteps.clickText
|
|
||||||
import org.isoron.uhabits.acceptance.steps.WidgetSteps.dragCheckmarkWidgetToHomeScreen
|
import org.isoron.uhabits.acceptance.steps.WidgetSteps.dragCheckmarkWidgetToHomeScreen
|
||||||
import org.isoron.uhabits.acceptance.steps.WidgetSteps.verifyCheckmarkWidgetIsShown
|
import org.isoron.uhabits.acceptance.steps.WidgetSteps.verifyCheckmarkWidgetIsShown
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|||||||
@@ -32,15 +32,6 @@ object WidgetSteps {
|
|||||||
BaseUserInterfaceTest.device.findObject(UiSelector().resourceId(viewId)).click()
|
BaseUserInterfaceTest.device.findObject(UiSelector().resourceId(viewId)).click()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Throws(Exception::class)
|
|
||||||
fun clickText(s: String) {
|
|
||||||
var textObject = BaseUserInterfaceTest.device.findObject(UiSelector().text(s))
|
|
||||||
if (!textObject.waitForExists(1000)) {
|
|
||||||
textObject = BaseUserInterfaceTest.device.findObject(UiSelector().text(s.toUpperCase()))
|
|
||||||
}
|
|
||||||
textObject.click()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun dragCheckmarkWidgetToHomeScreen() {
|
fun dragCheckmarkWidgetToHomeScreen() {
|
||||||
openWidgetScreen()
|
openWidgetScreen()
|
||||||
|
|||||||
Reference in New Issue
Block a user