Skip to content

Commit

Permalink
Merge pull request #402 from KasperskyLab/issue-348/Add_google_maps_i…
Browse files Browse the repository at this point in the history
…nteraction_doc

#348: Add google maps interaction docs
  • Loading branch information
Nikitae57 authored Oct 31, 2022
2 parents cdba90e + 32a1b36 commit 392a490
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wiki/04_How_to_write_autotests.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ Finally, let's look at all available Test DSL in Kaspresso:
You can have a look at examples of how to [use and configure Kaspresso](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/configurator_tests)
and how to [use different forms of DSL](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/dsl_tests).

#### Google maps interaction
To interact with google maps through Kaspresso you need to define your screen like below. Please, notice that map elements and map itself are found using **withContentDescription** qualifier.
```kotlin
object MapsScreen : KScreen<MapsScreen>() {
override val layoutId: Int? = R.layout.activity_maps
override val viewClass: Class<*>? = MapsActivity::class.java

val map: UiView = UiView { withContentDescription("Sample Map Content Description") }
val marker: UiView = UiView { withContentDescription(Pattern.compile(".*Sample Marker Title.*")) }
}
```

### Sweet additional features

#### Some words about *BaseTestContext* method
Expand Down

0 comments on commit 392a490

Please sign in to comment.