Skip to content

Commit

Permalink
Merge branch 'master' into fixpathwiki
Browse files Browse the repository at this point in the history
  • Loading branch information
el-qq authored Oct 6, 2021
2 parents 70ad0a7 + c546124 commit 8f7a93c
Show file tree
Hide file tree
Showing 131 changed files with 2,299 additions and 707 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Run unit tests
run: make unit_tests
- name: Build project
run: ./gradlew assemble
run: make compile_all
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
static_analysis:
./gradlew detektAll
./gradlew detektAll lint

unit_tests:
./gradlew test
Expand Down
6 changes: 0 additions & 6 deletions allure-model/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions allure-model/build.gradle.kts

This file was deleted.

12 changes: 0 additions & 12 deletions allure-model/src/main/kotlin/io/qameta/allure/model/Attachment.kt

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions allure-model/src/main/kotlin/io/qameta/allure/model/Label.kt

This file was deleted.

12 changes: 0 additions & 12 deletions allure-model/src/main/kotlin/io/qameta/allure/model/Link.kt

This file was deleted.

10 changes: 0 additions & 10 deletions allure-model/src/main/kotlin/io/qameta/allure/model/Parameter.kt

This file was deleted.

16 changes: 0 additions & 16 deletions allure-model/src/main/kotlin/io/qameta/allure/model/Stage.kt

This file was deleted.

26 changes: 0 additions & 26 deletions allure-model/src/main/kotlin/io/qameta/allure/model/Status.kt

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions allure-model/src/main/kotlin/io/qameta/allure/model/TestResult.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 24 additions & 0 deletions allure-support/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
id("convention.android-library")
id("convention.publication-android-lib")
}

publish {
artifactId.set("kaspresso-allure-support")
}

dependencies {
implementation(projects.kaspresso)

implementation(libs.kotlinStdlib)
implementation(libs.truth)
implementation(libs.testCore)
implementation(libs.uiAutomator)
implementation(libs.runner)

implementation(libs.bundles.allure)

testImplementation(libs.junit)

androidTestImplementation(libs.espressoCore)
}
1 change: 1 addition & 0 deletions allure-support/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest package="com.kaspersky.components.alluresupport" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.kaspersky.components.alluresupport

import com.kaspersky.components.alluresupport.interceptors.step.AllureMapperStepInterceptor
import com.kaspersky.components.alluresupport.interceptors.step.ScreenshotStepInterceptor
import com.kaspersky.components.alluresupport.interceptors.testrun.DumpLogcatTestInterceptor
import com.kaspersky.components.alluresupport.interceptors.testrun.DumpViewsTestInterceptor
import com.kaspersky.components.alluresupport.interceptors.testrun.ScreenshotTestInterceptor
import com.kaspersky.components.alluresupport.interceptors.testrun.VideoRecordingTestInterceptor
import com.kaspersky.kaspresso.kaspresso.Kaspresso

fun Kaspresso.Builder.Companion.withAllureSupport(
customize: Kaspresso.Builder.() -> Unit = {}
): Kaspresso.Builder = simple(customize).addAllureSupport()

fun Kaspresso.Builder.addAllureSupport(): Kaspresso.Builder = apply {
stepWatcherInterceptors.addAll(
listOf(
ScreenshotStepInterceptor(screenshots),
AllureMapperStepInterceptor()
)
)
testRunWatcherInterceptors.addAll(
listOf(
DumpLogcatTestInterceptor(logcatDumper),
ScreenshotTestInterceptor(screenshots),
VideoRecordingTestInterceptor(videos),
DumpViewsTestInterceptor(viewHierarchyDumper)
)
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.kaspersky.components.alluresupport.files

import io.qameta.allure.android.AllureAndroidLifecycle
import java.io.File

fun File.attachLogcatToAllureReport(): Unit = AllureAndroidLifecycle.addAttachment(
name = name,
stream = this.inputStream(),
type = "text/plain",
fileExtension = "txt",
)

fun File.attachViewHierarchyToAllureReport(): Unit = AllureAndroidLifecycle.addAttachment(
name = name,
stream = this.inputStream(),
type = "text/xml",
fileExtension = "xml",
)

fun File.attachScreenshotToAllureReport(): Unit = AllureAndroidLifecycle.addAttachment(
name = name,
stream = this.inputStream(),
type = "image/png",
fileExtension = "png",
)

fun File.attachVideoToAllureReport(): Unit = AllureAndroidLifecycle.addAttachment(
name = name,
stream = this.inputStream(),
type = "video/mp4",
fileExtension = "mp4",
)
Loading

0 comments on commit 8f7a93c

Please sign in to comment.