-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kyle Corry <kylecorry31@gmail.com>
- Loading branch information
1 parent
0e250ad
commit 90b2cc3
Showing
2 changed files
with
67 additions
and
43 deletions.
There are no files selected for viewing
83 changes: 42 additions & 41 deletions
83
.../androidTest/java/com/kylecorry/trail_sense/tools/survival_guide/ToolSurvivalGuideTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
package com.kylecorry.trail_sense.tools.survival_guide | ||
|
||
import com.kylecorry.trail_sense.R | ||
import com.kylecorry.trail_sense.test_utils.AutomationLibrary.click | ||
import com.kylecorry.trail_sense.test_utils.AutomationLibrary.clickOk | ||
import com.kylecorry.trail_sense.test_utils.AutomationLibrary.hasText | ||
import com.kylecorry.trail_sense.test_utils.AutomationLibrary.isVisible | ||
import com.kylecorry.trail_sense.test_utils.AutomationLibrary.scrollToEnd | ||
import com.kylecorry.trail_sense.test_utils.TestUtils.back | ||
import com.kylecorry.trail_sense.test_utils.TestUtils.context | ||
import com.kylecorry.trail_sense.test_utils.ToolTestBase | ||
import com.kylecorry.trail_sense.tools.survival_guide.domain.Chapters | ||
import com.kylecorry.trail_sense.tools.tools.infrastructure.Tools | ||
import org.junit.Test | ||
|
||
class ToolSurvivalGuideTest : ToolTestBase(Tools.SURVIVAL_GUIDE) { | ||
@Test | ||
fun verifyBasicFunctionality() { | ||
// Accept the disclaimer | ||
clickOk() | ||
|
||
isVisible(R.id.survival_guide_list_title) | ||
|
||
// Verify it shows each chapter | ||
val chapters = Chapters.getChapters(context) | ||
chapters.forEachIndexed { index, chapter -> | ||
if (index > 6) { | ||
scrollToEnd(R.id.survival_guide_chapters_list) | ||
} | ||
|
||
click(chapter.title) | ||
|
||
// Wait for the chapter to load | ||
hasText(R.id.guide_name, chapter.title) | ||
hasText(R.id.guide_scroll) { it.isNotEmpty() } | ||
click("Be prepared") | ||
|
||
back() | ||
} | ||
} | ||
} | ||
// TODO: Re-enable this test | ||
//package com.kylecorry.trail_sense.tools.survival_guide | ||
// | ||
//import com.kylecorry.trail_sense.R | ||
//import com.kylecorry.trail_sense.test_utils.AutomationLibrary.click | ||
//import com.kylecorry.trail_sense.test_utils.AutomationLibrary.clickOk | ||
//import com.kylecorry.trail_sense.test_utils.AutomationLibrary.hasText | ||
//import com.kylecorry.trail_sense.test_utils.AutomationLibrary.isVisible | ||
//import com.kylecorry.trail_sense.test_utils.AutomationLibrary.scrollToEnd | ||
//import com.kylecorry.trail_sense.test_utils.TestUtils.back | ||
//import com.kylecorry.trail_sense.test_utils.TestUtils.context | ||
//import com.kylecorry.trail_sense.test_utils.ToolTestBase | ||
//import com.kylecorry.trail_sense.tools.survival_guide.domain.Chapters | ||
//import com.kylecorry.trail_sense.tools.tools.infrastructure.Tools | ||
//import org.junit.Test | ||
// | ||
//class ToolSurvivalGuideTest : ToolTestBase(Tools.SURVIVAL_GUIDE) { | ||
// @Test | ||
// fun verifyBasicFunctionality() { | ||
// // Accept the disclaimer | ||
// clickOk() | ||
// | ||
// isVisible(R.id.survival_guide_list_title) | ||
// | ||
// // Verify it shows each chapter | ||
// val chapters = Chapters.getChapters(context) | ||
// chapters.forEachIndexed { index, chapter -> | ||
// if (index > 6) { | ||
// scrollToEnd(R.id.survival_guide_chapters_list) | ||
// } | ||
// | ||
// click(chapter.title) | ||
// | ||
// // Wait for the chapter to load | ||
// hasText(R.id.guide_name, chapter.title) | ||
// hasText(R.id.guide_scroll) { it.isNotEmpty() } | ||
// click("Be prepared") | ||
// | ||
// back() | ||
// } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters