Skip to content

Commit

Permalink
ISSUE-554: Updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikitae57 committed Aug 17, 2023
1 parent 6c93462 commit eb4927b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/Wiki/Kaspresso_Robolectric.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,22 @@ As of Robolectric 4.8.1, there are some limitations to sharedTest: those tests r

1. Robolectric-Espresso supports Idling resources, but [doesn't support posting delayed messages to the Looper](https://github.com/robolectric/robolectric/issues/4807#issuecomment-1075863097)
2. Robolectric-Espresso will not support [tests that start new activities](https://github.com/robolectric/robolectric/issues/5104) (i.e. activity jumping)

#### Pulling the artifacts from the device to the host

Depending on your test configuration, useful artifacts may remain on the device after test finish: screenshots, reports, videos, etc.
In order to pull them off the device special scripts are programmed, which are executed after the completion of the test run on CI. With Kaspresso,
you can simplify this process. To do this, you need to configure the `artifactsPullParams` variable in the Kaspresso Builder. Example:

```kotlin
class SomeTest : TestCase(
kaspressoBuilder = Kaspresso.Builder.simple {
artifactsPullParams = ArtifactsPullParams(enabled = true, destinationPath = "artifacts/", artifactsRegex = Regex("(screenshots)|(videos)"))
}
) {
...
}
```

For this mechanism to work, you need to start the ADB server before running the test. After the test is completed, the artifacts will be located by the path specified in the `destinationPath`
argument relative to the working directory from which the ADB server was launched.
19 changes: 19 additions & 0 deletions docs/Wiki/Kaspresso_configuration.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,22 @@ class EnricherBaseTestCase : BaseTestCase<TestCaseDsl, TestCaseData>(
```

После того, как это будет сделано, описанные вами действия будут выполняться до или после блока ```run``` основной секции.

#### Стягивание артефактов с устройства на хост

В зависимости от вашей конфигурации тестов, после выполнения последних на устройстве могут оставаться полезные артефакты: скриншоты, отчеты, видео и т.д.
Для того, чтобы стянуть их с устройства, как правило, программируют специальные скрипты, которые выполняют после завершения тестового прогона на CI. С Kaspresso
вы можете упростить этот процесс. Для этого в Kaspresso Builder'e необходимо сконфигурировать переменную `artifactsPullParams`. Пример:

```kotlin
class SomeTest : TestCase(
kaspressoBuilder = Kaspresso.Builder.simple {
artifactsPullParams = ArtifactsPullParams(enabled = true, destinationPath = "artifacts/", artifactsRegex = Regex("(screenshots)|(videos)"))
}
) {
...
}
```

Для работы этого механизма перед выполнением теста необходимо запустить ADB server. После завершения теста артефакты будут лежать по указанному в аргументе `destinationPath` пути относительно
рабочей директории, из которой был запущен ADB server.

0 comments on commit eb4927b

Please sign in to comment.