SpecSync Documentation
Getting StartedConfigurationGuidesDownloads
Azure DevOps
Azure DevOps
  • Introduction to SpecSync for Azure DevOps
  • Getting started
    • Getting started using SpecFlow
    • Getting started using Cucumber or other Gherkin-based BDD tool
  • Installation & Setup
    • Install as .NET tool
    • Install as .NET Console App
    • Install as native binaries for Linux or macOS
    • Install as Docker image
    • Setup and Configure
  • Features
    • Push features
      • Pushing scenario changes to Test Cases
      • Configuring the format of the synchronized test cases
      • Synchronizing Scenario Outlines
      • Add new Test Cases to an Area or an Iteration
      • Mark Test Cases as Automated
      • Setting Test Case state on change
      • Update Test Case fields
      • Attach files to Test Cases using tags
      • Customization: Setting Test Case fields with default values
      • Customization: Update custom Test Case fields on push
      • Customization: Ignoring marked Test Case steps
      • Customization: Ignoring Test Case Tags
      • Customization: Ignore non-supported local tags
      • Customization: Mapping tags
      • Customization: Synchronizing scenarios from feature branches
      • Customization: Reset Test Case state after change
      • Customization: Automatically link changed Test Cases
      • Customization: Synchronize linked artifact titles
      • Customization: Add Test Cases to Suites
      • Customization: Do not synchronize title
    • Pull features
      • Pulling Test Case changes to local scenarios
    • Common synchronization features
      • Configuration key
      • Remote scope
      • Linking Work Items using tags
      • Synchronizing Test Case hierarchies using Test Suites
      • Include synchronized Test Cases to a Test Suite (deprecated)
      • Excluding scenarios from synchronization
      • Synchronization conflict resolution
      • Re-link scenarios to new Test Cases
    • Test result publishing features
      • Publishing test result files
      • Support for Azure DevOps Test Plan / Test Suite based test execution
      • Customization: Publishing test results to multiple Test Suites
    • General features
      • Azure DevOps authentication options
      • Configuration file
      • Hierarchical configuration files
      • Local test case conditions
      • Configuration wizards
      • SpecSync plugins
    • Customizations
    • Plugin list
  • Licensing
  • Guides
    • What is my Azure DevOps project URL?
    • How to define the local feature-set to be synchronized
    • Filters and scopes
    • How to synchronize automated test cases
    • How to use SpecSync from build or release pipeline
    • How to publish test results from pipelines using the VSTest task
    • How to use the SpecSync Azure DevOps pipeline tasks
    • How to link GitHub pull requests
    • How to upgrade to a newer version of SpecSync
    • How to attach files to test results
    • Using SpecSync with SpecFlow+
    • Using SpecSync with Cucumber
    • Using SpecSync with Cypress
    • Using SpecSync with Postman
    • Using SpecSync with TestNG
    • Using SpecSync on macOS or Linux
    • Using SpecSync inside a Docker container
    • How to handle Test Cases of multiple parallel application releases
    • Migrating from SpecSync v3 to v5
    • Migrating from SpecSync v2 to v3
    • Migrating from SpecSync v1 to v2
  • Changelog
  • Release Model and Roadmap
  • Downloads
  • Reference
    • Command line reference
      • init
      • upgrade
      • push
      • pull
      • publish-test-results
      • re-link
      • version
    • Configuration reference
      • toolSettings
      • local
      • remote
      • knownRemotes
      • synchronization
        • push
        • pull
        • automation
        • state
        • areaPath
        • iterationPath
        • links
        • attachments
        • format
        • fieldUpdates
      • hierarchies
      • publishTestResults
      • specFlow
      • reqnroll
      • customizations
    • Compatibility
    • Older versions
  • Contact
    • SpecSync Support
    • Troubleshooting
    • FAQ
  • Project Website
Powered by GitBook
On this page
  • Location of the attached files
  • Custom attachment tags

Was this helpful?

  1. Features
  2. Push features

Attach files to Test Cases using tags

PreviousUpdate Test Case fieldsNextCustomization: Setting Test Case fields with default values

Last updated 2 months ago

Was this helpful?

This feature is supported in SpecSync v3.3 or later.

SpecSync can attach files to Test Cases during synchronization using tags. In order to use this feature, it has to be enabled in the configuration file using the .

{
  ...
  "synchronization": {
    ...
    "attachments": {
      "enabled": true
    },
    ...
  },
  ...
}

You can specify one or more attachment tags for a scenario and you can also use wildcards () as well in the tag to attach multiple files with a single tag. The attachment tag should be in the @attachment:<attached-file-name> format, but the tag prefix can be customized.

For example, to attach a file screen.png to a scenario, you have to tag it with @attachment:screen.png. To attach all PNG files from within images folder (including sub-folders), you can tags the scenario with @attachment:images/**/*.png.

SpecSync tracks the changes of the attached files and automatically re-attach the updated files when they are changed. The attachments are removed from the Test Case when the attachment tag is removed from the scenario.

As the Gherkin tags cannot contain spaces, when specifying a file name with a space character in the attachment tags you have to use the underscore (_) character instead of the spaces.

Multiple attachment tags with the same file name or invalid file path causes synchronization error.

Location of the attached files

By default the specified files are searched relative to the folder of the feature file that contains the attachment link. For example if you specify an attachment as @attachment:screen.png, the file screen.png has to be in the same folder as the feature file. You can also specify folder names as well, e.g. @attachment:img/screen.png or @attachment:../img/screen.png.

Alternatively the base folder for the attached files can also be specified using the synchronization/attachments/baseFolder setting. In this case the files are searched relative to the specified base folder independently of the path of the feature files.

Custom attachment tags

By default SpecSync uses the tags with the attachment prefix (@attachment:<attached-file-name> format) to attach files, but this can be customized. You can specify additional tag prefixes to specify different kind of attachments.

For example if you want to attach both wireframe files and specification document files, you can configure a wireframe and a specification prefix, so that you can link files with tags like: @wireframe:screen.png @specification:overview.docx. For that the synchronization/attachments/tagPrefixes setting has to be used as the following example shows.

{
  ...
  "synchronization": {
    ...
    "attachments": {
      "enabled": true,
      "tagPrefixes": [
        "wireframe",
        "specification"
      ]
    },
    ...
  },
  ...
}
synchronization/attachments section
glob patterns