0
votes

Iam Running Protractor-cucumber tests and generating allure reports ,report is getting generated but for some reason report is not displaying full test results, i have followed all the instructions as mentioned in 'https://www.npmjs.com/package/cucumberjs-allure-reporter' below is the xml file generated

<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>

and below is the reporter.js

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

Below is the cucumber-allure installation details npm WARN [email protected] requires a peer of cucumber@>= 1.2.0 but none was installed. npm WARN [email protected] requires a peer of cucumber@>= 1.2.0 but none was installed. npm WARN [email protected] requires a peer of grunt@>=0.4.0 but none was installed. npm WARN [email protected] No repository field. npm WARN [email protected] No license field.

can somebody please help on this..

Below is the 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'
  },
};

Package.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"
  }
}

report doesn't show anything on steps executed..

1
Can you mention your conf.js settings and what is the expected result? - Ram Pasala
Ram, i have added the conf.js file content in original post - chandra
Allure reporter should generate an xml file, which it consumes to display the results in jenkins, Can you check if the steps are displayed in that xml file or not? if not then something wrong with allure reporter also share me your package.json file - Ram Pasala
I have added the package.json and xml generated is pasted on the top, i have also mentioned WARN messages displayed when it Allure npm package is intalled. - chandra

1 Answers

0
votes

Ahh I see from your package.json, you are using cucumber peerDependency 1.3.0 or 2.0 rc, You see allure reporter currently doesn't support cucumber version > 2.0. So you have to use cucumber 1.3.0 only to generate allure reports successfully.

As of now please remove the cucumber 2.0 dependency and use only 1.3.0, you would be able see your reports.

I am sure in future allure-reporter would support latest cucumber versions(2.0)