Search code examples
azureazure-devopscucumberreport

PublishCucumberReport - Can't find output path of cucumber report


The plugin can't find files and generate HTML report on Azure DevOps

Azure Devops plugin - https://marketplace.visualstudio.com/items?itemName=MaciejMaciejewski.azure-pipelines-cucumber

azure-pipelines.yml

jobs:
  # Build Electron
  - job: UserAcceptanceTest
    displayName: E2E-Tests
    pool:
      name: ado-win-pool
    timeoutInMinutes: 120
    steps:
      - task: CopyFiles@2
        inputs:
          sourceFolder: $(Build.SourcesDirectory)
          targetFolder: $(Build.ArtifactStagingDirectory)

      - task: PublishPipelineArtifact@1
        displayName: 'Publishing build artifacts'
        inputs:
          targetPath: $(Build.ArtifactStagingDirectory)

      - task: NodeTool@0
        displayName: 'Install Node 12.x'
        inputs:
          versionSpec: 12.x

      - task: PublishCucumberReport@1
        displayName: 'Publish Cucumber Report'
        inputs:
          jsonDir: target/results/cucumber/
          outputPath: target/results/cucumber/

Actual:

  Found 0 matching C:/agent/_work/13/s/target/results/cucumber pattern
    ##[warning]Error: Not found outputPath: C:\agent\_work\13\s\target\results\cucumber
    Finishing: Publish Cucumber Report

Expected: Found cucumber JSON file.


Solution

  • In your case, the problem is in the path provided for the cucumber report. It should be a path to the folder with cucumber reports in json format, but not to some particular json.

    So, the correct snippet in yaml would be:

            - task: PublishCucumberReport@1
            displayName: 'Publish Cucumber Report'
            inputs:
            jsonDir: target/results/cucumber/
            outputPath: target/results/cucumber/