mirror of
https://github.com/hmalik144/Weather-apps.git
synced 2026-03-18 15:36:04 +00:00
Lint fixes (#19)
- Code inspection - Redundant resources removed - Resources moved the corresponding flavours - Deprecated dependencies upgraded - lint changes - circleci updated to capture screenshot
This commit is contained in:
@@ -8,7 +8,7 @@ import androidx.test.espresso.matcher.ViewMatchers
|
||||
import com.appttude.h_mal.atlas_weather.BaseTest
|
||||
import com.appttude.h_mal.atlas_weather.ui.MainActivity
|
||||
|
||||
open class MonoBaseTest: BaseTest<MainActivity>(MainActivity::class.java) {
|
||||
open class MonoBaseTest : BaseTest<MainActivity>(MainActivity::class.java) {
|
||||
|
||||
override fun afterLaunch() {
|
||||
// Dismiss dialog on start up
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.appttude.h_mal.monoWeather.robot
|
||||
|
||||
import com.appttude.h_mal.atlas_weather.R
|
||||
import com.appttude.h_mal.atlas_weather.BaseTestRobot
|
||||
import com.appttude.h_mal.atlas_weather.R
|
||||
|
||||
fun homeScreen(func: HomeScreenRobot.() -> Unit) = HomeScreenRobot().apply { func() }
|
||||
class HomeScreenRobot : BaseTestRobot() {
|
||||
fun verifyCurrentTemperature(temperature: Int) = matchText(R.id.temp_main_4, temperature.toString())
|
||||
fun verifyCurrentTemperature(temperature: Int) =
|
||||
matchText(R.id.temp_main_4, temperature.toString())
|
||||
|
||||
fun verifyCurrentLocation(location: String) = matchText(R.id.location_main_4, location)
|
||||
fun refresh() = pullToRefresh(R.id.swipe_refresh)
|
||||
fun isDisplayed() = matchViewWaitFor(R.id.temp_main_4)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.appttude.h_mal.monoWeather.robot
|
||||
|
||||
import com.appttude.h_mal.atlas_weather.R
|
||||
import com.appttude.h_mal.atlas_weather.BaseTestRobot
|
||||
import com.appttude.h_mal.atlas_weather.R
|
||||
|
||||
fun widgetPermissionScreen(func: WidgetPermissionScreenRobot.() -> Unit) =
|
||||
WidgetPermissionScreenRobot().apply { func() }
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.appttude.h_mal.monoWeather.tests
|
||||
|
||||
|
||||
import com.appttude.h_mal.monoWeather.robot.homeScreen
|
||||
import com.appttude.h_mal.atlas_weather.utils.Stubs
|
||||
import com.appttude.h_mal.monoWeather.MonoBaseTest
|
||||
import com.appttude.h_mal.monoWeather.robot.homeScreen
|
||||
import org.junit.Test
|
||||
|
||||
class HomePageUITest : MonoBaseTest() {
|
||||
@@ -15,6 +15,7 @@ class HomePageUITest : MonoBaseTest() {
|
||||
@Test
|
||||
fun loadApp_validWeatherResponse_returnsValidPage() {
|
||||
homeScreen {
|
||||
isDisplayed()
|
||||
verifyCurrentTemperature(2)
|
||||
verifyCurrentLocation("Mock Location")
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.appttude.h_mal.monoWeather.tests
|
||||
|
||||
import android.appwidget.AppWidgetManager
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.test.rule.ActivityTestRule
|
||||
import com.appttude.h_mal.atlas_weather.BaseTest
|
||||
import com.appttude.h_mal.monoWeather.robot.widgetPermissionScreen
|
||||
import com.appttude.h_mal.monoWeather.ui.widget.WidgetLocationPermissionActivity
|
||||
|
||||
Reference in New Issue
Block a user