npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

teamcity-cucumber-formatter

v1.0.4

Published

TeamCity formatter for Cucumber

Downloads

39

Readme

teamcity-cucumber-formatter

npm version Build Status

TeamCity formatter for @cucumber/cucumber npm package

Install

$ npm install teamcity-cucumber-formatter --save-dev

Usage

There are 2 ways to use teamcity-cucumber-formatter as described here

1. On the CLI (Cucumber v.7.0.0 - 9.6.0):

$ cucumber-js --format ./node_modules/teamcity-cucumber-formatter

2. In a configuration file (Cucumber v.7.0.0 - 9.6.0):

{ format: './node_modules/teamcity-cucumber-formatter' }

3. In a configuration file (Cucumber v.10.0.0+):

import * as path from 'path';
import { pathToFileURL } from 'url';

const teamCityModulePath = path.resolve('node_modules', 'teamcity-cucumber-formatter', 'dist', 'teamcity-cucumber-formatter.js');
const teamCityModuleFilePath = pathToFileURL(teamCityModulePath).href;
...
{ format: [`"${teamCityModuleFilePath}"`] }

Note:

If you need to use teamcity-cucumber-formatter only on CI, you can specify it in such way in configuration file:

Cucumber v.7.0.0 - 9.6.0:

    format: [
        `json:${pathToCucumberJsonReport}`,
        `summary`,
        `progress-bar`,
        ...(process.env.CI ? [path.resolve('node_modules', 'teamcity-cucumber-formatter')] : [])
    ],

Cucumber v.10.0.0+:

    const teamCityModulePath = path.resolve('node_modules', 'teamcity-cucumber-formatter', 'dist', 'teamcity-cucumber-formatter.js');
    const teamCityModuleFilePath = pathToFileURL(teamCityModulePath).href;
    
    format: [
        `json:${pathToCucumberJsonReport}`,
        `summary`,
        `progress-bar`,
        ...(process.env.CI ? [`"${teamCityModuleFilePath}"`] : [])
    ],

Configuration

You have possibility

  • to publish artifacts (only screenshots for now) related to failed tests while TeamCity build is running as described here;
  • to link artifacts (only screenshots for now) with failed tests as described here. In this case screenshot will be available in Tests tab, in expanded section of failed test:

| Example of screenshot linked to failed test | |:-------------------------:| |Example Errors Report |

To have possibility to link and publish artifacts you need to use the following environment variables (set appropriate values):

  • TEAMCITY_CUCUMBER_PATH_TO_SCREENSHOTS - set a relative path (from project root, e.g. ./test_artifacts/screenshots) to local directory where screenshots are stored.
  • TEAMCITY_CUCUMBER_SCREENSHOT_NAME (optional) - set a name of saved screenshot (e.g. TIMESTAMP_TEST_NAME). You can do it in After hook for each failed test. By default a pickle.name value is used.
  • TEAMCITY_CUCUMBER_SCREENSHOT_EXTENSION - set an extension of saved screenshot. Be default a png format is used.
  • TEAMCITY_CUCUMBER_PUBLISH_ARTIFACTS_RUNTIME - set this variable (e.g. use true value) if you want to publish artifacts while TeamCity build is running.
  • TEAMCITY_CUCUMBER_ARTIFACTS_SUB_FOLDER - set this variable if some subfolder for screenshots is used inside the TeamCity artifacts storage (e.g. screenshots). Don't set it if you save screenshots directly in Artifacts.

| Example of TeamCity artifacts subdirectories | |:-------------------------:| |Example Errors Report |