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

tasty

v0.14.1

Published

Integration testing helper for web

Downloads

67

Readme

Tasty

npm build windows coverage code climate

Tasty helps to test fully assembled web applications in near-production environments on real web clients by emulating real users.

npm install -g tasty

Tasty supports both multiple and single page applications (with server rendering too) and code coverage. It respects Content Security Policy and SSL/TLS.

How it works

Tasty server controls connected web clients to run your tests in runner of your choice against your application.

console

Client can emulate real user: navigate, fill forms, check page contents.

browser

  1. Add tasty.js module to your assembly or markup.
  2. Assemble and serve your application from staging server.
  3. Provide CSP directives for Tasty and use test certificates, if needed.
  4. Write tests for your preferred test framework using Tasty async tools.
  5. Run Tasty server. Open application in any of your clients.
  6. For each client Tasty will run your tests and return all output.
  7. Edit tests, Tasty will re-run them automatically, if needed.

Is Selenium server required?

No. Tasty client is intended to run inside browser environment without WebDriver.

But you'll probably need Selenium-driven clients or tools like PhantomJS, Puppeteer and SlimerJS for automation.

Why Tasty?

The main purposes are:

  1. Emulate real user experience.
  2. Support any web client without WebDriver.
  3. Keep test scripts as simple as possible.

Tasty gives you only high-level tools to help treat your application as a black box, just like real user does. Interact with text and graphics, not with heartless HTML elements. Try not to use knowledge of your application's markup, assume you're helping a real person to achieve some goals.

Similar tools

Protractor and WebdriverIO are Selenium-based end-to-end test frameworks useful for intergration testing. Also take a look at Appium, CasperJS and Selendroid.

Karma and Testee are great tools for cross-browser unit testing.

Example

Serve your application.

<html>
	<head>
		...
		<script src="//localhost:8765/tasty.js"></script>
	</head>
	<body>
		<form action="/dashboard">
			Welcome!
			<input placeholder="Username" type="text" />
			<input placeholder="Password" type="password" />
			<input value="Log in" type="submit" />
		</form>
	</body>
</html>

Write a test (this one uses Mocha).

describe('login form', function() {
	it('logs user in', function() {
		is(text('Welcome!'));
		click(text('Username'));
		type(tasty.config.username);
		click(text('Password'));
		type(tasty.config.password);
		click(text('Log in'));
		is(location('/dashboard'));

		return now();
	});
});

Run Tasty server.

tasty test.js --runner mocha --username 'John Doe' --password 'secret!'

Open your application in your client. Tasty will run the test, print all output and exit.

Documentation

Browser support

sauce labs

browser support

Building

npm run prepublish

Testing

npm test

Main tests use SlimerJS and PhantomJS. SlimerJS itself requires Firefox to be installed. PhantomJS suite requires phantomjs to be available via command prompt.

Because of tests for obsolete AppCache manifest, PhantomJS could put HTML page into persistent cache and then ignore clearMemoryCache API calls. This may require to delete cache files manually from the following locations:

  • %HOMEDRIVE%%HOMEPATH%\AppData\Local\Ofi Labs\PhantomJS
  • ~/Library/Caches/Ofi Labs/PhantomJS
  • ~/.local/share/Ofi Labs/PhantomJS/

Browser support

npm run support

Real-browser support tests are made possible by SauceLabs. Automation requires SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables, which are kindly provided by TravisCI.

Windows

windows

Everything works fine, yay!