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

vue-cli-plugin-codeceptjs-puppeteer

v0.2.4

Published

e2e codeceptjs & puppeteer plugin for vue-cli

Downloads

516

Readme

vue-cli-plugin-e2e-codeceptjs

Hey, how about some end 2 end testing for your Vue apps? 🤔

Let's do it together! Vue, me, CodeceptJS & Puppeteer. 🤗

Browser testing was never that simple. Just see it! 😍

I.amOnPage('/');
I.click('My Component Button');
I.see('My Component');
I.say('I am happy!');
// that's right, this is a valid test! 

How to try it?

Requirements:

  • NodeJS >= 8.9
  • NPM / Yarn
  • Vue CLI installed globally
npm i vue-cli-plugin-codeceptjs-puppeteer --save-dev

This will install CodeceptJS, CodeceptUI & Puppeteer with Chrome browser.

To add CodeceptJS to your project invoke installer:

vue invoke vue-cli-plugin-codeceptjs-puppeteer

You will be asked about installing a demo component. If you start a fresh project it is recommended to agree and install a demo component, so you could see tests passing.

Running Tests

We added npm scripts:

  • test:e2e - will execute tests with browser opened. If you installed test component, and started a test server, running this command will show you a brower window passed test.
    • Use --headless option to run browser headlessly
    • Use --serve option to start a dev server before tests

Examples:

npm run test:e2e 
npm run test:e2e -- --headless
npm run test:e2e -- --serve 

This command is a wrapper for codecept run --steps. You can use the Run arguments and options here.

  • test:e2e:parallel - will execute tests headlessly in parallel processes (workers). By default runs tests in 2 workers.
    • Use an argument to set number of workers
    • Use --serve option to start dev server before running

Examples:

npm run test:e2e:parallel
npm run test:e2e:parallel -- 3
npm run test:e2e:parallel -- 3 --serve

This command is a wrapper for codecept run-workers 2. You can use the Run arguments and options here.

  • test:e2e:open - this opens interactive web test runner. So you could see, review & run your tests from a browser.

npm run test:e2e:open

Directory Structure

Generator has created these files:

codecept.conf.js          👈 codeceptjs config
jsconfig.json             👈 enabling type definitons
tests
├── e2e
│   ├── app_test.js       👈 demo test, edit it!
│   ├── output            👈 temp directory for screenshots, reports, etc
│   └── support
│       └── steps_file.js 👈 common steps
└── steps.d.ts            👈 type definitions

If you agreed to create a demo component, you will also see TestMe component in src/components folder.

How to write tests?

Enjoy testing!

Testing is simple & fun, enjoy it!

With ❤ CodeceptJS Team