Skip to content

Commit

Permalink
Merge pull request #297 from eakurnikov/fix_allure_lifecycle_call
Browse files Browse the repository at this point in the history
Call property Allure.lifecycle instead of direct call to object Allur…
  • Loading branch information
eakurnikov authored Oct 17, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 10d59d0 + b7054a1 commit dbb9a7d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package com.kaspersky.components.alluresupport.files

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

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

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

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

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

0 comments on commit dbb9a7d

Please sign in to comment.