From 32a1b366bd13382d0edb500cc60d3fcd9c39a053 Mon Sep 17 00:00:00 2001 From: Nikita Evdokimov Date: Sun, 30 Oct 2022 21:10:48 +0300 Subject: [PATCH] 348: Add google maps interaction docs --- wiki/04_How_to_write_autotests.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wiki/04_How_to_write_autotests.md b/wiki/04_How_to_write_autotests.md index 62f0aa7b6..54067bd31 100644 --- a/wiki/04_How_to_write_autotests.md +++ b/wiki/04_How_to_write_autotests.md @@ -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() { + 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