HTML-репорт документ не генерится в связке Appium + Allure

Хай всем.
Возникла проблема по генерированию индекс дока после прохождения тестов. B папка ‘targe/allure-results’ появляются xml-ки. Но как сгенерить html не знаю.
Gradlew site вЬІдает что “Task ‘site’ not found in project ‘:w2mo-appium-tests’.”
build.gradle вЬІглядит так:

configurations {
    agent
}

defaultTasks 'clean', 'test'

dependencies {
    agent 'org.aspectj:aspectjweaver:1.8.9'
    compile 'io.appium:java-client:4.0.0'
    compile 'org.testng:testng:6.9.10'
    compile 'org.slf4j:slf4j-simple:1.7.21'
    compile 'org.slf4j:slf4j-api:1.7.21'

    testCompile "ru.yandex.qatools.allure:allure-testng-adaptor:1.5.0.RC2"
    testCompile("org.testng:testng:$testingVersion") {
        exclude(module: 'junit')
        exclude(module: 'bsh')
        exclude(module: 'snakeyaml')
    }
}
test.doFirst {
    jvmArgs "-javaagent:${configurations.agent.singleFile}"
}

test {
    useTestNG(){
        suiteXmlFiles << new File(rootDir, "test-file-name.xml")
    }
}

Тебе нужен плагин GitHub - d10xa/gradle-allure-plugin: Gradle plugin generating Allure report from test results

Вот мой проект в котором все подключено https://github.com/SergeyPirogov/practical_test/blob/master/build.gradle

Все, теперь даже xml не сгенерились :joy:
пе.се. ТестЬІ прошли ок
build.gralde:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "ru.d10xa:gradle-allure-plugin:0.5.0"
    }
}

apply plugin: 'java'
apply plugin: 'ru.d10xa.allure'
apply plugin: 'idea'

allure {
    aspectjweaver = true
    junit = true
    allureResultsDir = "$buildDir/allure-results"
    allureReportDir = "$buildDir/allure-report"
}

dependencies {
    compile project(':w2mo-utils')
    testCompile("org.testng:testng:$testingVersion") {
        exclude(module: 'junit')
        exclude(module: 'bsh')
        exclude(module: 'snakeyaml')
    }
    compile 'io.appium:java-client:4.0.0'
    compile 'org.testng:testng:6.9.10'
    compile 'org.apache.commons:commons-io:1.3.2'
    compile 'commons-httpclient:commons-httpclient:3.1'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.4'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
    compile 'org.hamcrest:hamcrest-all:1.3'
    compile 'org.springframework:spring-web:3.0.2.RELEASE'
    compile 'org.apache.logging.log4j:log4j-core:2.7'
    compile 'ru.yandex.qatools.allure:allure-java-annotations:1.4.23'
    compile 'ru.qatools.commons:properties:2.0.RC5'
}

test {
    ignoreFailures = true
    testLogging.exceptionFormat = 'full'
    testLogging {
        events "passed", "skipped", "failed"
    }
    systemProperties System.properties
}

tasks.withType(Test)*.finalizedBy allureReport

Ты их через gradle test запускаешь или из IDE?

через IDE. Только что попробовал через gradlew test:

:w2mo-appium-tests:test
:w2mo-appium-tests:allureReport
Exception in thread "main" ru.yandex.qatools.allure.data.ReportGenerationException: Could not find any allure results
        at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
        at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
        at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
:w2mo-appium-tests:allureReport FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':w2mo-appium-tests:allureReport'.

В блоке allure замени junit=true на junit=false
testng=true

1 лайк

И проверь лучше дополнительно, есть ли папка allure-result после прогона тестов

1 лайк

Да, заработало. Спасибо всем.

build.gradle

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "ru.d10xa:gradle-allure-plugin:0.5.5"
    }
}

apply plugin: 'java'
apply plugin: 'ru.d10xa.allure'
apply plugin: 'idea'

allure {
    aspectjweaver = true
    testNG = true
}
dependencies {
    compile 'io.appium:java-client:4.0.0'
    compile 'org.testng:testng:6.9.10'
    compile 'org.apache.logging.log4j:log4j-core:2.6.1'
    compile 'ru.qatools.commons:properties:2.0.RC5'
    compile 'org.slf4j:slf4j-simple:1.7.21'
    compile 'ru.yandex.qatools.allure:allure-testng-adaptor:1.4.24.RC3'
    testCompile("org.testng:testng:$testingVersion") {
        exclude(module: 'junit')
        exclude(module: 'bsh')
        exclude(module: 'snakeyaml')
    }
}

test {
    useTestNG() {
        suites 'crm/tests/test-suite-file.xml'
    }
    ignoreFailures = true
    testLogging.exceptionFormat = 'full'
    testLogging {
        events "passed", "skipped", "failed"
    }
    systemProperties System.properties
}

tasks.withType(Test)*.finalizedBy allureReport