-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'adding-tests' into dev
# Conflicts: # app/src/main/res/layout/activity_home.xml # app/src/main/res/layout/activity_user_profile.xml # app/src/main/res/layout/card_history.xml
- Loading branch information
Showing
20 changed files
with
617 additions
and
60 deletions.
There are no files selected for viewing
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
69 changes: 69 additions & 0 deletions
69
app/src/androidTest/java/com/symphony/mrfit/ui/ExerciseTest.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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Created by Team Symphony on 4/21/23, 10:18 PM | ||
* Copyright (c) 2023 . All rights reserved. | ||
* Last modified 4/21/23, 10:18 PM | ||
*/ | ||
|
||
package com.symphony.mrfit.ui | ||
|
||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.filters.LargeTest | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import com.symphony.mrfit.R | ||
import org.hamcrest.Matchers | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
@LargeTest | ||
class ExerciseTest { | ||
|
||
@Before | ||
fun setUp() { | ||
} | ||
|
||
@get:Rule | ||
var activityScenarioRule = activityScenarioRule<ExerciseActivity>() | ||
|
||
/** | ||
* Test if the activity is displayed and visible to user | ||
*/ | ||
@Test | ||
fun checkActivityVisibility() { | ||
Espresso.onView(ViewMatchers.withId(R.id.layout_exerciseSelectionActivity)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
} | ||
|
||
/** | ||
* Test if all the appropriate components are visible | ||
*/ | ||
@Test | ||
fun checkViewVisibility() { | ||
Thread.sleep(500) | ||
Espresso.onView(ViewMatchers.withId(R.id.exerciseScreenView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.exerciseListView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.exerciseSearchTextView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.exerciseSearchEditText)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.exerciseSearchButton)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.button2)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.loadingSpinner)) | ||
.check(ViewAssertions.matches(Matchers.not(ViewMatchers.isDisplayed()))) | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
app/src/androidTest/java/com/symphony/mrfit/ui/HomeActivityTest.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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Created by Team Symphony on 4/21/23, 10:18 PM | ||
* Copyright (c) 2023 . All rights reserved. | ||
* Last modified 4/21/23, 10:18 PM | ||
*/ | ||
|
||
package com.symphony.mrfit.ui | ||
|
||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.filters.LargeTest | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import com.symphony.mrfit.R | ||
import org.hamcrest.Matchers.not | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
@LargeTest | ||
class HomeActivityTest { | ||
|
||
@Before | ||
fun setUp() { | ||
} | ||
|
||
@get:Rule | ||
var activityScenarioRule = activityScenarioRule<HomeActivity>() | ||
|
||
/** | ||
* Test if the activity is displayed and visible to user | ||
*/ | ||
@Test | ||
fun checkActivityVisibility() { | ||
Espresso.onView(ViewMatchers.withId(R.id.layout_homeActivity)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
} | ||
|
||
/** | ||
* Test if all the appropriate components are visible | ||
*/ | ||
@Test | ||
fun checkViewVisibility() { | ||
Thread.sleep(1000) | ||
Espresso.onView(ViewMatchers.withId(R.id.homeScreenView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.userLayout)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.homeProfilePicture)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.homeWelcomeTextView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.homeNameTextView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
Espresso.onView(ViewMatchers.withId(R.id.homeScreenView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.settingsCog)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.scheduleButton)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.pastWorkout)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.workoutButton)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.historyList)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.loadingSpinner)) | ||
.check(ViewAssertions.matches(not(ViewMatchers.isDisplayed()))) | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
app/src/androidTest/java/com/symphony/mrfit/ui/RegisterActivityTest.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Created by Team Symphony on 4/21/23, 5:08 PM | ||
* Copyright (c) 2023 . All rights reserved. | ||
* Last modified 4/21/23, 4:12 PM | ||
*/ | ||
|
||
package com.symphony.mrfit.ui | ||
|
||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.filters.LargeTest | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import com.symphony.mrfit.R | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
@LargeTest | ||
class RegisterActivityTest { | ||
|
||
@get:Rule | ||
var activityScenarioRule = activityScenarioRule<RegisterActivity>() | ||
|
||
/** | ||
* Test if the activity is displayed and visible to user | ||
*/ | ||
@Test | ||
fun checkActivityVisibility() { | ||
Espresso.onView(ViewMatchers.withId(R.id.layout_registerActivity)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
} | ||
|
||
/** | ||
* Test if all the components are visible | ||
*/ | ||
@Test | ||
fun checkViewVisibility() { | ||
Espresso.onView(ViewMatchers.withId(R.id.registerEmail)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.registerPassword)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.confirmPassword)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.registerButton)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.toLoginTextView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
app/src/androidTest/java/com/symphony/mrfit/ui/TemplateSelectionActivityTest.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Created by Team Symphony on 4/21/23, 10:18 PM | ||
* Copyright (c) 2023 . All rights reserved. | ||
* Last modified 4/21/23, 9:24 PM | ||
*/ | ||
|
||
package com.symphony.mrfit.ui | ||
|
||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.filters.LargeTest | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import com.symphony.mrfit.R | ||
import org.hamcrest.Matchers | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
@LargeTest | ||
class TemplateSelectionActivityTest { | ||
|
||
@Before | ||
fun setUp() { | ||
} | ||
|
||
@get:Rule | ||
var activityScenarioRule = activityScenarioRule<RoutineSelectionActivity>() | ||
|
||
/** | ||
* Test if the activity is displayed and visible to user | ||
*/ | ||
@Test | ||
fun checkActivityVisibility() { | ||
Espresso.onView(ViewMatchers.withId(R.id.layout_selectionActivity)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
} | ||
|
||
/** | ||
* Test if all the appropriate components are visible | ||
*/ | ||
@Test | ||
fun checkViewVisibility() { | ||
Thread.sleep(500) | ||
Espresso.onView(ViewMatchers.withId(R.id.selectionScreenView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.routineListView)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.newWorkoutButton)) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
|
||
Espresso.onView(ViewMatchers.withId(R.id.loadingSpinner)) | ||
.check(ViewAssertions.matches(Matchers.not(ViewMatchers.isDisplayed()))) | ||
} | ||
} |
Oops, something went wrong.