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

autobahn-core

v0.1.19

Published

A testing framework for creating API & Browser tests

Downloads

14

Readme

Introduction

Autobahn is a BDD framework for performing API & Browser tests via testcafe, supertest & newman. The main goal is to provide a structured folder structure & make it easier to implement within a CI/CD pipeline.

Features

  • Gherkin/Cucumber integration
  • Read browser console output along with api request and responses in debug mode
  • Automatic replacement of application configuration item values (for use with secrets on a CI/CD pipeline)
  • API testing support through supertest & gherkin or newman if preferred :)
  • Generate code such as step definitions & page object models

Getting started

First add the dependency to your project npm i autobahn-core

make sure you are running with typescript version >=4.5.5

in the scripts property of your package.json file add the following:

"generate": "autobahn generate"

Then run the script (npm run generate). On the first run it will ask you to create a project config file. Doing this will also generate the basic folder structure.

After that generate your first project config :) Also feel free to check out the Examples folder to get a head start.

Using the framework:

CLI usage:

Generator

autobahn generate

A wizard will appear and guide you through the test file generation process.

Running Tests

autobahn [...Options]

note: any TestCafe specific CLI options not stated below will be passed through, and processed as normal.

| Parameter | Description | Type | | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | | Mandatory Parameters | | -p,--product | the 'product' name to test against | string | | -e, --environment | the environment to test against | string | | General Parameters | | --help | Show help | boolean | | --version | Shows the version/build number number of the framework | boolean | | -d, --debug | Run the framework with verbose logging; this will also print browser console statements, api requests & responses | boolean, default: false | | -h, --headless | Runs the browser(s) in headless mode | boolean | | -b, --cache | Sets whether browser caching should be enableed | boolean, default: false | | --retry-test-pages | If this option is enabled, testcaf retries failed neetwork requests for webpages during the test run. This is limited to 10 attempts | boolean, default: true | | -c, --pt | sets the number of concurrent/parallel threads the test run should use | number | | -s, --saveReport | Saves the files for the configured report types | boolean, default: false | | -r, --browserReports | Overrides the configured reports with the provided value | string | | Test Filters | | -t, --tags | Sets the tags to filter tests against, multiple tag values can be provided by separating the values by pipe | do not include the @ symbol in front of each tag name | string | | -f, --filterTest | Sets the filter to use for the test run. You can provide a fixtureName (Feature name) and/or testName (Scenario/Scenario outline name) regexp. e.g. --filterTest="testName='(.*)I can prerform a search' | fixtureName='(.*)Google'" Filters tests by test name and/or fixture name. Provided parameters are pipe separated. You do not need to provide both testName='(.*)' and fixtureName='(.*)' one or the other can be sufficient. Regex patterns are supported. In the example provided, tests are filtered to only run tests with a name ending in 'Gas Quote' from a feature file with the Feature name ending in 'Quoting Feature' | string |

Building the repo locally

NPM: npm i -g verdaccio gulp nodemon

Verdaccio is a tool that creaetes a local NPM registry; this can be used to test the package without having to publish to the public registry.

npm i

For versioning, install the GitVersion dotnet tool: dotnet tool install --global GitVersion.Tool --version 5.*

Build and Test

Building and testing can be performed by running: npm run ci

Contribute

Always happy to have contributions & feedback for the project :-)

The release branch for this repository is main, code should first have it's own branch then merged into develop

Please also check our Code Of Conduct

Other noteworthy projects and resources

These are other projects and resources that may come in handy:

  • Arthy000/gherkin-testcafe - Another gherkin framework for browser/integration testing with testcafe

  • Cucumber (Gherkin) Autocomplete - VS Code extension; Provides Gherkin support and can be configured to navigate to step definitions.

    • Example settings.json snnippet:
      "cucumberautocomplete.steps": [
          "./src/**/steps/**/*.ts",
      ],
      "cucumberautocomplete.syncfeatures": "./src/**/specs/**/*.feature",
      "cucumberautocomplete.strictGherkinCompletion": false,
      "cucumberautocomplete.strictGherkinValidation": false,
      "cucumberautocomplete.smartSnippets": true,
      "cucumberautocomplete.stepsInvariants": true,
  • TestCafe Documentation

  • Supertest Documentation

  • Newman Documentation