-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ALS-1889 Map language support added and political view updated #97
Open
shah279
wants to merge
29
commits into
aws-geospatial:ALS-1889_map_language_and_political_view_update
Choose a base branch
from
makeen-project:ALS-1889
base: ALS-1889_map_language_and_political_view_update
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
ff114c4
fix: app crash on update endpoint fix
shah272728 65b1540
feat: Places popup updated with new information
shah272728 a0bcca9
feat: code optimize
shah272728 3e2e99a
feat: language support added to map
shah272728 de00ba5
feat: remove VNM from political view listing
shah272728 20f306f
feat: update design on political view
shah272728 d209973
fix: Search result showing wrong distance bug fix
shah272728 4f6c7c3
feat: Add political views for Georgia, Cyprus, Palestine, Greece to t…
shah272728 279af7d
feat: Add political views for Georgia, Cyprus, Palestine, Greece to t…
shah272728 c51ec2e
fix: stringS updated and translated
shah272728 e98220e
fix: minimum zoom level update
shah272728 44e47f4
fix: scooter, truck and walk data load after back press from navigati…
shah272728 c823fd6
fix: Portuguese and Chinese map language change not working bug fix
shah272728 7ed0d2b
fix: zoom level fix, chinese language name changes and removed unused…
shah272728 e31be8c
fix: worked on unit test cases update
shah272728 064e7cc
fix: code optimize
shah272728 28a38e7
fix: code optimize and removed unused strings
shah272728 d178c17
feat: Map language selection added in map style bottom sheet
shah272728 4df872f
fix: map language zh added as second language when zh-Hant selected
shah272728 0efe726
fix: Set english language as first in list
shah272728 1562b5c
fix: bug fixes for simulation and car data not showing
shah272728 48009b1
fix: bug fixes for amazon location info icon not visible in dark mode…
shah272728 ccc6bb4
fix: bug fixes for amazon location info icon click not working in sim…
shah272728 a1b062a
fix: code optimize
shah272728 dee45d7
fix: code optimize
shah272728 125a852
fix: map zoom bug fix
shah272728 1affd03
fix: UI for un-auth simulation scrolling bug fix
shah272728 08a8e2d
fix: duplicate code removed from view-model's
shah272728 278908b
fix: cursor color bug fix
shah272728 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
106 changes: 106 additions & 0 deletions
106
app/src/androidTest/java/com/aws/amazonlocation/ui/main/ExploreFragmentMapLanguageTest.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,106 @@ | ||
package com.aws.amazonlocation.ui.main | ||
|
||
import androidx.test.core.app.ApplicationProvider | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.* | ||
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation | ||
import androidx.test.uiautomator.By | ||
import androidx.test.uiautomator.UiDevice | ||
import androidx.test.uiautomator.UiSelector | ||
import androidx.test.uiautomator.Until | ||
import com.aws.amazonlocation.* | ||
import com.aws.amazonlocation.di.AppModule | ||
import com.aws.amazonlocation.utils.* | ||
import dagger.hilt.android.testing.HiltAndroidTest | ||
import dagger.hilt.android.testing.UninstallModules | ||
import org.hamcrest.CoreMatchers.allOf | ||
import org.junit.Assert | ||
import org.junit.Test | ||
|
||
@UninstallModules(AppModule::class) | ||
@HiltAndroidTest | ||
class ExploreFragmentMapLanguageTest : BaseTestMainActivity() { | ||
|
||
private val uiDevice = UiDevice.getInstance(getInstrumentation()) | ||
|
||
private lateinit var preferenceManager: PreferenceManager | ||
|
||
@Throws(java.lang.Exception::class) | ||
override fun before() { | ||
preferenceManager = PreferenceManager(ApplicationProvider.getApplicationContext()) | ||
preferenceManager.setValue(IS_APP_FIRST_TIME_OPENED, true) | ||
preferenceManager.removeValue(KEY_MAP_NAME) | ||
preferenceManager.removeValue(KEY_MAP_STYLE_NAME) | ||
super.before() | ||
} | ||
|
||
@Test | ||
fun testMapLanguageChangeTest() { | ||
try { | ||
Thread.sleep(DELAY_2000) | ||
val btnContinueToApp = uiDevice.findObject(UiSelector().resourceId("${BuildConfig.APPLICATION_ID}:id/btn_continue_to_app")) | ||
if (btnContinueToApp.exists()) { | ||
btnContinueToApp.click() | ||
Thread.sleep(DELAY_2000) | ||
} | ||
uiDevice.findObject(By.text(WHILE_USING_THE_APP))?.click() | ||
uiDevice.findObject(By.text(WHILE_USING_THE_APP_CAPS))?.click() | ||
uiDevice.findObject(By.text(WHILE_USING_THE_APP_ALLOW))?.click() | ||
uiDevice.findObject(By.text(ALLOW))?.click() | ||
Thread.sleep(DELAY_2000) | ||
enableGPS(ApplicationProvider.getApplicationContext()) | ||
Thread.sleep(DELAY_2000) | ||
uiDevice.wait(Until.hasObject(By.desc(AMAZON_MAP_READY)), DELAY_15000) | ||
|
||
Thread.sleep(DELAY_2000) | ||
|
||
goToMapStyles() | ||
|
||
val clMapLanguage = | ||
onView(withId(R.id.cl_map_language)).check(matches(isDisplayed())) | ||
clMapLanguage.perform(click()) | ||
|
||
Thread.sleep(DELAY_2000) | ||
|
||
val language = | ||
waitForView(allOf(withText(TEST_WORD_LANGUAGE_AR), isDisplayed())) | ||
language?.perform(click()) | ||
|
||
Thread.sleep(DELAY_2000) | ||
|
||
val description = uiDevice.findObject(UiSelector().resourceId("${BuildConfig.APPLICATION_ID}:id/tv_map_language_description")) | ||
Assert.assertTrue(TEST_FAILED_LANGUAGE, description.text.contains(TEST_WORD_LANGUAGE_AR)) | ||
} catch (e: Exception) { | ||
failTest(147, e) | ||
Assert.fail(TEST_FAILED) | ||
} | ||
} | ||
|
||
private fun goToMapStyles() { | ||
val cardMap = waitForView(allOf(withId(R.id.card_map), isDisplayed())) | ||
cardMap?.perform(click()) | ||
|
||
Thread.sleep(DELAY_2000) | ||
swipeUp() | ||
Thread.sleep(DELAY_2000) | ||
} | ||
|
||
private fun swipeUp(): UiDevice? { | ||
// Get the screen dimensions | ||
val screenHeight = getInstrumentation().targetContext.resources.displayMetrics.heightPixels | ||
|
||
// Set the starting point for the swipe (bottom-center of the screen) | ||
val startX = getInstrumentation().targetContext.resources.displayMetrics.widthPixels / 2f | ||
val startY = screenHeight - 100 // Offset from the bottom of the screen | ||
|
||
// Set the ending point for the swipe (top-center of the screen) | ||
val endY = 100 // Offset from the top of the screen | ||
|
||
// Perform the swipe action | ||
val uiDevice = UiDevice.getInstance(getInstrumentation()) | ||
uiDevice.swipe(startX.toInt(), startY, startX.toInt(), endY, 10) | ||
return uiDevice | ||
} | ||
} |
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
85 changes: 85 additions & 0 deletions
85
app/src/androidTest/java/com/aws/amazonlocation/ui/main/SettingsMapLanguageTest.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,85 @@ | ||
package com.aws.amazonlocation.ui.main | ||
|
||
import androidx.test.core.app.ApplicationProvider | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.* | ||
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation | ||
import androidx.test.uiautomator.By | ||
import androidx.test.uiautomator.UiDevice | ||
import androidx.test.uiautomator.UiSelector | ||
import androidx.test.uiautomator.Until | ||
import com.aws.amazonlocation.* | ||
import com.aws.amazonlocation.di.AppModule | ||
import com.aws.amazonlocation.utils.* | ||
import dagger.hilt.android.testing.HiltAndroidTest | ||
import dagger.hilt.android.testing.UninstallModules | ||
import org.hamcrest.CoreMatchers.allOf | ||
import org.hamcrest.core.AllOf | ||
import org.junit.Assert | ||
import org.junit.Test | ||
|
||
@UninstallModules(AppModule::class) | ||
@HiltAndroidTest | ||
class SettingsMapLanguageTest : BaseTestMainActivity() { | ||
|
||
private val uiDevice = UiDevice.getInstance(getInstrumentation()) | ||
|
||
private lateinit var preferenceManager: PreferenceManager | ||
|
||
@Throws(java.lang.Exception::class) | ||
override fun before() { | ||
preferenceManager = PreferenceManager(ApplicationProvider.getApplicationContext()) | ||
preferenceManager.setValue(IS_APP_FIRST_TIME_OPENED, true) | ||
super.before() | ||
} | ||
|
||
@Test | ||
fun testSettingsMapPoliticalViewTest() { | ||
Thread.sleep(DELAY_2000) | ||
|
||
uiDevice.wait(Until.hasObject(By.desc(AMAZON_MAP_READY)), DELAY_15000) | ||
Thread.sleep(DELAY_2000) | ||
|
||
goToMapStyles() | ||
|
||
val clPoliticalView = | ||
onView(withId(R.id.cl_map_language)).check(matches(isDisplayed())) | ||
clPoliticalView.perform(click()) | ||
|
||
Thread.sleep(DELAY_2000) | ||
|
||
val language = | ||
waitForView(allOf(withText(TEST_WORD_LANGUAGE_BO), isDisplayed())) | ||
language?.perform(click()) | ||
|
||
Thread.sleep(DELAY_2000) | ||
|
||
val description = uiDevice.findObject(UiSelector().resourceId("${BuildConfig.APPLICATION_ID}:id/tv_map_language_description")) | ||
Assert.assertTrue(TEST_FAILED_LANGUAGE, description.text.contains(TEST_WORD_LANGUAGE_BO)) | ||
} | ||
|
||
private fun goToMapStyles() { | ||
waitForView( | ||
AllOf.allOf( | ||
withText(mActivityRule.activity.getString(R.string.menu_setting)), | ||
isDescendantOfA(withId(R.id.bottom_navigation_main)), | ||
isDisplayed() | ||
) | ||
) | ||
?.perform(click()) | ||
|
||
Thread.sleep(DELAY_3000) | ||
|
||
waitForView( | ||
AllOf.allOf( | ||
withId(R.id.cl_map_style), | ||
isDisplayed() | ||
) | ||
) | ||
?.perform(click()) | ||
|
||
Thread.sleep(DELAY_3000) | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/aws/amazonlocation/data/response/LanguageData.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,7 @@ | ||
package com.aws.amazonlocation.data.response | ||
|
||
data class LanguageData( | ||
val value: String, | ||
val label: String, | ||
var isSelected: Boolean = false | ||
) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these 2 second sleeps the only way we can verify it is safe to move to the next step, or is there event-based mechanism?