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

testcafe-static-analyser

v1.1.0

Published

Static analyser of TestCafe test code.

Downloads

7

Readme

TestCafe Static Analyser (beta)

A tool that analyses the source code of your TestCafe tests and generates a nice and searchable html report from it.

This tool allows you to show fixtures and tests in a Gherkin-like format, even if you do not use gherkin at all.

npm badge

To install TestCafe Static Analyser

  • run the command npm install --save-dev testcafe-static-analyser.

To start TestCafe Static Analyser

  • insert the following script in the package.json file:
"testcafe-static-analyser": "testcafe-static-analyser"
  • run the command npm run testcafe-static-analyser
    • this will create the testcafe-static-analyser.json file
    • in this file, modify the sourceFiles section
    • re-run the command

To configure TestCafe Static Analyser

How it works

  • Every fixture is automatically tagged by analysing its folder hierarchy, its filename, its description and the .meta declarations;
  • Every test is automatically tagged by analysing its description and the .meta declarations
  • Every step that may be present in a test is also automatically tagged by analysing its description;
  • every tag generated at the step and the test levels is bubbled up to the fixture tags;
  • The html report enables you to search/filter fixtures by tag.

How it looks

  • Fixtures are reported as Features and tests as Scenarios

report Fixture details Fixture details Fixture details

Samples

TestCafe repo

  • running testcafe-static-analyser on the TestCafe repo itself will produce the following report (the report has been filtered with the word editable):

Filtered fixtures

  • clicking on the GH-711 will produce the details of the selected fixture:

Fixture details

generating a gherkin like report

  • the following code:
test("Scenario: scenario example", async () => {
  // Only on devci
  code omitted for brevity

  // Given I signed in the App
  code omitted for brevity

  // When I enter my name
  code omitted for brevity

  // And I enter my email
  code omitted for brevity

  // Then I can send my feedback to TestCafe team
  code omitted for brevity
});

will produce the following report: Fixture details

The vision

  • Be able to have an high overview of all existing e2e TestCafe tests;
  • Be able to dynamically tag at any level
  • Be able to find all tests associated to a specific tag;
  • Be able to merge the result of tests executions (need to write a custom testcafe reporter for this purpose);
  • Be extensible to enable any third-party to add custom parsers and tags (without cloning the project);
  • Be extensible to make the html report customizable (without cloning the project).