Closed amrsa1 closed 9 months ago
@Amrkamel1 plz format you message, it's just impossible to read. And also, would be nice if you could provide small git project where this error occurs.
Closed as stale. Please create a GitHub discussion if the feature is still needed.
im trying to attach steps and screenshot to my allure report but no use, im using testng and aspectj plugin, however parameters in testng.xml file are appearing normally
but screenshot and steps are not
here is mu build.gradle
`plugins { id 'java' id 'ru.vyarus.quality' version '2.2.0' id "io.qameta.allure" version "2.7.0" }
apply plugin: "java-gradle-plugin" apply plugin: "com.gradle.plugin-publish" apply plugin: 'java' apply plugin: 'idea' apply plugin: "io.qameta.allure"
gradlePlugin { plugins { aspectjBase { id = "io.freefair.aspectj.base" implementationClass = "io.freefair.gradle.plugins.AspectJBasePlugin" } aspectjPostCompileWeaving { id = "io.freefair.aspectj.post-compile-weaving" implementationClass = "io.freefair.gradle.plugins.AspectJPostCompileWeavingPlugin" } aspectjCompileTimeWeaving { id = "io.freefair.aspectj.compile-time-weaving" implementationClass = "io.freefair.gradle.plugins.AspectJCompileTimeWeavingPlugin" }
}
pluginBundle { tags = ['aspectj']
}
group = 'newProject' version = '1.0-SNAPSHOT'
description = "Appium automation test"
sourceCompatibility = 1.8 targetCompatibility = 1.8 tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
configurations { agent }
test.doFirst { jvmArgs "-javaagent:${configurations.agent.singleFile}" }
dependencies { testImplementation 'junit:junit:4.12' implementation group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.4' implementation group: 'org.aspectj', name: 'aspectjrt', version: '1.9.4' implementation group: 'org.aspectj', name: 'aspectjtools', version: '1.9.4' agent "org.aspectj:aspectjweaver:1.9.4" compile group: 'org.testng', name: 'testng', version: '6.14.3' compile group: 'io.appium', name: 'java-client', version: '7.0.0' testImplementation group: 'org.slf4j', name: 'slf4j-nop', version: '1.7.26' compile group: 'ru.yandex.qatools.ashot', name: 'ashot', version: '1.5.4' compile group: 'io.qameta.allure', name: 'allure-testng', version: '2.11.0' implementation group: 'io.qameta.allure', name: 'allure-junit4', version: '2.11.0' compileClasspath "io.qameta.allure:allure-gradle:2.7.0" implementation group: 'org.seleniumhq.selenium', name: 'selenium-server', version: '3.141.59' implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59' implementation group: 'org.seleniumhq.selenium', name: 'selenium-remote-driver', version: '3.141.59' }
test { useTestNG() { scanForTestClasses = false suites 'src/testng.xml' ignoreFailures = true } testLogging { events "PASSED", "STARTED", "FAILED", "SKIPPED" } systemProperty 'env', System.getProperty('env', 'all') }
allure { autoconfigure = true version = '2.7' useTestNG { version = '2.11.0' } }
idea { module { downloadJavadoc = true downloadSources = true } }
`
`// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { repositories { google() jcenter() maven { url "https://plugins.gradle.org/m2/" }
}
allprojects { repositories { google() jcenter()
}
task clean(type: Delete) { delete rootProject.buildDir } `
tesntng xml in that attached screenshot
TestListener class
`package Tests.listener; import org.apache.commons.io.FileUtils; import org.aspectj.lang.annotation.Aspect; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.testng.ITestContext; import org.testng.ITestListener; import org.testng.ITestResult; import org.testng.annotations.Listeners;
import java.io.File; import java.io.IOException;
import java.text.SimpleDateFormat; import java.util.Date;
import Tests.LandingPageTest;
import io.appium.java_client.android.AndroidDriver;
import io.qameta.allure.Attachment;
@Aspect @Listeners public class TestListener extends LandingPageTest implements ITestListener {
// System.out.println("Screenshot is captured"); return SrcFile;
}