Jenkins not able to identify the correct directory for the generated allure report xml file

后端 未结 2 593
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-22 09:37

I have integrated successfully Allure report to my maven based testNG project and able to see that report using the jetty server. But now I am trying to integrate the allure rep

2条回答
  •  失恋的感觉
    2021-01-22 09:54

    You need to fetch your Allure results path from your Maven project to Jenkins from project.name\target\allure-results and add it in Jenkins\Your Job\Configure\Allure Report\Result.

    After that you will need to change Jenkins security setting in one of 2 ways.

    By starting Jenkins from:

    java 
    -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';" 
    -Djenkins.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';"
    -jar jenkins.war
    

    By running this two scripts in http://Jenkins/script

    System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';")
    
    System.setProperty("jenkins.model.DirectoryBrowserSupport.CSP", "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';")
    

    edit: I just found 3rd way to do this. In your Jenkins folder open jenkins.XML and add

    -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';" -Djenkins.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';" 
    

    to arguments.

    Edit:

    pom.XML you asked for:

    
      4.0.0
      com.siba
      com.siba.selenium
      0.0.1-SNAPSHOT
      selenium tests
      selenium tests
    
      
    
    
        
            central
            bintray
            http://jcenter.bintray.com
        
    
    
    jar
    
    
        1.7.4
        1.4.23
    
    
    
    
        
            ru.yandex.qatools.allure
            allure-testng-adaptor
            ${allure.version}
        
    
        
            org.testng
            testng
            6.9.10
            test
        
    
        
            org.seleniumhq.selenium
            selenium-java
            2.53.0
        
    
         
            com.microsoft.sqlserver 
            sqljdbc4 
            4.0
            runtime
         
    
    
    
    
        
    
            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.5.1
                
                    1.8
                    1.8
                
            
    
            
                org.apache.maven.plugins
                maven-surefire-plugin
                2.14
                
                    false
                    
                        -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
                    
                
                
                    
                        org.aspectj
                        aspectjweaver
                        ${aspectj.version}
                    
                
            
    
         
    
    
    

提交回复
热议问题