Skip to content

Commit

Permalink
androidTest: add work-around for missing testLocale, remove unavailab…
Browse files Browse the repository at this point in the history
…le networks
  • Loading branch information
ialokim committed Nov 14, 2023
1 parent e16b58a commit 6608249
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions app/src/androidTest/java/de/grobox/transportr/ScreengrabTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,13 @@ abstract class ScreengrabTest {
Screengrab.setDefaultScreenshotStrategy(UiAutomatorScreenshotStrategy())
}

val networkId: NetworkId = when(Locale.forLanguageTag(getTestLocale())) {
val networkId: NetworkId = when(Locale.forLanguageTag(getTestLocale() ?: "de")) {
Locale.FRANCE -> NetworkId.PARIS
Locale.US -> NetworkId.TLEM
Locale.forLanguageTag("pt-BR") -> NetworkId.BRAZIL
else -> NetworkId.DB
}

val departureStation = when(networkId) {
NetworkId.PARIS -> "Gare De Lyon"
NetworkId.TLEM -> "Waterloo Station"
NetworkId.BRAZIL -> "Republica"
else -> "Berlin Hbf"
}

Expand All @@ -72,18 +68,6 @@ abstract class ScreengrabTest {
2 -> WrapLocation(STATION, "stop_area:OIF:SA:8727100", 48880372, 2356597, null, "Gare Du Nord", null)
else -> throw RuntimeException()
}
NetworkId.TLEM -> when(i) {
0 -> WrapLocation(STATION, "1000119", 51503449, -152036, "London", "Hyde Park Corner", null)
1 -> getLocation("Blackfriars Pier")
2 -> getLocation("Moorgate")
else -> throw RuntimeException()
}
NetworkId.BRAZIL -> when(i) {
0 -> WrapLocation(STATION, "stop_point:OSA:SP:2600672", -23555071, -46662131, "São Paulo", "Paulista", null)
1 -> getLocation("Pinheiros")
2 -> getLocation("Vila Madalena")
else -> throw RuntimeException()
}
else -> when(i) {
0 -> WrapLocation(STATION, "8011155", 52521481, 13410962, null, "Berlin Alexanderplatz", null)
1 -> getLocation("Zoologischer Garten")
Expand All @@ -99,18 +83,6 @@ abstract class ScreengrabTest {
2 -> WrapLocation(STATION, "stop_area:OIF:SA:59290", 48866800, 2334338, "Paris", "Pyramides", null)
else -> throw RuntimeException()
}
NetworkId.TLEM -> when(i) {
0 -> WrapLocation(STATION, "1000238", 51509829, -76797, "London", "Tower Hill", null)
1 -> getLocation("Westminster")
2 -> getLocation("Temple")
else -> throw RuntimeException()
}
NetworkId.BRAZIL -> when(i) {
0 -> WrapLocation(STATION, "stop_point:OSA:SP:18876", -23543118, -46589599, "São Paulo", "Belem", null)
1 -> getLocation("Trianon Masp")
2 -> getLocation("Anhangabaú")
else -> throw RuntimeException()
}
else -> when(i) {
0 -> WrapLocation(STATION, "730874", 52507278, 13331992, null, "Checkpoint Charlie", null)
1 -> getLocation("Bundestag")
Expand Down

0 comments on commit 6608249

Please sign in to comment.