Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find pom.xml file inside allure reporter folder

I am trying to generate html reports out of allure results using mvn command. As per the documentation, it needs pom.xml file inside node_modules/jasmine-allure-reporter folder.

I saw many tutorials but when i go to that folder, pom.xml is not there. Please direct me with correct steps.

like image 853
Sumit Rohankar Avatar asked Nov 26 '25 17:11

Sumit Rohankar


2 Answers

I'm having the same problem.

create a pom.xml file and put this inside it,this is the file you would generate after npm install, but it is not generating more

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ru.yandex.allure</groupId>
    <artifactId>protractor-allure-plugin-generate-html</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <allure.version>1.4.15</allure.version>
        <allure.maven.version>2.2</allure.maven.version>
        <!-- Relative to the dir you're running from -->
        <allure.results_pattern>allure-results</allure.results_pattern>
    </properties>
    <dependencies>
        <dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-report-face</artifactId>
            <version>${allure.version}</version>
            <type>war</type>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.10.v20150310</version>
                <configuration>
                    <webAppSourceDirectory>target/site/allure-maven-plugin</webAppSourceDirectory>
                    <stopKey>stop</stopKey>
                    <stopPort>2299</stopPort>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <plugin>
                <groupId>ru.yandex.qatools.allure</groupId>
                <artifactId>allure-maven-plugin</artifactId>
                <version>${allure.maven.version}</version>
                <configuration>
                    <resultsPattern>${allure.results_pattern}</resultsPattern>
                    <!--<reportVersion>1.4.15</reportVersion>-->
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>
like image 135
Dantinho Avatar answered Nov 28 '25 08:11

Dantinho


The documentation references a ready-to-use pom.xml file. But this is removed as part of this code commit

We can generate allure report by using Allure Command Line Tool

You can add that dependency in your current project by running the following npm command

npm install allure-commandline --save-dev

After this, add a "posttest":"allure generate allure-results --clean -o allure-report" part in the scripts section of your package.json file.

When you are running the test by using npm test, the command mentioned in posttest will execute and generate the report in the report directory.

  "scripts": {
      "pretest": "rm -rf allure-report",
      "test": "protractor conf.js",
      "posttest": "allure generate allure-results --clean -o allure-report || true"
  }

The pretest section is removing previously generated test result folder.

Sometimes npm test doesn't trigger posttest section when it failed. Added bash || operator in the posttest section to avoid this.

like image 32
jithinkmatthew Avatar answered Nov 28 '25 07:11

jithinkmatthew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!