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

etaf

v1.2.0

Published

This framework is designed to help you get easily and quickly started with test automation on any project

Downloads

8

Readme

npm version Build Status AppVeyor Build status

Quality Gate status Lines of Code Coverage

Easy Test Automation Framework (ETAF)

This framework is designed to help you get easily and quickly started with test automation on any project. It is based on WebdriverIO and cucumber (cucumberJS to be exact). Integrating this module provides a ready-to-go environment to write and execute functional test scenarios. It includes:

  • A template to generate your test automation project so that you don't start from a blank page
  • The necessary packages pre-configured to be able to run your scenarios without requiring any other setup. The only requirement is to have a browser on the machine running the tests: either Chrome or Firefox.
  • Guidelines and good practices to ensure great maintainability of test scenarios
  • A decoupled architecture between scenarios and data sets to allow high execution scalability
  • Some useful custom browser commands such as fillInForm to ease and accelerate test automation writing. See related JSDoc for more details.

This framework is suitable for big solutions that will be covered by an important number of scenarios. Note that it requires good development skills as well as good knowledge and understanding of JavaScript.

Integrating ETAF to Your Project

Prerequisites

  • Install npm and Node.js (latest available 8.X.X version)
  • Install npx: npm install -g npx
  • Install Java JRE (version 8 or greater)

Adding ETAF Package and Configuration to Your Project

  1. Create a new folder <AUTOMATED_TESTS> in your project to host your automated tests.
  2. Create a new NPM project by executing npm init. More information about the different options here.
  3. Install EAT package by running the following command from <AUTOMATED_TESTS>: npm install --save etaf. It creates a node_modules directory containing all the dependencies needed to run the project.
  4. From <AUTOMATED_TESTS>, run npx etaf install to generate the skeleton of your test project. If you want to generate the skeleton of your project with some working samples, run: npx etaf install --sample=true and then run npm install --no-optional

Behind a Proxy

Set the configuration of your proxy by editing the .npmrc file in your home directory:

proxy=http://localhost:3128
https-proxy=http://localhost:3128

Running Functional Tests

  • Run npx etaf run to launch the tests as they would be played remotely.
  • Run npx etaf run wdio.local.conf.js to run the tests with local configuration.
  • Run npx etaf run wdio.debug.conf.js to run the tests with debug configuration (see Running Tests in Debug Mode section for mode details).

Note that the local and debug configurations have to be generated first (see Configuration section).

Configuration

  • The global configuration is set in the wdio.conf.js file, in the root folder of your project.
  • The local configuration is set in the wdio.local.conf.js. This local configuration can be reset by running npx etaf generate-local-conf.
  • The debug configuration is set in the wdio.debug.conf.js. This debug configuration can be reset by running npm etaf generate-local-conf.

Parameters

To pass parameters to the command, add --: npx etaf run --parameter1=value1

URL of the Website to Test

Add command line parameter --baseUrl="https://base.url" or update the wdio configuration file accordingly.

Locale

Add command line parameter --locale="en" or update the wdio configuration file accordingly.

Running a Subset of Tests Using Tags

Add command line parameter --tagExpression='@tag'.

Tags can be combined:

  • --tagExpression='@tag1 or @tag2' runs test tagged with @tag1 or @tag2
  • --tagExpression='@tag1 and @tag2' runs test tagged with both @tag1 and @tag2
  • --tagExpression='not @tag1' runs tests not tagged with @tag1

See Cucumber Tag Expressions documentation for more details.

Realm (market, brand, environment, ...)

A realm is a configuration file that defines some wdio properties specific to a realm. A realm can be seen as a market, a brand, an environment (such as dev or staging), etc. or a combination of them. Realm files are stored in the conf/realm directory.

Usually realms define at least the following properties:

  • baseUrl: website to test
  • specs: list of features to run

Add command line parameter --realm="xxx". Where xxx is the file name in conf/real without the .js extension.

For example:

  • To run NRT tests from the catalog domain on mywebsite.com: npx etaf run --baseUrl="https://mywebsite.com" --tagExpression='@nrt and @catalog'
  • To run NRT tests on realm us-dev: npx etaf run --realm="us-dev" --tagExpression='@nrt'

Running Functional Tests in Debug Mode

For IntelliJ, follow instructions at Debug with Chrome Debugging Protocol. At step #4, run npx etaf run wdio.debug.conf.js

Running Unit Tests

  • Run npx etaf test-unit to run unit tests
  • Run npx etaf test-unit-with-coverage to run unit tests with code coverage computation

Writing Automated Tests

Read detailed explanations in Framework.md.