Skip to content

Commit

Permalink
Fix allure report
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-tiurin committed Jun 21, 2024
1 parent cb6c9f2 commit fbaec7a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
11 changes: 6 additions & 5 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ const config: Config = {
},
{
href: 'https://github.com/open-tool/ultron',
label: 'GitHub',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
{
type: 'search',
Expand All @@ -86,10 +87,10 @@ const config: Config = {
contextualSearch: true,

// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
replaceSearchResultPathname: {
from: '/docs/', // or as RegExp: /\/docs\//
to: '/',
},
// replaceSearchResultPathname: {
// from: '/docs/', // or as RegExp: /\/docs\//
// to: '/',
// },

// Optional: Algolia search parameters
searchParameters: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object AssertUtils {
try {
block()
} catch (ex: Throwable) {
// throw ex
throw ex
exceptionOccurs = true
}
Assert.assertEquals(expected, exceptionOccurs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.atiurin.ultron.allure.runner
import com.atiurin.ultron.extensions.createDirectoryIfNotExists
import com.atiurin.ultron.log.UltronLog
import com.atiurin.ultron.runner.UltronRunListener
import org.junit.runner.Description
import org.junit.runner.Result
import java.io.File
import kotlin.system.measureTimeMillis
Expand All @@ -12,7 +13,15 @@ import kotlin.system.measureTimeMillis
* to custom directory [targetDir] provided by user [UltronAllureConfig.setAllureResultsDirectory]
*/
class UltronAllureResultsTransferListener(private val sourceDir: File, private val targetDir: File) : UltronRunListener() {
override fun testFinished(description: Description) {
transferFiles()
}

override fun testRunFinished(result: Result) {
transferFiles()
}

private fun transferFiles(){
UltronLog.info("Copy Allure results from '${sourceDir.absolutePath}' to '${targetDir.absolutePath}'")
targetDir.createDirectoryIfNotExists()
var isSuccessfullyCopied = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object UltronConfig {
Espresso.ASSERTION_TIMEOUT = params.operationTimeoutMs
UltronCommonConfig.addListener(LogLifecycleListener())
if (params.logToFile) {
UltronLog.addLogger(getFileLogger())
UltronLog.addLogger(UltronLog.fileLogger)
} else {
UltronLog.removeLogger(UltronLog.fileLogger.id)
}
Expand Down

0 comments on commit fbaec7a

Please sign in to comment.