webdriverio: @wdio/cucumber-framework doesn't report variables in dataTables from Scenarios Outline Examples

There is an issue which persists along wdio versions which is parsing variable values from Examples in Scenario Outline to the Json Reporter in data tables See the report: image And the feature: image image

The execution is ok, the problem happens when parsing the variable. See the json report block:

"cells": [
                                            "<name>",
                                            "<description>",
                                            "<accountPlan>",
                                            "<API>",
                                            "<environment>",
                                            ""
                                        ],

Which is taken in the html as html nodes because the '<>; symbols

My npm dependencies: “devDependencies”: { “@babel/cli”: “7.8.4”, “@babel/core”: “7.9.0”, “@babel/preset-env”: “^7.9.6”, “@babel/register”: “^7.7.0”, “@wdio/cucumber-framework”: “6.1.13”, “@wdio/local-runner”: “5.23.0”, “@wdio/spec-reporter”: “5.23.0”, “@wdio/sync”: “5.23.0”, “chromedriver”: “^83.0.0”, “expect”: “24.3.0”, “expect-webdriverio”: “0.2.0”, “fs-extra”: “^9.0.0”, “geckodriver”: “^1.19.1”, “multiple-cucumber-html-reporter”: “^1.16.2”, “wdio-chromedriver-service”: “5.0.2”, “wdio-cucumberjs-json-reporter”: “^2.0.0”, “wdio-geckodriver-service”: “^1.0.3”, “winston”: “^3.2.1”, “yargs”: “^15.3.1”

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 27 (19 by maintainers)

Most upvoted comments

I’ve raised the PR that should give an idea on how to to fix the issue.

Even though “it works” the code doesn’t look well and can be optimized 😃

Here is the test data I used:

Feature file

Feature: Scenarios Outline Variables

    Scenario Outline: whatever
    Given Time <time> and Weather <weather> are passed
        | time      | weather   |
        | <time>    | <weather> |

    Examples:
        | time      | weather   |
        | first1    | cold1     |
        | second1   | warm1     |

    Examples:
        | time      | weather   |
        | first22   | cold22    |
        | second22  | warm22    |

step definition

Given(/^Time (.*) and Weather (.*) are passed$/, function (t, w, table) {
    console.log(t, w);
});

how it looks now image

I’ll try to complete it on Sunday, otherwise feel free to pick it up because I don’t have free time next week 😦

Great! It´s fixed, thank you very much for your effort!

@mgrybyk

Already tested it with my report and it works 🎉