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

@dennisdigital/polaris-e2etesting

v1.0.1

Published

Tools for running user tests against our siteapps

Downloads

2

Readme

polaris-e2etesting

Tools for running user tests against our siteapps

Setup

  1. yarn add -D dennisinteractive/polaris-e2etesting

  2. Create e2e_tests folder with following structure:

mkdir e2e_tests e2e_tests/features e2e_tests/tests e2e_tests/output e2e_tests/screenshots && touch e2e_tests/output/.gitignore && echo '*\n!.gitignore' > e2e_tests/output/.gitignore

e2e_tests
│
└───features
│   │   bddtest1.feature
│   │   bddtest2.feature
│   
└───tests
│   │   test1.test.js
│   │   test2.test.js
│   
└───output
└───screenshots
  1. Create runTests.js file
const runTests = require('@dennisdigital/polaris-e2etesting');
runTests();
  1. Add "test:e2e": "node ./runTests.js" to your package.json scripts section

  2. Update the site's Dockerfile (docker/Dockerfile) to include the following after ARG BUILD_COMMAND

# Install dependencies for running Puppeteer
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*
  1. Ensure the siteapp's webpack config does not include the Dotenv plugin for the server bundle (it should still be used for the client bundle)

Usage

Extra config

Default codecept config can be overriden like so

const runTests = require('@dennisdigital/polaris-e2etesting');

runTests({
  extraConfig: {
    helpers: {
      TestCafe: {
        browser: 'safari',
      },
    },
    gherkin: {
      steps: [
        './e2e_tests/step_definitions/steps.js',
      ],
    },
  },
});

extraConfig will be merged with default config and override any already defined options. This allows adding extra site specific step definitions to the gherkin.steps array

Override URL

By default a local server will be spun up running the local sitecode (this assumes the code has been compiled, using either yarn build or yarn watch).

If you wish to use a specific url instead this can be overridden by passing the baseUrl parameter. In this case the local server won't run, instead the tests will just run against the url specified

const runTests = require('@dennisdigital/polaris-e2etesting');

runTests({
  baseUrl: 'https://evo.develop.coreapp.didev.co.uk',
});

Arguments

Arguments can be passed to the package.json script like so: yarn test:e2e --dev

  • yarn test:e2e --dev - shows browser when running tests

Development

To develop against polaris-e2etesting from within a siteapp (e.g. https://github.com/dennisinteractive/polaris-siteapp) do the following:

  • Clone both the polaris-e2etesting repo and the siteapp repo into their respective folders
  • In polaris-e2etesting run yarn link. This will allow it to be symlinked in other projects
  • In polaris-siteapp run yarn to install dependencies, then run yarn link polaris-e2etesting. This means that polaris-siteapp will now use your local copy of polaris-e2etesting instead of the copy in its node_modules folder, allowing you to develop against it
  • Run yarn test:e2e in polaris-siteapp to start your local version of the test runner