配置Protractor Jasmine Allure报告时,找不到jasmine-allure-reporter中的pom.xml
pom.xml in jasmine-allure-reporter Hey there! Let's get this sorted out right away—you won't find a pom.xml file in \node_modules\jasmine-allure-reporter because it doesn't exist there by design. Here's why, plus the correct way to set up Allure reports for Protractor + Jasmine:
Why no pom.xml?
pom.xml is a configuration file for Maven, a build tool for Java projects. The jasmine-allure-reporter is an npm package built for Node.js/JavaScript test frameworks like Jasmine, so it has no connection to Maven or pom.xml. Chances are you mixed up instructions for Java-based Allure setups with Node.js ones.
Correct Step-by-Step Setup
Let's walk through the proper configuration for your stack:
Install Required Dependencies
First, make sure you have both the reporter and Allure command-line tool installed as dev dependencies:npm install jasmine-allure-reporter allure-commandline --save-devUpdate Protractor Configuration
Open yourprotractor.conf.jsfile and add the Allure reporter setup in theonPreparehook:exports.config = { framework: 'jasmine', // ... other existing configs (specs, capabilities, etc.) onPrepare: function() { const AllureReporter = require('jasmine-allure-reporter'); jasmine.getEnv().addReporter(new AllureReporter({ resultsDir: 'allure-results' // This folder stores raw report data })); } };Run Tests & Generate the Report
- Execute your Protractor tests as usual (e.g.,
npx protractor protractor.conf.js) - After tests finish, generate and open the Allure report with these commands:
npx allure generate allure-results --clean npx allure open
The
--cleanflag ensures old report data is cleared before generating a fresh one.- Execute your Protractor tests as usual (e.g.,
Quick Tip
If you were following a guide that mentioned pom.xml, it was almost certainly for a Java/Selenium setup, not Protractor. Stick to Node.js-specific Allure documentation for your project.
内容的提问来源于stack exchange,提问作者siva

