cypress-cucumber-preprocessor: Cucumber report is missing when visit another site

Current behavior

image image

cucumber-report.json

[
  {
    "description": "",
    "elements": [
      {
        "description": "",
        "id": "searchengine;visiting-the-frontpage;;4",
        "keyword": "Scenario Outline",
        "line": 10,
        "name": "visiting the frontpage",
        "steps": [
          {
            "keyword": "When ",
            "line": 3,
            "name": "I visit http://google.com",
            "result": {
              "duration": 1626000000,
              "status": "passed"
            },
            "match": {
              "location": "not available:0"
            }
          },
          {
            "keyword": "Then ",
            "line": 4,
            "name": "I should see a search bar",
            "result": {
              "duration": 79000000,
              "status": "passed"
            },
            "match": {
              "location": "not available:0"
            }
          }
        ],
        "type": "scenario"
      },
      {
        "description": "",
        "id": "searchengine;visiting-the-frontpage;;5",
        "keyword": "Scenario Outline",
        "line": 11,
        "name": "visiting the frontpage",
        "steps": [
          {
            "keyword": "When ",
            "line": 3,
            "name": "I visit http://google.com",
            "result": {
              "duration": 840000000,
              "status": "passed"
            },
            "match": {
              "location": "not available:0"
            }
          },
          {
            "keyword": "Then ",
            "line": 4,
            "name": "I should see a search bar",
            "result": {
              "duration": 84000000,
              "status": "passed"
            },
            "match": {
              "location": "not available:0"
            }
          }
        ],
        "type": "scenario"
      }
    ],
    "id": "searchengine",
    "keyword": "Feature",
    "line": 1,
    "name": "SearchEngine",
    "uri": "features/search.feature"
  }
]

Desired behavior

From my code, result of “http://duckduckgo.com” should be in json and ndjson.

Test code to reproduce

My code

search.feature

Feature: SearchEngine
  Scenario Outline: visiting the frontpage
    When I visit <site>
    Then I should see a search bar
  
  Examples:
  | site |
  | http://duckduckgo.com |
  | http://duckduckgo.com |
  | http://google.com |
  | http://google.com |

search.step.js

const { When, Then } = require("@badeball/cypress-cucumber-preprocessor");

When("I visit {}", (site) => {
    cy.visit(site);
});

Then("I should see a search bar", () => {
  cy.get("input").should("be.visible");
});

Versions

  • Cypress version: 12.5.1
  • Preprocessor version: 15.1.3
  • Node version: 18.9.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (3 by maintainers)

Commits related to this issue

Most upvoted comments

This will likely depend on whether this is answered: https://github.com/cypress-io/cypress/issues/26613.