【问题标题】:Protractor-cucumber Allure report not showing full test resultsProtractor-cucumber Allure 报告未显示完整的测试结果
【发布时间】:2017-03-30 10:02:16
【问题描述】:

我正在运行 Protractor-cucumber 测试并生成魅力报告,报告正在生成,但由于某种原因报告未显示完整的测试结果,我已按照下面“https://www.npmjs.com/package/cucumberjs-allure-reporter”中提到的所有说明进行操作,这是生成的 xml 文件

<ns2:test-suite xmlns:ns2="urn:model.allure.qatools.yandex.ru" start="1490864784836" stop="1490864784933">
    <name>1</name>
    <title>1</title>
    <test-cases>
        <test-case start="1490864784839" stop="1490864784931" status="passed">
            <name>Login and Enter Customer Details</name>
            <title>Login and Enter Customer Details</title>
            <description></description>
            <labels>
            </labels>
            <parameters>
            </parameters>
            <steps>
                <step start="1490864784840" stop="1490864784847" status="passed">
                    <name>I navigate to &quot;http://test.index.html;</name>
                    <title>I navigate to &quot;http://test.index.html;</title>
                    <attachments>
                    </attachments>
                    <steps>
                    </steps>
                </step>
                <step start="1490864784848" stop="1490864784865" status="passed">
                    <name>I login as test</name>
                    <title>I login as test</title>
                    <attachments>
                    </attachments>
                    <steps>
                    </steps>
                </step>
                <step start="1490864784865" stop="1490864784866" status="passed">
                    <name>check whether login is successful</name>
                    <title>check whether login is successful</title>
                    <attachments>
                    </attachments>
                    <steps>
                    </steps>
                </step>
                <step start="1490864784866" stop="1490864784868" status="passed">
                    <name>the protractor api should be available</name>
                    <title>the protractor api should be available</title>
                    <attachments>
                    </attachments>
                    <steps>
                    </steps>
                </step>

下面是reporter.js

var reporter = require('cucumberjs-allure-reporter');
reporter.config(
    {
        targetDir:'./allure-results/'
    }
);
module.exports = reporter;

下面是cucumber-allure的安装细节 npm WARN Calms3@1.0.0 需要一个 cucumber@>= 1.2.0 的对等体,但没有安装。 npm WARN cucumberjs-allure-reporter@1.0.3 需要一个 cucumber@>= 1.2.0 的对等体,但没有安装。 npm WARN grunt-protractor-runner@3.2.0 需要 grunt@>=0.4.0 的对等点,但没有安装。 npm WARN Calms3@1.0.0 没有存储库字段。 npm WARN Calms3@1.0.0 没有许可证字段。

有人可以帮忙吗..

下面是conf.js

exports.config = {

  seleniumAddress: 'http://localhost:4444/wd/hub',

  specs: [
    'features/sample.feature'
  ],

  capabilities: {
    'browserName': 'chrome',
    chromeOptions: {
      args: [
        '--start-maximized'
      ]
    }
  },

  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),

  cucumberOpts: {
    require: 'features/*.js',
    format: 'pretty'
  },
};

包.json

{
  "name": "Calms3",
  "version": "1.0.0",
  "description": "Protractor framework for Cucumber.js",
  "main": "Conf.js",
  "engines": {
    "node": ">=6.9.x"
  },
  "scripts": {
    "webdriver": "webdriver-manager update --standalone --versions.standalone=2.53.1 && webdriver-manager start --versions.standalone=2.53.1"
  },
  "keywords": [
    "angular",
    "test",
    "testing",
    "webdriver",
    "webdriverjs",
    "selenium",
    "protractor",
    "protractor-framework",
    "cucumber",
    "cucumber-js",
    "gherkin",
    "bdd"
  ],
  "peerDependencies": {
    "cucumber": ">= 1.3.0 || >= 2.0.0-rc.0",
    "protractor": ">= 3.0.0"
  },
  "devDependencies": {
    "chai": "3.5.0",
    "chai-as-promised": "6.0.0",
    "eslint": "3.17.1",
    "express": "4.15.2",
    "httpster": "1.0.3",
    "multidep": "2.0.2",
    "protractor": "5.1.1",
    "jasmine-allure-reporter": "1.0.1",
    "jasmine-reporters": "2.2.1",
    "selenium-webdriver": "3.3.0",
    "winston": "2.3.1",
    "protractor-html-screenshot-reporter": "0.0.21",
    "protractor-jasmine2-screenshot-reporter": "0.3.3",
    "protractor-jasmine2-html-reporter": "0.0.7",
    "jasmine-core": "2.5.2",
    "protractor-helpers": "1.1.0",
    "cucumberjs-allure-reporter": "^1.0.3"
  },
  "cucumberConf": {
    "version1": "1.3.1",
    "version2": "2.0.0-rc.8"
  }
}

报告没有显示任何执行的步骤..

【问题讨论】:

  • 您能否提及您的 conf.js 设置以及预期结果是什么?
  • Ram,我在原帖中添加了conf.js文件内容
  • Allure 记者应该生成一个 xml 文件,用于在 jenkins 中显示结果,你能检查一下步骤是否显示在那个 xml 文件中吗?如果没有,那么 allure 记者有什么问题也分享给我你的 package.json 文件
  • 我已经添加了 package.json 并且生成的 xml 粘贴在顶部,我还提到了安装 Allure npm 包时显示的 WARN 消息。

标签: selenium-webdriver protractor cucumberjs allure


【解决方案1】:

啊,我从你的 package.json 中看到,你使用的是 cucumber peerDependency 1.3.0 或 2.0 rc,你看到 allure 记者目前不支持 cucumber 版本 > 2.0。所以你只需要使用cucumber 1.3.0 才能成功生成诱惑报告。

到目前为止,请删除黄瓜 2.0 依赖并仅使用 1.3.0,您将能够看到您的报告。

我相信未来 allure-reporter 会支持最新的黄瓜版本(2.0)

【讨论】:

  • 试过但还是一样,当我检查'npm cucumber --version'时它显示为 4.1.2 ,猜它是量角器-黄瓜版本,请进一步建议我。跨度>
  • 请将 cucumber 1.3.0 和 protractor 安装为依赖项而不是对等依赖项,您的 package.json 应如下所示 - package.json,注意依赖项 protractor 和 cucumber
  • 还是一样,我不确定我缺少什么,我将分享我的项目层次结构和不同的组件。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多