automationhacks / grasp-reporting

Apache License 2.0
1 stars 0 forks source link

Could you kindly help to work on enable @Step annotation with Gradle configuration? #1

Open ansonliao opened 3 years ago

ansonliao commented 3 years ago

Dear @automationhacks , thanks for your work on provide this sample of ReportPortal of Gradle TestNG, it works fine with your Gradle configuration. I am facing some problem in advance of ReportPortal when want to enable @Step annotation for log the test step, I am running the AspectJ Gradle plugin (https://plugins.gradle.org/plugin/io.freefair.aspectj, and this plugin's document: https://docs.freefair.io/gradle-plugins/6.0.0-m2/reference/#_io_freefair_aspectj) and with the sample code of the ReporPortal official provided (https://github.com/reportportal/examples-java/blob/master/example-testng-logback/src/main/java/com/epam/reportportal/example/testng/logback/step/NestedStepsTest.java#L92), unfortunately the nested step of ReporPortal doesn't work in expects. Could you kindly help to work on enable @Step annotation and provide the fine build.gradle sample?

Just provide my current build.gradle that out of work as below.

Also I have a sample project that the AspectJ plugin and Lomok plugin work's build.gradle configuration (https://github.com/ansonliao/Gradle-AspectJ-Sample/blob/master/build.gradle), please reference if need.

Hope can hear from ASAP.

Thanks.

plugins {
    id 'java'
    id "io.freefair.aspectj" version "5.3.3.3"
}

group 'org.example'
version '1.0-SNAPSHOT'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceSets.main.aspectj.srcDir "src/main/java"
sourceSets.main.java.srcDirs = files()
sourceSets.test.aspectj.srcDir "src/test/java"
sourceSets.test.java.srcDirs = files()
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

repositories {
    mavenCentral()
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    // aspectj
    compile group: 'org.aspectj', name: 'aspectjrt', version: '1.9.6'
    // testng
    compile group: 'org.testng', name: 'testng', version: '7.3.0'
    // selenide
    compile group: 'com.codeborne', name: 'selenide', version: '5.16.2'
    // reporportal
    compile group: 'com.epam.reportportal', name: 'agent-java-testng', version: '5.0.8'
    // logback
    compile group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
    compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
    compile group: 'com.epam.reportportal', name: 'logger-java-logback', version: '5.0.3'
}

tasks.withType(Test) {
    systemProperty('file.encoding', 'UTF-8')
}

tasks.withType(Test) {
    testLogging.showStandardStreams = true
}

test {
    useTestNG() {
        useDefaultListeners = false
        listeners << 'com.epam.reportportal.testng.ReportPortalTestNGListener'
    }
}

aspectj {
    version = '1.9.6'
}
automationhacks commented 3 years ago

While it would take time for me to dig into this. You can try connecting with the report portal team on their Github repo or slack channel for a faster revert.

ansonliao commented 3 years ago

@automationhacks Thanks for your reply, yes I am asking help from the slack channel of ReportPortal.